# Cosine

Cosine, often denoted as "cos," is one of the three main trigonometric functions, with the other two being sine (sin) and tangent (tan). The trigonometric functions are commonly defined based on the ratio of the sides of a right triangle. They can also be defined geometrically using the standard unit circle, which is a circle with radius of 1 unit. In terms of a right triangle, the cosine of an angle θ, denoted cos(θ), is the ratio of the length of the adjacent edge of a right triangle to that of its hypotenuse. Referencing the triangle above, the side adjacent to θ is side b, and the hypotenuse is side c. Thus: Example:

Jenny is standing at the top of a hill (at the top of a in the triangle). She has built a pulley system attached to a wagon that is on the ground a horizontal distance b away from her. Given that the angle of the incline is 40°, and the horizontal distance b is 15 meters, what distance, c, does the wagon need to travel before Jenny can ride it down the hill?

Given that,

 θ = 40° b = 15 c = ? Using a calculator, cos(40°)=0.766. So, As a reward for all her hard work, Jenny's joyride will last 19.58m.

Note that for a given angle, the ratio of the length of the sides always stays the same, regardless of the size of the triangle. Trigonometric functions like cosine are useful because they allow us to determine the length of the sides of a triangle given that the angles are known. Similarly, they also allow us to determine angle values if the sides are known.

When additionally using the relationships of sine and tangent, knowing just a few angles or side measurements of a right triangle enables us to determine all of the side lengths and angles of a right triangle. Briefly:  ## Unit-circle definition

Like the other trigonometric functions, cosine can also be defined using a unit circle (a circle with radius of 1 unit). In a plane with a unit circle centered at the origin of a coordinate system, a ray from the origin forms an angle, θ, with the x-axis. The x-coordinate of the point at which the ray intersects the unit circle is the cosine value of the angle. ## Cosine function properties

The cosine function is a periodic function that has various properties. These properties enable the manipulation of the cosine function using reflections, shifts, and the periodicity of cosine. This is often done to convert a given value into one based on an angle between 0° and 90° to make the numbers easier to work with. Below are some common identities.

 cos⁡(-θ) = cos⁡(θ) cos⁡(180° + θ) = -cos⁡(θ) cos⁡(180° - θ) = -cos⁡(θ) cos⁡(θ + n × 360°) = cos⁡(θ) cos⁡(90° - θ) = sin⁡(θ) sin⁡(90° - θ) = cos⁡(θ) cos⁡(90° + θ) = -sin⁡(θ) sin⁡(90° + θ) = cos⁡(θ)

Example:

Given cos⁡(60°) = 0.5, what is cos⁡(120°)?

 cos⁡(120°) = cos⁡(180°-60°) = -cos⁡(60°) = -0.5

Example:

Given cos⁡(45°) = 0.707, what is the value of cos⁡(405°)?

 cos⁡(405°) = cos⁡(45° + 1×360°) = cos⁡(45°) = 0.707

## Values of the cosine function

Like the sine function, the value of the cosine function oscillates between -1 and 1. Cosine is positive between 0° and 90° and 270° and 360°. This occurs in quadrants I and IV. Cosine is negative between 90° and 270°. This occurs in quadrants II and III.

Below is a table of cosine values for commonly used angles:

Angle in degreesAngle in radiansCosine valueCosine value in decimals
011
15°  0.966
30°  0.866
45°  0.707
60°  0.5
75°  0.259
90° 00
180°π-1-1
270° 00
360°2π11

### Cosine calculator:

The following is a calculator to find out either the cosine value of an angle or the angle from the cosine value.

## Law of cosines

The law of cosines is a trigonometric law that relates all the sides of a triangle to the cosine of one of its angles. It is useful for determining the third side of a triangle given that two sides and the angle that they enclose (a, b, and C below for example) are known. Using the triangle below, The law of cosines can be written in the following ways:

 c2 = a2 + b2 - 2ab·cos⁡(C) b2 = a2 + c2 - 2ac·cos⁡(B) a2 = b2 + c2 - 2bc·cos⁡(A)

In the above equations, a, b, and c, are the lengths of the sides of the triangle as shown in the figure above, and A, B, and C, are the angles opposite of the sides denoted by their lower-case counterparts.

The law of cosines is a generalization of the Pythagorean theorem and works for triangles comprised of any angle, rather than just for right triangles. In the case where an angle measure of the triangle is 90°, the law of cosines would reduce to the Pythagorean theorem:

c2 = a2 + b2 - 2ab·cos⁡(C)

Since cos⁡(90°) = 0,

 c2 = a2 + b2 - 2ab×0 c2 = a2 + b2

Which is the Pythagorean theorem.

Example:

In the triangle above, given that C = 45°, a = 12, and b = 8, find the values of all sides and angles of the triangle.

 c2 = a2 + b2 - 2ab·cos⁡(C) c2 = 122 + 82 - 2×12×8×cos⁡(45°) c2 = 208 - 192×0.707 c = √72.235 = 8.499

Now we know all the sides of the triangle and can calculate the other two angles as follows:

 b2 = a2 + c2 - 2ac·cos⁡(B) 82 = 122 + 8.4992 - 2×12×8.499×cos⁡(B) -152.233 = -203.976·cos⁡(B) cos⁡(B) = 0.746 B = cos-1(0.746) = 41.727°

Computing angle A uses the same method as shown above, except using the law of cosines such that A is the enclosed angle. Doing so, you will find that

A = 93.273°

## Inverse function of cosine

The inverse function of cosine was used in the example above. Unlike the cosine function, which is used to determine a ratio from a given angle, the inverse cosine function, typically denoted as arccos or cos-1, is used to compute an angle given a ratio:  Example:

Using the right triangle above, given side b = 5 and hypotenuse c = 9, what is the angle θ?

We can determine the angle θ as follows: 