Cosine Law Triangle Solver
Use this tool to solve triangles with the Law of Cosines. Choose whether you want to find a side or an angle.
What is the cosine law?
The cosine law (also called the law of cosines) is a core triangle formula used to find an unknown side or angle when basic right-triangle shortcuts do not apply. It works for any triangle—acute, right, or obtuse—and is especially useful when you know two sides and the included angle (SAS), or all three sides (SSS).
The standard form is:
c² = a² + b² − 2ab cos(C)
Here, side c is opposite angle C, side a is opposite angle A, and side b is opposite angle B.
How this cosine law calculator works
Mode 1: Find side c
If you know sides a and b and the included angle C, the calculator uses:
c = √(a² + b² − 2ab cos(C))
This is common in engineering drawings, construction layout, navigation, and vector geometry.
Mode 2: Find angle C
If you know all three sides a, b, and c, the calculator rearranges the formula:
cos(C) = (a² + b² − c²) / (2ab)
Then it applies arccos to return C in degrees.
Step-by-step usage guide
- Select the type of result you want (side or angle).
- Enter known values in the visible fields.
- Click Calculate.
- Read the final value and formula breakdown in the result panel.
- Use Clear to reset everything.
Practical applications
The law of cosines appears in many real-world scenarios:
- Surveying: calculating distances between points when direct measurement is hard.
- Physics: resolving vector magnitudes and included angles.
- Architecture: roof trusses, supports, and non-right-angle framing.
- Robotics: link lengths and joint angles in arm geometry.
- Navigation: triangulation and path planning.
Common mistakes to avoid
- Mixing up which side is opposite which angle.
- Entering angle values in radians when the calculator expects degrees.
- Using invalid side lengths that cannot form a triangle.
- Rounding too early during manual calculations.
Cosine law vs. sine law
Use the sine law when you have an angle-side opposite pair (A with a, B with b, etc.). Use the cosine law when you have SAS or SSS data. In many complete triangle problems, both laws are used together at different steps.
Quick example
Find side c
Given: a = 7, b = 10, C = 40°
c² = 7² + 10² − 2(7)(10)cos(40°)
c² = 49 + 100 − 140(0.7660) ≈ 41.76
c ≈ 6.46
Final thoughts
A good cosine law calculator saves time and reduces algebra mistakes, but it is still worth understanding the formula. Once you know how the terms relate, triangle geometry becomes much easier to interpret and apply in practical settings.