Finding cosine from adjacent and opposite legs
To find the cosine of an angle in a right triangle without knowing the hypotenuse, divide the adjacent side by the square root of the sum of both squared legs.
Formula
c is the cosine value, b is the adjacent leg, and a is the opposite leg
The Method Explained Simply
In trigonometry, cosine represents the ratio of the adjacent side to the hypotenuse (CAH in the SOH CAH TOA memory aid). If your problem only provides the two legs, you first use the Pythagorean theorem to determine the length of the hypotenuse, which equals √(a² + b².
Once you have the hypotenuse, divide the adjacent side length (b) by that calculated value. For example, if the opposite side is 3 and the adjacent side is 4, the hypotenuse is √(3² + 4² = √(25) = 5. The cosine is then 4/5 or 0.8.
When and Where This Is Used
This technique is a staple of high school geometry and pre-calculus exams when working with right triangles and the unit circle. It frequently appears in coordinate geometry problems where an angle is formed by a point (x, y) on a Cartesian grid.
In physics and engineering, you use this calculation to break force or velocity vectors into horizontal and vertical components, as well as in carpentry and surveying to verify angles from height and base measurements.
Common Mistakes to Avoid
The most frequent error is mixing up the adjacent and opposite legs relative to the angle you are evaluating. The adjacent leg touches the angle of interest (alongside the hypotenuse), while the opposite leg sits across from it.
Another common slip is forgetting to take the square root of a² + b² when determining the denominator. Writing b / (a² + b² instead of b / √(a² + b² will give you an incorrect fraction.
Quick Mental Checks and Triples
Because the hypotenuse is always the longest side of a right triangle, the cosine of any acute angle must strictly fall between 0 and 1. If your result is greater than 1 or negative, recheck your side labels.
Watch for common Pythagorean triples like 3-4-5 and 5-12-13. Recognizing these side lengths immediately gives you the hypotenuse without needing to write out long square root calculations.
Worked examples
Example 1Relative to the chosen angle, a is the opposite leg and b is the adjacent leg. a=3,\;b=4. Find c.
Write the relationship for the requested quantity.
c=\frac{b}{\sqrt{a^{2} + b^{2}}}Substitute each value, keeping its sign.
\frac{4}{\sqrt{\left(\left(3\right)^{2}+\left(4\right)^{2}\right)}}Simplify the expression to obtain the exact result.
\frac{4}{5}
Example 2Relative to the chosen angle, a is the opposite leg and b is the adjacent leg. a=5,\;b=12. Find c.
Write the relationship for the requested quantity.
c=\frac{b}{\sqrt{a^{2} + b^{2}}}Substitute each value, keeping its sign.
\frac{12}{\sqrt{\left(\left(5\right)^{2}+\left(12\right)^{2}\right)}}Simplify the expression to obtain the exact result.
\frac{12}{13}
Example 3Relative to the chosen angle, a is the opposite leg and b is the adjacent leg. a=8,\;b=15. Find c.
Write the relationship for the requested quantity.
c=\frac{b}{\sqrt{a^{2} + b^{2}}}Substitute each value, keeping its sign.
\frac{15}{\sqrt{\left(\left(8\right)^{2}+\left(15\right)^{2}\right)}}Simplify the expression to obtain the exact result.
\frac{15}{17}
Questions and answers
What is cosine in a right-angled triangle?
Cosine is the ratio of the length of the adjacent side to the length of the hypotenuse for a given acute angle.
How do you find cosine if you do not know the hypotenuse?
Use the Pythagorean theorem to calculate the hypotenuse as √(opposite² + adjacent², then divide the adjacent leg by that value.
Can the cosine of an angle in a right triangle be greater than 1?
No, because the adjacent leg is always shorter than the hypotenuse, making the fraction adjacent/hypotenuse always less than 1.
What is the difference between sine and cosine?
Sine uses the opposite side over the hypotenuse, whereas cosine uses the adjacent side over the hypotenuse.
Solve your own problem
Different numbers or a harder variant? Type it in and get the steps.