If the the given coordinates forms a diagonal of the square
else if ( Math . abs ( x2 - x1 ) === Math . abs ( y2 - y1 ) ) { document . write ( x1 + " " + y2 + " " ) ; document . write ( x2 + " " + y1 ) ; }