Create a Square From A Line

This example uses a reference line to create 3 additional lines to form a square. The lines are arranged either clockwise or counter-clockwise.
Reference Line: x1= y1= x2= y2=
CW: CCW:

SVG Source:
Javascript:
OK in:IE11/CH32/FF23