Constructing a Square with a Given Base

Construction Algorithm
1 Construct a line AB as a given base of the square.
2 Construct two perpendicular lines to AB at A and B.
3 Construct a circle centered at B and has a radius AB.
4 Generate the intersection point C between the circle and the perpendicular line at B.
5 Construct a perpendicular line at C.
6 Generate the intersection point D between the perpendicular at A and the perpendicular at C.
7 Join up the four points A, B, C and D to get the required square.
8 Switch to drag mode. Pick a free element. Move it around to check your construction.
Construction Theorem
A square is a quadrilateral whose four right angles and two adjacent sides equal in length.
Please enable Java for an interactive construction (with Cinderella).