The Pythagorean Algorithm and the Pythagorean Theorem

This algorithm takes as input two squares. It places them together, cuts off the red triangles, and rotates them to produce a single square. In the process, the algorithm proves the Pythagorean Theorem, since if the two input squares sit on the legs of a right triangle, the output square sits on the hypotenuse.
Drag the point labeled alpha to cause the triangles to rotate, transforming two squares into one, and one into two.