Find 3rd and 4th co-ordinates for a square given co-ordinates of two points? To construct a square we need 4 points . In my problem 2 points are given we can find 3rd and 4th point . 
e.g. A (1,2) B(3,5) what should be the co-ordinate of 3rd (C) and 4th (D) points . Please provide a formula to calculate third point and fourth point .
As i know there will be two pairs of C and D both will be in opposite direction as 
If C and D is above the given line (AB) then other pair C' and D' is below the given line(AB) .  AB is not diagonal for given square  .
 A: The vector from $A=(1,2)$ to $B=(3,5)$ is $V=B-A=(2,3)$. A vector perpendicular to $V$ with the same length is $W=(-3,2)$. Then another corner of such a square is $A+W=\boxed{(-2,4)}$, and a fourth is $B+W=\boxed{(0,7)}$.
An alternate answer is to use $A-W=\boxed{(4,0)}$ and $B-W=\boxed{(6,3)}$ as the third and fourth corners. This answer corresponds to choosing $-W$ as the perpendicular to $V$ above.
A: Let $A = (x_A, y_A), B = (x_B, y_B), \Delta x = x_B - x_A, \Delta y = y_B - y_A$.
Then
$$x_C = x_B \pm \Delta y$$
$$y_C = y_B \mp \Delta x$$
$$x_D = x_A \pm \Delta y$$
$$y_D = y_A \mp \Delta x$$
In your case:
$$x_A = 1, y_A = 2$$
$$x_B = 3, y_B = 5$$
$$\Delta x = 2, \Delta y = 3$$
Then
$$x_C = 0, 6; y_C = 7, 3$$
$$x_D = -2, 4; y_D = 4, 0$$
$$C = (0,7), C' = (6, 3)$$
$$D = (-2,4), D' = (4, 0)$$
This can be simply proved geometrically by surrounding your square by right triangles with sides as hypotenuses.
A: For the sake of completeness, here is a solution if we were not given the edge $AB$, but the diagonal $AC$ with $A=(1,2), C=(3,5)$.
The centroid of the square and intersection of the diagonals is 
$$M = \frac{1}{2}(A+C) = \frac{1}{2} (1+3,2+5)=(2,3.5)$$
The vector of $M$ to $C$ is 
$$mc = C-M = (3,5)-(2,3.5)=(1,1.5)$$
The two perpendiculars of $mc$ with equal length are $v_1=(1.5,-1)$ and $v_2=(-1.5,1)$.
We can use $M$, $v_1$ and $v_2$ to describe the second diagonal. Therefore:
$$B=M+v_1 = (2,3.5)+(1.5,-1)=(3.5,2.5)$$
$$D=M+v_2 = (2,3.5)+(-1.5,1)=(0.5,4.5)$$
