Cosine Function

temp

Summary

The cosine function returns the cosine of the angle provided in radians.

Syntax

How to use

The cosine function returns the cosine of the angle provided in radians. For example, given the angle , which is equivalent to degrees, the function returns .

Explanation

In math, the cosine of an angle is the ratio of the adjacent over the hypotenuse of the corresponding right triangle.

Right triangle definition of cosine.
Right triangle definition of cosine.

We extend this definition by defining cosine as the horizontal component of the point formed by the angle on the unit circle.

Unit circle definition of cosine.
Unit circle definition of cosine.

The unit circle defines the function’s output for negative angles and gives its periodic behavior. For example, given the angle which is equivalent to , the function returns .

The cosine of -2π/3 radians is -1/2.
The cosine of radians is .

To visualize the output of the function, we can visualize input from to on the unit circle.

Taylor Series

We also define cosine as an infinite series using a Taylor Series approximation from calculus.

The Taylor series of cosine is useful for many reasons:

  • For angles close to zero, a handful of terms of the series can provide an accurate enough approximation to calculate meaningful results.
  • It provides a way to numerically calculate the cosine of any angle.
  • It can be used to verify the derivative of cosine.

To see how to calculate the Taylor series of cosine see this page.

Related Functions

Arc Cosine

The arc cosine returns the angle corresponding to the input. The arc cosine function is the inverse of the cosine function.

Sine

The sine function returns the sine of a number provided in radians. In geometric terms, the function returns the vertical component of the point formed by the angle on the unit circle.

Tangent

The tangent function returns the tangent ratio of the input angle. In geometric terms, the function returns the length of the line tangent to the point on the unit circle.