In this Web version I have included Chinese characters, which were not in the published version. Some statements here are no longer up to date, but I have not made any major changes.
Donald B. Wagner
1. If [the length of] the shorter leg [of a right triangle] is 3 chi , and the longer leg is 4 chi, what is the hypotenuse?The third-century commentator Liu Hui  gives the following explanation for the first algorithm above:
Answer: 5 chi.
2. If the hypotenuse is 5 chi, and the shorter leg is 3 chi, what is the longer leg?
Answer: 4 chi.
3. If the longer leg is 4 chi, and the hypotenuse is 5 chi, what is the shorter leg?
Answer: 3 chi.
The method of right triangles:
Multiply the shorter leg and the longer leg each by itself, add, and extract the square root. This is the hypotenuse.
Or: Multiply the longer leg by itself; subtract this from the product of the hypotenuse by itself; extract the square root of the difference. This is the shorter leg.
Or: Multiply the shorter leg by itself; subtract this from the product of the hypotenuse by itself; extract the square root of the difference. This is the longer leg.
[Qian Baocong 1963, 241-242; cf. Vogel 1968, 90-91]
The shorter leg multiplied by itself is the red square, and the longer leg multiplied by itself is the blue square. Let them be moved about so as to patch each other, each according to its type. Because the differences are completed, there is no instability. They form together the area of the square on the hypotenuse; extracting the square root gives the hypotenuse.The diagram which Liu Hui refers to here is no longer extant, but it is clear that it must have shown a way of cutting up the squares on the two legs of the right triangle and fitting the pieces together to form the square on the hypotenuse. This method of cutting up and rearranging areas is used very often in Liu Hui's commentary; it is reminiscent of the Chinese game of 'Tangrams'.
[Qian Baocong 1963, 241]
Figure 1 shows a possible reconstruction of Liu Hui's diagram. A reader who was familiar with some elementary facts concerning congruency of triangles would, after some study of this diagram, have been able to see that the theorem is correct. Undoubtedly other reconstructions are possible, but I am not aware of any other proposed reconstruction which satisfies the condition that the two smaller squares are cut up and directly fitted together to form the larger square.
. On Liu Hui and his mathematics see [van der Waerden 1983, 192-207; Wu Wenjun 1982; Wagner 1978a, b, 1979].
. On Tangrams (qi qiao ban , 'seven ingenious pieces') see e.g. [Gardner 1974].