# Trigonometry

Trigonometry (from Ancient Greek τρίγωνον (trígōnon) 'triangle' and μέτρον (métron) 'measure') is a branch of mathematics concerned with relationships between angles and side lengths of triangles. In particular, the trigonometric functions relate the angles of a right triangle with ratios of its side lengths. The field emerged in the Hellenistic world during the 3rd century BC from applications of geometry to astronomical studies. The Greeks focused on the calculation of chords, while mathematicians in India created the earliest-known tables of values for trigonometric ratios (also called trigonometric functions) such as sine.
Throughout history, trigonometry has been applied in areas such as geodesy, surveying, celestial mechanics, and navigation.
Trigonometry is known for its many identities. These trigonometric identities are commonly used for rewriting trigonometrical expressions with the aim to simplify an expression, to find a more useful form of an expression, or to solve an equation.

## History

Sumerian astronomers studied angle measure, using a division of circles into 360 degrees. They, and later the Babylonians, studied the ratios of the sides of similar triangles and discovered some properties of these ratios but did not turn that into a systematic method for finding sides and angles of triangles. The ancient Nubians used a similar method.
In the 3rd century BC, Hellenistic mathematicians such as Euclid and Archimedes studied the properties of chords and inscribed angles in circles, and they proved theorems that are equivalent to modern trigonometric formulae, although they presented them geometrically rather than algebraically. In 140 BC, Hipparchus (from Nicaea, Asia Minor) gave the first tables of chords, analogous to modern tables of sine values, and used them to solve problems in trigonometry and spherical trigonometry. In the 2nd century AD, the Greco-Egyptian astronomer Ptolemy (from Alexandria, Egypt) constructed detailed trigonometric tables (Ptolemy's table of chords) in Book 1, chapter 11 of his Almagest. Ptolemy used chord length to define his trigonometric functions, a minor difference from the sine convention we use today. (The value we call sin(θ) can be found by looking up the chord length for twice the angle of interest (2θ) in Ptolemy's table, and then dividing that value by two.) Centuries passed before more detailed tables were produced, and Ptolemy's treatise remained in use for performing trigonometric calculations in astronomy throughout the next 1200 years in the medieval Byzantine, Islamic, and, later, Western European worlds.
The modern definition of the sine is first attested in the Surya Siddhanta, and its properties were further documented in the 5th century (AD) by Indian mathematician and astronomer Aryabhata. These Greek and Indian works were translated and expanded by medieval Islamic mathematicians. In 830 AD, Persian mathematician Habash al-Hasib al-Marwazi produced the first table of cotangents. By the 10th century AD, in the work of Persian mathematician Abū al-Wafā' al-Būzjānī, all six trigonometric functions were used. Abu al-Wafa had sine tables in 0.25° increments, to 8 decimal places of accuracy, and accurate tables of tangent values. He also made important innovations in spherical trigonometry The Persian polymath Nasir al-Din al-Tusi has been described as the creator of trigonometry as a mathematical discipline in its own right. He was the first to treat trigonometry as a mathematical discipline independent from astronomy, and he developed spherical trigonometry into its present form. He listed the six distinct cases of a right-angled triangle in spherical trigonometry, and in his On the Sector Figure, he stated the law of sines for plane and spherical triangles, discovered the law of tangents for spherical triangles, and provided proofs for both these laws. Knowledge of trigonometric functions and methods reached Western Europe via Latin translations of Ptolemy's Greek Almagest as well as the works of Persian and Arab astronomers such as Al Battani and Nasir al-Din al-Tusi. One of the earliest works on trigonometry by a northern European mathematician is De Triangulis by the 15th century German mathematician Regiomontanus, who was encouraged to write, and provided with a copy of the Almagest, by the Byzantine Greek scholar cardinal Basilios Bessarion with whom he lived for several years. At the same time, another translation of the Almagest from Greek into Latin was completed by the Cretan George of Trebizond. Trigonometry was still so little known in 16th-century northern Europe that Nicolaus Copernicus devoted two chapters of De revolutionibus orbium coelestium to explain its basic concepts.
Driven by the demands of navigation and the growing need for accurate maps of large geographic areas, trigonometry grew into a major branch of mathematics. Bartholomaeus Pitiscus was the first to use the word, publishing his Trigonometria in 1595. Gemma Frisius described for the first time the method of triangulation still used today in surveying. It was Leonhard Euler who fully incorporated complex numbers into trigonometry. The works of the Scottish mathematicians James Gregory in the 17th century and Colin Maclaurin in the 18th century were influential in the development of trigonometric series. Also in the 18th century, Brook Taylor defined the general Taylor series.

## Trigonometric ratios

Trigonometric ratios are the ratios between edges of a right triangle. These ratios depend only on one acute angle of the right triangle, since any two right triangles with the same acute angle are similar.
So, these ratios define functions of this angle that are called trigonometric functions. Explicitly, they are defined below as functions of the known angle A, where a, b and h refer to the lengths of the sides in the accompanying figure.
In the following definitions, the hypotenuse is the side opposite to the 90-degree angle in a right triangle; it is the longest side of the triangle and one of the two sides adjacent to angle A. The adjacent leg is the other side that is adjacent to angle A. The opposite side is the side that is opposite to angle A. The terms perpendicular and base are sometimes used for the opposite and adjacent sides respectively. See below under Mnemonics.
* Sine (denoted sin), defined as the ratio of the side opposite the angle to the hypotenuse.
       $\sin A={\frac {\textrm {opposite}}{\textrm {hypotenuse}}}={\frac {a}{h}}.$
* Cosine (denoted cos), defined as the ratio of the adjacent leg (the side of the triangle joining the angle to the right angle) to the hypotenuse.
       $\cos A={\frac {\textrm {adjacent}}{\textrm {hypotenuse}}}={\frac {b}{h}}.$
* Tangent (denoted tan), defined as the ratio of the opposite leg to the adjacent leg.
       $\tan A={\frac {\textrm {opposite}}{\textrm {adjacent}}}={\frac {a}{b}}={\frac {a/h}{b/h}}={\frac {\sin A}{\cos A}}.$
The reciprocals of these ratios are named the cosecant (csc), secant (sec), and cotangent (cot), respectively:
    $\csc A={\frac {1}{\sin A}}={\frac {\textrm {hypotenuse}}{\textrm {opposite}}}={\frac {h}{a}},$
    $\sec A={\frac {1}{\cos A}}={\frac {\textrm {hypotenuse}}{\textrm {adjacent}}}={\frac {h}{b}},$
    $\cot A={\frac {1}{\tan A}}={\frac {\textrm {adjacent}}{\textrm {opposite}}}={\frac {\cos A}{\sin A}}={\frac {b}{a}}.$
The cosine, cotangent, and cosecant are so named because they are respectively the sine, tangent, and secant of the complementary angle abbreviated to "co-".
With these functions, one can answer virtually all questions about arbitrary triangles by using the law of sines and the law of cosines. These laws can be used to compute the remaining angles and sides of any triangle as soon as two sides and their included angle or two angles and a side or three sides are known.

### Mnemonics

A common use of mnemonics is to remember facts and relationships in trigonometry. For example, the sine, cosine, and tangent ratios in a right triangle can be remembered by representing them and their corresponding sides as strings of letters. For instance, a mnemonic is SOH-CAH-TOA:
    Sine = Opposite ÷ Hypotenuse
    Cosine = Adjacent ÷ Hypotenuse
    Tangent = Opposite ÷ Adjacent
One way to remember the letters is to sound them out phonetically (i.e. /ˌsoʊkəˈtoʊə/ SOH-kə-TOH-ə, similar to Krakatoa). Another method is to expand the letters into a sentence, such as "Some Old Hippie Caught Another Hippie Trippin' On Acid".

### The unit circle and common trigonometric values

Trigonometric ratios can also be represented using the unit circle, which is the circle of radius 1 centered at the origin in the plane. In this setting, the terminal side of an angle A placed in standard position will intersect the unit circle in a point (x,y), where $x=\cos A$ and $y=\sin A$. This representation allows for the calculation of commonly found trigonometric values, such as those in the following table:
| Function | 0 | $\pi /6$ | $\pi /4$ | $\pi /3$ | $\pi /2$ | $2\pi /3$ | $3\pi /4$ | $5\pi /6$ | $\pi$ |
| sine | $0$ | $1/2$ | ${\sqrt {2}}/2$ | ${\sqrt {3}}/2$ | $1$ | ${\sqrt {3}}/2$ | ${\sqrt {2}}/2$ | $1/2$ | $0$ |
| cosine | $1$ | ${\sqrt {3}}/2$ | ${\sqrt {2}}/2$ | $1/2$ | $0$ | $-1/2$ | $-{\sqrt {2}}/2$ | $-{\sqrt {3}}/2$ | $-1$ |
| tangent | $0$ | ${\sqrt {3}}/3$ | $1$ | ${\sqrt {3}}$ | undefined | $-{\sqrt {3}}$ | $-1$ | $-{\sqrt {3}}/3$ | $0$ |
| secant | $1$ | $2{\sqrt {3}}/3$ | ${\sqrt {2}}$ | $2$ | undefined | $-2$ | $-{\sqrt {2}}$ | $-2{\sqrt {3}}/3$ | $-1$ |
| cosecant | undefined | $2$ | ${\sqrt {2}}$ | $2{\sqrt {3}}/3$ | $1$ | $2{\sqrt {3}}/3$ | ${\sqrt {2}}$ | $2$ | undefined |
| cotangent | undefined | ${\sqrt {3}}$ | $1$ | ${\sqrt {3}}/3$ | $0$ | $-{\sqrt {3}}/3$ | $-1$ | $-{\sqrt {3}}$ | undefined |

## Trigonometric functions of real or complex variables

Using the unit circle, one can extend the definitions of trigonometric ratios to all positive and negative arguments (see trigonometric function).

### Graphs of trigonometric functions

The following table summarizes the properties of the graphs of the six main trigonometric functions:
| Function | Period | Domain | Range |
| sine | $2\pi$ | $(-\infty ,\infty )$ | $[-1,1]$ |
| cosine | $2\pi$ | $(-\infty ,\infty )$ | $[-1,1]$ |
| tangent | $\pi$ | $x\neq \pi /2+n\pi$ | $(-\infty ,\infty )$ |
| secant | $2\pi$ | $x\neq \pi /2+n\pi$ | $(-\infty ,-1]\cup [1,\infty )$ |
| cosecant | $2\pi$ | $x\neq n\pi$ | $(-\infty ,-1]\cup [1,\infty )$ |
| cotangent | $\pi$ | $x\neq n\pi$ | $(-\infty ,\infty )$ |

### Inverse trigonometric functions

Because the six main trigonometric functions are periodic, they are not injective (or, 1 to 1), and thus are not invertible. By restricting the domain of a trigonometric function, however, they can be made invertible.$^{:48ff}$
The names of the inverse trigonometric functions, together with their domains and range, can be found in the following table:$^{:48ff}$$^{:521ff}$
| Name | Usual notation | Definition | Domain of x for real result | Range of usual principal value (radians) | Range of usual principal value (degrees) |
| arcsine | y = arcsin(x) | x = sin(y) | −1 ≤ x ≤ 1 | −⁠π/2⁠ ≤ y ≤ ⁠π/2⁠ | −90° ≤ y ≤ 90° |
| arccosine | y = arccos(x) | x = cos(y) | −1 ≤ x ≤ 1 | 0 ≤ y ≤ π | 0° ≤ y ≤ 180° |
| arctangent | y = arctan(x) | x = tan(y) | all real numbers | −⁠π/2⁠ < y < ⁠π/2⁠ | −90° < y < 90° |
| arccotangent | y = arccot(x) | x = cot(y) | all real numbers | 0 < y < π | 0° < y < 180° |
| arcsecant | y = arcsec(x) | x = sec(y) | x ≤ −1 or 1 ≤ x | 0 ≤ y < ⁠π/2⁠ or ⁠π/2⁠ < y ≤ π | 0° ≤ y < 90° or 90° < y ≤ 180° |
| arccosecant | y = arccsc(x) | x = csc(y) | x ≤ −1 or 1 ≤ x | −⁠π/2⁠ ≤ y < 0 or 0 < y ≤ ⁠π/2⁠ | −90° ≤ y < 0° or 0° < y ≤ 90° |

### Power series representations

When considered as functions of a real variable, the trigonometric ratios can be represented by an infinite series. For instance, sine and cosine have the following representations:
    ${\begin{aligned}\sin x&=x-{\frac {x^{3}}{3!}}+{\frac {x^{5}}{5!}}-{\frac {x^{7}}{7!}}+\cdots \\&=\sum _{n=0}^{\infty }{\frac {(-1)^{n}x^{2n+1}}{(2n+1)!}}\\\end{aligned}}$
    ${\begin{aligned}\cos x&=1-{\frac {x^{2}}{2!}}+{\frac {x^{4}}{4!}}-{\frac {x^{6}}{6!}}+\cdots \\&=\sum _{n=0}^{\infty }{\frac {(-1)^{n}x^{2n}}{(2n)!}}.\end{aligned}}$
With these definitions the trigonometric functions can be defined for complex numbers. When extended as functions of real or complex variables, the following formula holds for the complex exponential:
    $e^{x+iy}=e^{x}(\cos y+i\sin y).$
This complex exponential function, written in terms of trigonometric functions, is particularly useful.

### Calculating trigonometric functions

Trigonometric functions were among the earliest uses for mathematical tables. Such tables were incorporated into mathematics textbooks and students were taught to look up values and how to interpolate between the values listed to get higher accuracy. Slide rules had special scales for trigonometric functions.
Scientific calculators have buttons for calculating the main trigonometric functions (sin, cos, tan, and sometimes cis and their inverses). Most allow a choice of angle measurement methods: degrees, radians, and sometimes gradians. Most computer programming languages provide function libraries that include the trigonometric functions. The floating point unit hardware incorporated into the microprocessor chips used in most personal computers has built-in instructions for calculating trigonometric functions.

### Other trigonometric functions

In addition to the six ratios listed earlier, there are additional trigonometric functions that were historically important, though seldom used today. These include the chord (crd(θ) = 2 sin(⁠θ/2⁠)), the versine (versin(θ) = 1 − cos(θ) = 2 sin$^2$(⁠θ/2⁠)) (which appeared in the earliest tables), the coversine (coversin(θ) = 1 − sin(θ) = versin(⁠π/2⁠ − θ)), the haversine (haversin(θ) = ⁠1/2⁠versin(θ) = sin$^2$(⁠θ/2⁠)), the exsecant (exsec(θ) = sec(θ) − 1), and the excosecant (excsc(θ) = exsec(⁠π/2⁠ − θ) = csc(θ) − 1). See List of trigonometric identities for more relations between these functions.

## Applications
### Astronomy

For centuries, spherical trigonometry has been used for locating solar, lunar, and stellar positions, predicting eclipses, and describing the orbits of the planets.
In modern times, the technique of triangulation is used in astronomy to measure the distance to nearby stars, as well as in satellite navigation systems.

### Navigation

Historically, trigonometry has been used for locating latitudes and longitudes of sailing vessels, plotting courses, and calculating distances during navigation.
Trigonometry is still used in navigation through such means as the Global Positioning System and artificial intelligence for autonomous vehicles.

### Surveying

In land surveying, trigonometry is used in the calculation of lengths, areas, and relative angles between objects.
On a larger scale, trigonometry is used in geography to measure distances between landmarks.

### Periodic functions

The sine and cosine functions are fundamental to the theory of periodic functions, such as those that describe sound and light waves. Fourier discovered that every continuous, periodic function could be described as an infinite sum of trigonometric functions.
Even non-periodic functions can be represented as an integral of sines and cosines through the Fourier transform. This has applications to quantum mechanics and communications, among other fields.

### Optics and acoustics

Trigonometry is useful in many physical sciences, including acoustics, and optics. In these areas, they are used to describe sound and light waves, and to solve boundary- and transmission-related problems.

### Other applications

Other fields that use trigonometry or trigonometric functions include music theory, geodesy, audio synthesis, architecture, electronics, biology, medical imaging (CT scans and ultrasound), chemistry, number theory (and hence cryptology), seismology, meteorology, oceanography, image compression, phonetics, economics, electrical engineering, mechanical engineering, civil engineering, computer graphics, cartography, crystallography and game development.

## Identities

Trigonometry has been noted for its many identities, that is, equations that are true for all possible inputs.
Identities involving only angles are known as trigonometric identities. Other equations, known as triangle identities, relate both the sides and angles of a given triangle.

### Triangle identities

In the following identities, A, B and C are the angles of a triangle and a, b and c are the lengths of sides of the triangle opposite the respective angles (as shown in the diagram).

#### Law of sines

The law of sines (also known as the "sine rule") for an arbitrary triangle states:
    ${\frac {a}{\sin A}}={\frac {b}{\sin B}}={\frac {c}{\sin C}}=2R={\frac {abc}{2\Delta }},$
where $\Delta$ is the area of the triangle and R is the radius of the circumscribed circle of the triangle:
    $R={\frac {abc}{\sqrt {(a+b+c)(a-b+c)(a+b-c)(b+c-a)}}}.$

#### Law of cosines

The law of cosines (known as the cosine formula, or the "cos rule") is an extension of the Pythagorean theorem to arbitrary triangles:
    $c^{2}=a^{2}+b^{2}-2ab\cos C,$
or equivalently:
    $\cos C={\frac {a^{2}+b^{2}-c^{2}}{2ab}}.$

#### Law of tangents

The law of tangents, developed by François Viète, is an alternative to the Law of Cosines when solving for the unknown edges of a triangle, providing simpler computations when using trigonometric tables. It is given by:
    ${\frac {a-b}{a+b}}={\frac {\tan \left[{\tfrac {1}{2}}(A-B)\right]}{\tan \left[{\tfrac {1}{2}}(A+B)\right]}}$

#### Area

Given two sides a and b and the angle between the sides C, the area of the triangle is given by half the product of the lengths of two sides and the sine of the angle between the two sides:
    ${\mbox{Area}}=\Delta ={\frac {1}{2}}ab\sin C$

### Trigonometric identities
#### Pythagorean identities

The following trigonometric identities are related to the Pythagorean theorem and hold for any value:
    $\sin ^{2}A+\cos ^{2}A=1\$
    $\tan ^{2}A+1=\sec ^{2}A\$
    $\cot ^{2}A+1=\csc ^{2}A\$
The second and third equations are derived from dividing the first equation by $\cos ^{2}{A}$ and $\sin ^{2}{A}$, respectively.

#### Euler's formula

Euler's formula, which states that $e^{ix}=\cos x+i\sin x$, produces the following analytical identities for sine, cosine, and tangent in terms of e and the imaginary unit i:
    $\sin x={\frac {e^{ix}-e^{-ix}}{2i}},\qquad \cos x={\frac {e^{ix}+e^{-ix}}{2}},\qquad \tan x={\frac {i(e^{-ix}-e^{ix})}{e^{ix}+e^{-ix}}}.$

#### Other trigonometric identities

Other commonly used trigonometric identities include the half-angle identities, the angle sum and difference identities, and the product-to-sum identities.