Fiveable

๐Ÿ“ˆCollege Algebra Unit 10 Review

QR code for College Algebra practice questions

10.2 Non-right Triangles: Law of Cosines

10.2 Non-right Triangles: Law of Cosines

Written by the Fiveable Content Team โ€ข Last updated August 2025
Written by the Fiveable Content Team โ€ข Last updated August 2025
๐Ÿ“ˆCollege Algebra
Unit & Topic Study Guides

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:

c2=a2+b2โˆ’2abcosโก(C)c^2 = a^2 + b^2 - 2ab\cos(C)

Here, aa, bb, and cc are the side lengths, and CC is the angle opposite side cc. This works for any triangle: scalene, isosceles, equilateral, acute, or obtuse.

Notice that if C=90ยฐC = 90ยฐ, then cosโก(90ยฐ)=0\cos(90ยฐ) = 0, and the formula simplifies to c2=a2+b2c^2 = a^2 + b^2. 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:

  • a2=b2+c2โˆ’2bccosโก(A)a^2 = b^2 + c^2 - 2bc\cos(A)
  • b2=a2+c2โˆ’2accosโก(B)b^2 = a^2 + c^2 - 2ac\cos(B)
  • c2=a2+b2โˆ’2abcosโก(C)c^2 = a^2 + b^2 - 2ab\cos(C)

Finding a missing side: Plug the two known sides and the included angle directly into the formula, then solve.

Example: Given a=8a = 8, b=11b = 11, and C=37ยฐC = 37ยฐ: c2=82+112โˆ’2(8)(11)cosโก(37ยฐ)c^2 = 8^2 + 11^2 - 2(8)(11)\cos(37ยฐ)

c2=64+121โˆ’176(0.7986)โ‰ˆ44.45c^2 = 64 + 121 - 176(0.7986) \approx 44.45

cโ‰ˆ6.67c \approx 6.67

Finding a missing angle: Rearrange the formula to isolate the cosine term, then use the inverse cosine function:

cosโก(C)=a2+b2โˆ’c22ab\cos(C) = \frac{a^2 + b^2 - c^2}{2ab}

Then C=cosโกโˆ’1(a2+b2โˆ’c22ab)C = \cos^{-1}\left(\frac{a^2 + b^2 - c^2}{2ab}\right)

Example: Given a=5a = 5, b=7b = 7, c=10c = 10: cosโก(C)=25+49โˆ’1002(5)(7)=โˆ’2670โ‰ˆโˆ’0.3714\cos(C) = \frac{25 + 49 - 100}{2(5)(7)} = \frac{-26}{70} \approx -0.3714

C=cosโกโˆ’1(โˆ’0.3714)โ‰ˆ111.8ยฐC = \cos^{-1}(-0.3714) \approx 111.8ยฐ 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.
Law of Cosines for non-right triangles, Non-right Triangles: Law of Cosines | Algebra and Trigonometry

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:

  1. Identify the triangle in the problem. Label the known sides and angles.
  2. Sketch a diagram with all known values marked.
  3. Determine whether you're solving for a missing side (SAS) or a missing angle (SSS).
  4. Apply the appropriate form of the Law of Cosines.
  5. 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.

Law of Cosines for non-right triangles, Non-right Triangles: Law of Cosines | Algebra and Trigonometry

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.

A=s(sโˆ’a)(sโˆ’b)(sโˆ’c)A = \sqrt{s(s-a)(s-b)(s-c)}

where ss is the semi-perimeter:

s=a+b+c2s = \frac{a + b + c}{2}

Steps to apply Heron's Formula:

  1. Find the semi-perimeter: Add all three sides and divide by 2.

  2. Compute each factor: Calculate sโˆ’as - a, sโˆ’bs - b, and sโˆ’cs - c.

  3. Multiply: Find the product s(sโˆ’a)(sโˆ’b)(sโˆ’c)s(s-a)(s-b)(s-c).

  4. Take the square root of that product to get the area.

Example: A triangle has sides a=6a = 6, b=8b = 8, c=10c = 10. s=6+8+102=12s = \frac{6 + 8 + 10}{2} = 12 A=12(12โˆ’6)(12โˆ’8)(12โˆ’10)=12โ‹…6โ‹…4โ‹…2=576=24A = \sqrt{12(12-6)(12-8)(12-10)} = \sqrt{12 \cdot 6 \cdot 4 \cdot 2} = \sqrt{576} = 24

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 A=12absinโก(C)A = \frac{1}{2}ab\sin(C) is often faster, but Heron's Formula is your go-to when you only have side lengths.

  • 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: asinโกA=bsinโกB=csinโกC\frac{a}{\sin A} = \frac{b}{\sin B} = \frac{c}{\sin C}. 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.