Trigonometry (Greek: "the measure of triangles") is a branch of mathematics dealing with angles, triangles and trigonometric functions such as sine and cosine. It has some relationship to geometry, though people don't seem to agree on exactly what that relationship is. For some, trigonometry is just a subtopic of geometry.
It has many applications: the technique of triangulation for instance is used in astronomy to measure the distance to nearby stars, in geography to measure distances between landmarks, and in satellite navigation systems.
Two triangles are said to be similar if one can be obtained by uniformly expanding the other. This is the case if and only if their corresponding angles are equal, and it occurs for example when two triangles share an angle and the sides opposite to that angle are parallel. The crucial fact about similar triangles is that the lengths of their sides are proportionate. That is, if the longest side of a triangle is twice that of the longest side of a similar triangle, say, then the shortest side will also be twice that of the shortest side of the other triangle, and the median side will be twice that of the other triangle. Also, the ratio of the longest side to the shortest in the first triangle will be the same as the ratio of the longest side to the shortest in the other triangle.
Using these facts, one defines trigonometric functions, starting with right triangles, triangles with one angle being a right one (90 degrees or π/2 radians). The longest side in such a triangle is the side opposite the right angle, it is called the hypotenuse.
Pick two right triangles which share a second angle A. These triangles are necessarily similar, and the ratio of the side opposite to A to the hypotenuse will therefore be the same for the two triangles. It will be a number between 0 and 1 which depends only on A; we call it the sine of A and write it as sin(A). Similarly, one can define the cosine of A as the ratio of the side adjacent to A to the hypotenuse.
Some mathematicians believe that trigonometry was originally invented to calculate sundials, a traditional exercise in the oldest books. It is also much used in surveying.
See also trigonometric identity, triangulation.