Early study of triangles can be traced to the 2nd millennium BC, in Egyptian mathematics (Rhind Mathematical Papyrus) and Babylonian mathematics. Systematic study of trigonometric functions begins in Hellenistic mathematics, reaching India as part of Hellenistic astronomy. In Indian astronomy, the study of trigonometric functions flowers in the Gupta period, especially due to Aryabhata (6th century). During the Middle Ages, the study of trigonometry is continued in Islamic mathematics, whence it is adopted as a separate subject in the Latin West beginning in the Renaissance with Regiomontanus. The development of modern trigonometry then takes place in the western Age of Enlightenment, beginning with 17th century mathematics (Isaac Newton, James Stirling) and reaching its modern form with Leonhard Euler. The ancient Egyptians and Babylonians had known of theorems on the ratios of the sides of similar triangles for many centuries. But pre-Hellenic societies lacked the concept of an angle measure and consequently, the sides of triangles were studied instead, a field that would be better called "trilaterometry".

The Babylonian astronomers kept detailed records on the rising and setting of stars, the motion of the planets, and the solar and lunar eclipses, all of which required familiarity with angular distances measured on the celestial sphere. Based on one interpretation of the Plimpton 322 cuneiform tablet (circa 1900 BC), some have even asserted that the ancient Babylonians had a table of secants. There is, however, much debate as to whether it is a table of Pythagorean triples, a solution of quadratic equations, or a trigonometric table.

Trigonometry is, of course, a branch of geometry, but it differs from the synthetic geometry of Euclid and