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  .

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.
