Skip to content
    Trigonometry

    Law of Cosines: Find a Side From SAS (Explained)

    You hike 8 km on one trail, turn, then hike 10 km on another trail at a 50° angle from the first. How far is the straight-line walk back to camp? The Law of Cosines answers that for any triangle, right-angled or not.

    Math Solver Academic Editorial Board4 min read

    Key takeaways

    • c² = a² + b² - 2ab·cos(C) finds the side opposite the known angle C.
    • C must be the angle squeezed between the two known sides a and b.
    • It works for every triangle, not just right triangles.
    • When C = 90°, cos(C) = 0 and the formula collapses to the Pythagorean theorem.
    In this guide
    1. 01What is the Law of Cosines used for here?
    2. 02Why does the Law of Cosines matter?
    3. 03The formula
    4. 04How to find the missing side step by step
    5. 05Common mistakes to avoid
    6. 06Tips and tricks
    7. 07Where you'll use it in real life
    8. 08Quick summary
    9. 09Worked example
    10. 10Frequently asked questions

    What is the Law of Cosines used for here?

    This calculator solves the SAS case: you know two Sides and the Angle between them, and you want the third side. It works for every triangle, not just right triangles, which is why it's more powerful than the Pythagorean theorem alone.

    Why does the Law of Cosines matter?

    Most real triangles aren't right triangles. Anytime you know two straight-line distances and the turn or angle between them, you need a formula that works for any angle, not just 90°. That's exactly what the Law of Cosines gives you.

    The Pythagorean theorem only ever handles right triangles. The Law of Cosines handles all of them, and quietly turns back into the Pythagorean theorem the moment the angle happens to be 90°.

    The formula

    c² = a² + b² - 2ab·cos(C)
    SymbolWhat it meansExample
    a, bThe two sides you already know8 m, 10 m
    CThe angle between sides a and b, in degrees (0° to 180°)50°
    cThe missing third side, opposite angle C7.82 m

    How to find the missing side step by step

    1. 1Square side a and square side b, then add them. a² + b².
    2. 2Multiply 2 × a × b, then multiply by cos(C).
    3. 3Subtract that from a² + b² to get c².
    4. 4Take the square root of c² to get the length of side c.

    Enter your own two sides and included angle below to see side c calculated step by step.

    Try it yourself

    Pre-filled with the example — change any value.

    🧮
    Trigonometry
    High School

    Law of Cosines

    Find the third side of any triangle

    c² = a² + b² - 2ab cos(C)

    xy(0.7, 0.7)
    cos: 0.71
    sin: 0.71
    tan: 1.0
    m
    120
    m
    121
    degrees
    1180

    💡 Example

    Reference
    Inputs:a=5, b=7, C=60
    Result:6.24 m
    Open the full Law of Cosines calculator

    Common mistakes to avoid

    • Forgetting to switch your calculator to degrees (or radians, depending on your tool) before finding cos(C).
    • Expecting a right angle. Unlike the Pythagorean theorem, C doesn't need to be 90° — the -2ab·cos(C) term is exactly what adjusts for that.
    • Skipping the square root. The formula gives c², not c — don't forget the last step.

    Tips and tricks

    Where you'll use it in real life

    • Hiking and orienteering: finding a direct return distance after two legs at an angle.
    • Navigation: calculating the straight-line distance between two positions reached along different bearings.
    • Construction: bracing and framing where two known lengths meet at a non-right angle.
    • Sports fields: working out diagonal distances on triangular sections of a field or course.

    Quick summary

    The Law of Cosines finds a missing triangle side from two known sides and the angle between them, and it works for any triangle. Square and add the known sides, subtract the cosine term, then take the square root. Try the calculator above with your own triangle.

    Worked example

    You hike 8 km along one trail from camp, then turn and hike 10 km along a second trail, with a 50° angle between the two trails. How far is the straight-line distance back to camp?

    1. 01c² = a² + b² - 2ab cos(C)
    2. 02c² = 8² + 10² - 2(8)(10)cos(50°)
    3. 03c² = 64 + 100 - 160(0.643)
    4. 04c² = 164 - 102.85
    5. 05c² = 61.15
    6. 06c = 7.82

    These numbers are pre-filled in the calculator above.

    Frequently asked questions

    When should I use the Law of Cosines instead of the Pythagorean theorem?

    Use the Law of Cosines whenever the triangle doesn't have a right angle. The Pythagorean theorem only works for right triangles; the Law of Cosines works for any triangle.

    What does SAS mean here?

    SAS stands for Side-Angle-Side: you know two sides of the triangle and the angle that sits directly between them, and you're solving for the third side.

    Does the angle have to be the included angle?

    Yes. The formula only works when C is the angle between the two known sides a and b, not one of the other angles.

    What if C is 90°?

    cos(90°) = 0, so the formula simplifies to c² = a² + b² — exactly the Pythagorean theorem, since the Law of Cosines is a generalized version of it.

    #Trigonometry#High School#Law of Cosines
    Updated

    Keep reading

    Sponsored ToolsAd

    More tools on Ytools →
    Calcu.click — 25+ Free Smart Calculators preview

    Calcu.click — 25+ Free Smart Calculators

    Brand new calculation platform with 0ms reactive math, 100% client-side privacy, and dedicated subdomains. Fast calculators for EMI, SIP, Mortgage, Income Tax, BMI, Age, Percentage, and more.

    25+ CalculatorsFinanceHealth0ms Real-TimeFree
    Keyboard Arena preview

    Keyboard Arena

    Master touch typing with real-time WPM speed tests, mechanical switch audio, A-Z finger biomechanics drills, 40+ structured lessons, and competitive arcade games.

    Typing TestWPMTouch Typing
    Flutter Log Explorer preview

    Flutter Log Explorer

    Real-time structured log viewer and search explorer for Flutter & Dart. Zero-config capture from Debug Adapter (DAP) & Dart VM Service with smart classification and filters.

    FlutterDartVS Code ExtensionOpen VSX