Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have two points $(x_1,y_1)$ and $(x_2,y_2)$

I want to calculate the other two points $(x_3,y_3)$ and $(x_4,y_4)$ of the square.

I have attached the image for explanation.

image

All 4 sides should be equal and have same angle.

share|improve this question
    
Just for your information, about signing one's posts. –  1015 Apr 12 '13 at 5:52
    
there's more than one solution to this... you might simply construct a square on the given side... –  long tom Apr 12 '13 at 5:55
    
Yes, its a square. Let me edit the post. –  Ankit Sharma Apr 12 '13 at 5:56
add comment

1 Answer 1

up vote 1 down vote accepted

The 2 solutions are:

  1. $P_3 =(x_1+(y_2-y_1),y_1-(x_2-x_1))$, $P_4 =(x_2+(y_2-y_1),y_2-(x_2-x_1))$; and
  2. $P_3'=(x_1-(y_2-y_1),y_1+(x_2-x_1))$, $P_4'=(x_2-(y_2-y_1),y_2+(x_2-x_1))$.

Thee two solutions are of course mirror images across the line extended through $x_1-x_2$. Performing the dot-product of $(P_2-P_1)$ with $(P_3-P_1)$ readily verifies that they two vectors form a $90$ degree angle. The remaining angles are quickly seen to also be $90$ degrees from inspection.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.