This library is built in the open.
If you spot an error, have a suggestion, or just want to say hello — we’d love to hear from you.

Compiled by Cheng Dawei (styled Rusi, from Binqu, Xi’an) Revised by great-grandson Guang Shen (styled Suting and Peiwei); Reviewed by You Hong (styled Mei’an and Wufu)
The term "Gougu" (勾股) refers to the two legs of a right-angled triangle. Gou represents the shorter leg (base) and Gu represents the longer leg (altitude).
The horizontal width is called the base (gou), the vertical length is called the altitude (gu), and the diagonal connecting the two corners is called the hypotenuse (xian). This chapter uses the base and altitude to find the diagonal hypotenuse; the base and hypotenuse to find the length of the altitude; and the altitude and hypotenuse to find the width of the base. Finding inscribed squares or circles within these triangles, determining the height of mountains, the depth of valleys, the width of cities, or the distance of roads—all can be known through this method.
The diagonal is the hypotenuse
The long side is the altitude
The short side is the base
The shape of the gougu is exactly like that of a carpenter’s square original: quchi (曲尺). The base is the short arm original: zhi (咫), an ancient measurement of about 8 inches, and the altitude is the long arm original: chi (尺), a standard foot. The diagonal extending from the tip of the short arm to the end of the long arm is the hypotenuse.
For example, if the base is 3 feet and the altitude is 4 feet, the hypotenuse is 5 feet.
This describes the classic 3-4-5 right triangle, a foundational example used in Chinese mathematics since antiquity to demonstrate the relationship $a^2 + b^2 = c^2$.