Law of Cosines Calculator — Solve Any Triangle
Side c
--
Angle A
--
Angle B
--
Area
--
How the Law of Cosines Works
The Law of Cosines states that c squared = a squared + b squared - 2ab cos(C), where C is the angle between sides a and b. It generalizes the Pythagorean theorem: when C = 90 degrees, cos(90) = 0 and the formula reduces to c squared = a squared + b squared.
This law is useful when you know two sides and the included angle (SAS) or all three sides (SSS) of a triangle. After finding the third side, you can use the law again to find the remaining angles, or use the fact that angles sum to 180 degrees.
The Law of Cosines is used in surveying, navigation, astronomy, and structural engineering. It allows distance calculations when direct measurement is impossible, such as finding the distance across a lake or between celestial bodies.
Frequently Asked Questions
When should I use the Law of Cosines vs. Law of Sines?
Use the Law of Cosines when you know SAS (two sides and included angle) or SSS (all three sides). Use the Law of Sines when you know ASA, AAS, or SSA configurations.
Can the Law of Cosines give negative results?
The value under the square root is always positive for valid triangles (where the triangle inequality holds). However, the cosine term can be negative for obtuse angles, which increases the result.
Is the Law of Cosines related to the Pythagorean theorem?
Yes. The Pythagorean theorem is a special case of the Law of Cosines where angle C = 90 degrees. Since cos(90) = 0, the -2ab cos(C) term vanishes.