Squaring a Rectangle

Here is a very interesting construction problem:  Suppose you are given a rectangle.  How can your construct a square whose area equals the area of the given rectangle using straightedge and compass?  This problem is called "[b][color=#0000ff]squaring a rectangle[/color][/b]".[br][br]We can rephrase the problem as follows: Let a, b be the width and height of the given rectangle.  Then the required square must have the side [math]\sqrt{ab}[/math].  Therefore, the problem boils down to "how can we construct a line segment of length [math]\sqrt{ab} [/math] if we are given the line segments of length a and b?" [br][br]Take a look at the following diagram to get an idea on how to solve it ...
[b]Question[/b]: You can drag the blue points to change the values of a and b.  Can you express c in term of a and b?[br][br][b]Hint[/b]: Use similar triangles.

Information: Squaring a Rectangle