In the third century Liu Hui wrote his commentary on the Nine Chapters and also wrote Haidao Suanjing which dealt with using Pythagorean theorem (already known by the 9 chapters), and triple, quadruple triangulation for surveying; his accomplishment in the mathematical surveying exceeded those accomplished in the west by a millennium. He was the first Chinese mathematician to calculate "π"=3.1416 with his "π" algorithm. He discovered the usage of Cavalieri's principle to find an accurate formula for the volume of a cylinder, and also developed elements of the infinitesimal calculus during the 3rd century CE.