The cosine function returns the cosine of the angle provided in radians.
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 .
In math, the cosine of an angle is the ratio of the adjacent over the hypotenuse of the corresponding right triangle.
We extend this definition by defining cosine as the horizontal component of the point formed by the angle on the unit circle.
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 .
To visualize the output of the function, we can visualize input from to on the unit circle.
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.
The arc cosine returns the angle corresponding to the input. The arc cosine function is the inverse of the cosine function.
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.
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.