Cosine Calculator
Solve cosine ratio or angle.
About the Cosine Calculator
Cosine gives the ratio of the adjacent side over the hypotenuse, and is sine shifted by a quarter turn.
How to use it
- Enter the angle in radians.
- Read the cosine value.
The formula
Cosine is the ratio of the side adjacent to an angle to the hypotenuse — CAH in the mnemonic.
cos(θ) = Adjacent ÷ Hypotenuse
θ = arccos(Adjacent ÷ Hypotenuse)
The more powerful use of cosine is the law of cosines, which works on any triangle and not just right ones:
c² = a² + b² − 2ab × cos(C)
This is Pythagoras with a correction term. When C is 90°, cos(C) is 0, the last term vanishes and it collapses to a² + b² = c². When C is acute the term subtracts and the opposite side is shorter; when C is obtuse cosine goes negative, the term adds, and the side is longer. It is the tool for finding a distance across a corner — two known lengths with a known angle between them.
Worked examples
| Angle | cos(θ) | Adjacent | Hypotenuse | Note |
|---|---|---|---|---|
| 0° | 1.0000 | 10 | 10 | no rotation — full projection |
| 36.87° | 0.8000 | 8 | 10 | the 6-8-10 triangle |
| 60° | 0.5000 | 5 | 10 | exactly half |
| 90° | 0.0000 | 0 | 10 | no adjacent side remains |
Cosine is sine running backwards: it starts at 1 and falls to 0 as sine climbs from 0 to 1. That relationship, cos(θ) = sin(90° − θ), is what 'complement' means in complementary angles. It also explains the behaviour engineers rely on — cosine measures how much of a force or a length survives being projected onto another direction, so a 10° misalignment costs only 1.5% while a 60° one costs half.
Common mistakes
- Choosing the wrong side as adjacent. The adjacent side touches your angle and is not the hypotenuse. In the same triangle, switching which angle you are solving for swaps which leg counts as adjacent.
- Using the law of cosines with the wrong angle. The angle C must be the one between sides a and b, opposite the side you are solving for. Using a different angle produces a confident and wrong answer.
- Forgetting cosine goes negative. Past 90°, cosine is negative. In the law of cosines that flips the last term from a subtraction to an addition, which is exactly how obtuse triangles get their long side.
- Working in the wrong angle mode. cos(60) is 0.5 in degrees and −0.952 in radians. Check the mode whenever an answer looks impossible.
Terms explained
- Adjacent side
- The leg touching the angle you are solving for, excluding the hypotenuse. The numerator for cosine.
- Law of cosines
- c² = a² + b² − 2ab·cos(C). Solves any triangle given two sides and the angle between them.
- Arccosine
- The inverse, written cos−¹ or acos. Converts a ratio back into an angle between 0° and 180°.
- Complementary angles
- Two angles summing to 90°. The sine of one equals the cosine of the other.
- Projection
- The shadow one vector casts on another, found by multiplying by the cosine of the angle between them. The basis of the dot product.
- Cosine similarity
- A measure of how alike two vectors are, used heavily in search and machine learning. It is literally the cosine of the angle between them.
Common questions
- What is the difference between sine and cosine?
- Sine uses the opposite side, cosine the adjacent one. They are the same curve shifted by 90°: cos(θ) = sin(90° − θ).
- When do I use the law of cosines?
- When you know two sides and the angle between them and want the third side, or when you know all three sides and want an angle. The sine rule handles the other combinations.
- Can cosine be negative?
- Yes, for angles between 90° and 270°. That is what makes the law of cosines produce a longer opposite side for obtuse triangles.
- Why is cos(0) equal to 1?
- At zero degrees the adjacent side and the hypotenuse are the same line, so the ratio is one over one. On the unit circle, the point sits at its furthest horizontal extent.
- How is the law of cosines related to Pythagoras?
- It is the general case. Set C to 90°, cos(C) becomes 0, the correction term disappears and you are left with a² + b² = c².
- What is cosine similarity?
- A way of comparing two lists of numbers by the angle between them rather than their magnitude. A cosine of 1 means identical direction, 0 means unrelated. It underpins a great deal of modern search and recommendation.
- How do I find the angle from three known sides?
- Rearrange the law of cosines: cos(C) = (a² + b² − c²) ÷ 2ab, then take the arccosine.
- Which values are worth memorising?
- cos(0°) = 1, cos(30°) = √3/2, cos(45°) = √2/2, cos(60°) = 0.5, cos(90°) = 0. Note they run in the opposite order to sine's.