Law of Cosines and Heron's Formula
The Law of Cosines lets you solve triangles that aren't right triangles. The Pythagorean theorem only works when you have a 90ยฐ angle, but the Law of Cosines works for any triangle. Heron's Formula complements it by letting you find a triangle's area when you only know the three side lengths. Both come up frequently in surveying, engineering, and physics problems.
Law of Cosines for Non-Right Triangles
The Law of Cosines relates all three sides of a triangle to one of its angles:
Here, , , and are the side lengths, and is the angle opposite side . This works for any triangle: scalene, isosceles, equilateral, acute, or obtuse.
Notice that if , then , and the formula simplifies to . So the Pythagorean theorem is actually a special case of the Law of Cosines.
You can write the formula centered on any side/angle pair:
Finding a missing side: Plug the two known sides and the included angle directly into the formula, then solve.
Example: Given , , and :
Finding a missing angle: Rearrange the formula to isolate the cosine term, then use the inverse cosine function:
Then
Example: Given , , :
The negative cosine tells you the angle is obtuse (greater than 90ยฐ).
When to use the Law of Cosines (vs. the Law of Sines):
- SAS (two sides and the included angle): Use Law of Cosines to find the third side.
- SSS (all three sides known): Use Law of Cosines to find any angle.
- If you have ASA or AAS setups, the Law of Sines is usually easier.

Real-World Applications of the Law of Cosines
- Surveying and navigation: Calculating the distance between two landmarks when you know two other distances and the angle between them (triangulation).
- Construction and engineering: Determining the length of a support beam or the angle at which two structural members meet.
- Astronomy: Measuring distances between celestial objects using triangular relationships.
- Physics: Resolving forces or velocities that form non-right triangles (often combined with vector algebra).
Steps to solve a real-world problem:
- Identify the triangle in the problem. Label the known sides and angles.
- Sketch a diagram with all known values marked.
- Determine whether you're solving for a missing side (SAS) or a missing angle (SSS).
- Apply the appropriate form of the Law of Cosines.
- Interpret your answer in context (units, rounding, whether the result makes physical sense).
The Law of Cosines is often used together with the Law of Sines. A common strategy: use the Law of Cosines to find one unknown, then switch to the Law of Sines (which is simpler) to find remaining unknowns.

Triangle Area Using Heron's Formula
Heron's Formula calculates a triangle's area using only the three side lengths. You don't need to know any angles or heights.
where is the semi-perimeter:
Steps to apply Heron's Formula:
-
Find the semi-perimeter: Add all three sides and divide by 2.
-
Compute each factor: Calculate , , and .
-
Multiply: Find the product .
-
Take the square root of that product to get the area.
Example: A triangle has sides , , .
This is particularly useful for irregular triangles in real-world situations where measuring a height directly would be difficult or impractical. If you do know an angle, the formula is often faster, but Heron's Formula is your go-to when you only have side lengths.
Related Concepts
- Law of Sines: The other major formula for solving oblique (non-right) triangles. It relates ratios of sides to the sines of their opposite angles: . Best for ASA and AAS cases.
- Oblique triangles: Any triangle without a right angle. Solved using the Law of Cosines, Law of Sines, or both.
- Vector algebra: In physics and engineering, the Law of Cosines appears when finding the magnitude of a resultant vector from two component vectors at a known angle.