Solve a triangle from two sides and the included angle, or from all three known sides.
Choose a mode, enter your known sides and angle, and click Calculate
This law of cosines calculator solves a triangle when you know two sides and the angle between them (the SAS case), or all three sides with no angle at all (the SSS case). The Law of Cosines — c² = a² + b² − 2ab·cos(C) — is the direct generalization of the Pythagorean theorem to any triangle, right or not. Unlike the Law of Sines, it never runs into an ambiguous case: SAS and SSS inputs each resolve to exactly one triangle, making it the reliable go-to formula whenever no matching angle-side pair is available.
In SAS mode, it uses the two known sides and the included angle to solve directly for the third side, then finds one remaining angle and derives the last one by subtracting from 180°. In SSS mode, it rearranges the Law of Cosines to solve for each angle in turn from the three known side lengths, after first checking the triangle inequality to confirm the three sides can actually form a triangle.
Trigonometry and precalculus students working through SAS and SSS problem sets, engineers and architects who have measured all three sides of a structural triangle and need the angles, surveyors who know two distances and the angle between two sighting lines, and machinists or fabricators checking triangular bracket or gusset dimensions against a design.
Many real-world triangles are only measurable by their sides — think of a triangular plot of land, a truss, or a fabricated bracket where you can measure every edge but not directly sight an angle. The Law of Cosines is what lets you recover every angle purely from side lengths, and it's also the only reliable route to a third side when two sides and the angle between them are the only things you know.
Engineers use it to verify truss and frame geometry from measured side lengths. Surveyors compute an unknown distance from two known distances and the angle between two sighting lines. Machinists confirm bracket and gusset angles purely from side measurements. Navigators use it to solve course and bearing triangles when two legs and their included turn angle are known. Students and teachers use it to check SAS and SSS homework quickly and precisely.
How two sides and an included angle, or three sides alone, solve the rest of the triangle
Setting C = 90° makes cos(C) = 0, collapsing c² = a² + b² − 2ab·cos(C) into the familiar c² = a² + b².
Unlike the Law of Sines' SSA case, both SAS and SSS always resolve to exactly one valid triangle — there's nothing to disambiguate.
In SSS mode, three side lengths only describe a real triangle if every pair of sides sums to more than the third.
From choosing a case to reading the completed triangle
Select the SAS tab if you know two sides and the angle between them, or the SSS tab if you know all three sides.
Type the known side lengths, and the included angle in degrees if you're using SAS mode.
SSS inputs are first checked against the triangle inequality; then the Law of Cosines solves for every missing side and angle.
Review the completed triangle's sides and angles shown together in the results panel.
Solving both cases with verified reference values
A surveyor measures two sides of a triangular plot, a = 4 and b = 6, with an included angle of C = 60° between them. What is the length of the third side and the remaining two angles?
A triangular brace has three measured sides: a = 5, b = 6, c = 7. What are its three interior angles?
Explanation: Neither example has an ambiguous case — SAS and SSS each produce exactly one valid triangle. Notice how SSS requires all three angles to be found via the Law of Cosines' rearranged form, since no angle is known at the start.
What each output means for SAS and SSS triangles
| Output | What It Represents | Typical Range / Notes |
|---|---|---|
| Side c (SAS) | The third side, opposite the included angle | Always positive; grows with a, b, and C |
| Angle A, Angle B (SAS) | The two remaining interior angles | Each strictly between 0° and 180°; sum with C equals 180° |
| Angle A, B, C (SSS) | All three interior angles, solved from the three sides | Each strictly between 0° and 180°; sum to exactly 180° |
| Triangle inequality check (SSS) | Confirms the three sides can physically form a triangle | Fails if any one side ≥ sum of the other two |
Reading the results together: both SAS and SSS always produce exactly one valid triangle (when the inputs are valid) — there is no ambiguous case here, unlike the Law of Sines' SSA scenario.
Typical ranges: all sides must be positive, all angles must fall strictly between 0° and 180°, and the three angles of the resulting triangle must sum to exactly 180°.
Manual verification: once you have all three sides and angles, plug them back into c² = a² + b² − 2ab·cos(C) (using whichever side/angle set you didn't start from) and confirm it holds — a reliable way to sanity-check the calculator's output by hand.
Where solving a triangle from sides and an included angle, or from three sides alone, is genuinely useful
Check SAS and SSS triangle problems step by step.
Find a third boundary length from two measured distances and the angle between them.
Verify truss and frame angles purely from measured side lengths (SSS).
Confirm triangular bracket or gusset dimensions against a design spec.
Solve course-and-bearing triangles from two legs and an included turn angle.
Check triangular roof, truss, or facade geometry against design angles.
Compute distances between transmitters and receivers from known geometry.
Solve triangles where two ranges and an included angle are known.
Recover triangle angles from vertex distances for mesh and collision math.
Solve force, velocity, or displacement triangles using the Law of Cosines directly.
Confirm triangular plot angles and side lengths from a deed or survey.
Solve arm or sensor triangles from measured link lengths and joint angles.
Quickly confirm whether three measured side lengths can actually form a triangle.
What this Law of Cosines calculator does well, and where it doesn't apply
How the known values differ and what each mode solves for first
| Case | Known Values | Solves First | Ambiguous? |
|---|---|---|---|
| SAS | Two sides + the included angle | The third side (c) | No — always one solution |
| SSS | All three sides | Any one angle, then the rest | No — always one solution |
Summary: This Law of Cosines calculator solves SAS and SSS triangles instantly with no ambiguous case to worry about. Pair it with the Law of Sines Calculator for AAS/ASA/SSA triangles, or the Triangle Solver for a general-purpose tool covering every case.
Common questions about the Law of Cosines, SAS, and SSS
Trusted educational references to go deeper on solving triangles
Explore other trigonometry and geometry tools