The origins of trigonometry lie in astronomy, especially in finding the length of the chord that connects the endpoints of an arc of a circle. Hipparchus discovered a solution to this problem, that was later refined by Ptolemy who authored the great astronomical work the Almagest.