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.