Square by Two Vertices
On a plane, a square is defined by the coordinates of two of its opposite vertices.
Your task is to determine the coordinates of the remaining two vertices of the square.
Input
The program will read from standard input (keyboard) two lines. The first line contains the coordinates of one vertex of the square, A[x]
and A[y]
. The second line contains the coordinates of the opposite vertex of the square, C[x]
and C[y]
. All numbers are real and do not exceed 10^6
in absolute value.
Output
The program should output to standard output (screen) two lines, each containing two space-separated numbers: B[x]
B[y]
, and D[x]
D[y]
. These represent the coordinates of the remaining two vertices of the square. The order of the output should ensure that A
, B
, C
, D
are listed in a counterclockwise sequence, with each coordinate rounded to four decimal places.