Safekipedia
AngleTrigonometric functions

Sine and cosine

Adapted from Wikipedia · Discoverer experience

An ancient scientific instrument showing arcs of sine and versed sine, used for calculations in astronomy and mathematics.

In mathematics, sine and cosine are important trigonometric functions that help us understand angles and their relationships. They come from studying triangles, especially right triangles. For a smaller angle in a right triangle, the sine tells us the ratio of the side opposite the angle to the longest side, called the hypotenuse. The cosine tells us the ratio of the side next to the angle to the hypotenuse.

These ideas can be expanded beyond triangles to work with any angle, using something called a unit circle. Sine and cosine also have other advanced definitions involving infinite series and equations, which let them apply to many more situations, even including special numbers called complex numbers.

Sine and cosine are very useful in describing things that repeat over time, like sound waves, light waves, and the changing seasons. They were first developed in ancient Indian astronomy during a time known as the Gupta period, and have been important ever since.

Elementary descriptions

To understand sine and cosine, think about a right-angled triangle. This is a triangle with one angle that measures exactly 90 degrees. If we pick one of the other angles in this triangle, we can find two special numbers called sine and cosine for that angle.

Imagine you have a triangle with three sides. The side opposite the 90-degree angle is the longest one and is called the hypotenuse. The side opposite the angle we are focusing on is called the opposite side. The side next to our angle (but not the hypotenuse) is called the adjacent side.

For any angle in a right-angled triangle, sine tells us how long the opposite side is compared to the hypotenuse. Cosine tells us how long the adjacent side is compared to the hypotenuse. These comparisons stay the same no matter how big or small the triangle is, as long as the angles stay the same.

There are special angles where the values of sine and cosine are easy to remember, like 0°, 30°, 45°, 60°, and 90°. For example, at 45°, both sine and cosine have the same value.

Analytic descriptions

The sine and cosine functions are important in mathematics. They can be described using a circle with a radius of one, called the unit circle. Imagine a point on this circle. As you move this point around the circle, the horizontal position gives you the cosine value, and the vertical position gives you the sine value.

These functions repeat their values in a pattern, which makes them useful for describing waves and oscillations. They are related to each other in simple ways, like how shifting one function can give you the other. This relationship helps in solving many problems in science and engineering.

QuadrantAngleSineCosine
DegreesRadiansSignMonotonyConvexitySignMonotonyConvexity
1st quadrant, I0 ∘ 0 + {\displaystyle +} IncreasingConcave+ {\displaystyle +} DecreasingConcave
2nd quadrant, II90 ∘ π 2 + {\displaystyle +} DecreasingConcave− {\displaystyle -} DecreasingConvex
3rd quadrant, III180 ∘ π − {\displaystyle -} DecreasingConvex− {\displaystyle -} IncreasingConvex
4th quadrant, IV270 ∘ 3 π 2 − {\displaystyle -} IncreasingConvex+ {\displaystyle +} IncreasingConcave

Complex numbers relationship

Sine and cosine can be expanded using complex numbers, which include both real and imaginary numbers. For a real number θ, sine and cosine can be described using an exponential function in the complex plane. This means that sine and cosine can be linked to the exponential function e raised to the power of iθ.

When plotted on the complex plane, the function eix traces out a unit circle. Sine and cosine simplify to the imaginary and real parts of eiθ, respectively. This relationship helps connect trigonometry with complex numbers and exponential functions.

Sine function in the complex plane
Real componentImaginary componentMagnitude
Arcsine function in the complex plane
Real componentImaginary componentMagnitude

Background

Etymology

Main article: History of trigonometry § Etymology

The word sine comes from an old Sanskrit word for "bow-string". This idea came from comparing a circle's arc to a bow and its string. Later, this word traveled through Arabic and finally became sine in English.

Quadrant from 1840s Ottoman Turkey with axes for looking up the sine and versine of angles

The word cosine is short for "complementi sine", meaning "sine of the complementary angle". This name was created in the 1600s.

History

Main article: History of trigonometry

People have used trigonometry for thousands of years. The functions we use today, like sine and cosine, were developed during the Middle Ages. Early mathematicians in India used similar ideas, and these ideas spread to the Arab world and then to Europe.

By the 9th century, mathematicians in Islamic mathematics knew all six main trigonometric functions. Tables of these functions were created to help solve problems with triangles. In the 1600s, mathematicians began using the short forms sin and cos that we still use today. Later, important works helped define these functions clearly and connect them to other areas of mathematics.

Software implementations

See also: Lookup table § Computing sines

There is no single standard way to calculate sine and cosine in computers. The IEEE 754 standard, which is widely used for handling numbers in computers, does not include rules for calculating these trigonometric functions. This is because creating an efficient method that works well for all types of numbers, especially very large ones, remains challenging.

Programmers often use different methods to balance speed, accuracy, and the range of angles they can handle. One common trick, especially in graphics programming, is to pre-calculate a list of sine values and then estimate values in between using a method called linear interpolation. This avoids calculating sine every time it is needed. Another method, called the CORDIC algorithm, is often used in scientific calculators.

Most programming languages include built-in functions for sine and cosine, usually named sin and cos. For example, the C standard library has these functions in its math.h header, and Python has them in its math module. Some computers even have special instructions to calculate these functions quickly.

Some software libraries allow angles to be entered as "turns" instead of radians. A full turn is 360 degrees, and using turns can make some calculations more accurate and efficient. Functions that use turns might be named sinpi or cospi. For example, in MATLAB and several other languages, sinpi(x) calculates the sine of an angle that is πx radians, where x is given in half-turns. This approach helps avoid small errors that can happen when representing angles like π or π/2 with ordinary computer numbers.

Images

Animation showing how sine and cosine values change as an angle moves around a unit circle, helping to understand trigonometric functions.
A graph comparing the sine function in blue and the sine-squared function in red, useful for learning trigonometry.
Animated diagram showing how mathematical approximations get closer to the curve of the sine function.
A colorful mathematical diagram showing the sine function in the complex plane.

This article is a child-friendly adaptation of the Wikipedia article on Sine and cosine, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.