Skip to main content
ilovecalcs logoilovecalcs.

Math · Live

Solve any triangle, five ways.

A complete triangle solver for SSS, SAS, ASA, AAS, and the ambiguous SSA case. Enter any three values, at least one side, and the calculator detects the case, applies the Law of Cosines or Law of Sines, returns every remaining side and angle, and draws the resulting triangle to scale.

How it worksReal-time

Inputs

Any three values

Detected caseSSS

Three sides — solved with the Law of Cosines.

a=
b=
c=
A=°
B=°
C=°

Solved

scalene · right

6unit²

Area · Heron's formula on the resolved sides.

12perimeter
abcABC

Drawn to scale (proportional)

Side a
3
opposite ∠A · h = 4
Side b
4
opposite ∠B · h = 3
Side c
5
opposite ∠C · h = 2.4
Angle Asolved
36.87°
opposite side a
Angle Bsolved
53.13°
opposite side b
Angle Csolved
90°
opposite side c

Triangle properties

Perimeter, area & type

Live
Perimeter
12
units
Area
6
units²
Shape
Scalene
by sides
Angle class
Right
largest angle

Working

How SSS is solved

Step-by-step
  1. 1Apply Law of Cosines for ∠A
    cos A = (b² + c² − a²) / (2bc)
          = (4² + 5² − 3²) / (2·4·5)
    A = 36.87°
  2. 2Repeat for ∠B; ∠C closes the angle sum
    B = 53.13°
    C = 180° − A − B = 90°
  3. 3Heron's formula → area
    s = (a + b + c) / 2 = 6
    Area = √(s(s−a)(s−b)(s−c)) = 6

Formulas

Every formula this solver uses

Pythagorean theorem

a² + b² = c²

For right triangles only. Hypotenuse opposite the right angle.

Law of Cosines

a² = b² + c² − 2bc·cos(A)

Generalises the Pythagorean theorem. Drives SSS and SAS.

Law of Cosines (rearranged)

cos A = (b² + c² − a²) / 2bc

Solves for an angle when all three sides are known.

Law of Sines

a / sin A = b / sin B = c / sin C

Side-to-sine ratio is constant. Drives ASA, AAS, SSA.

Angle sum

A + B + C = 180°

The fundamental constraint. A + B + C = 180° always.

Heron's formula (area)

s = (a + b + c) / 2
Area = √(s(s−a)(s−b)(s−c))

Area from sides only; no angles required.

Triangle inequality

a + b > c, a + c > b, b + c > a

Validation rule for SSS; required for the sides to close.

Altitude to side

h_a = 2·Area / a

Perpendicular distance from a vertex to the opposite side.

Field guide

Solving a triangle from any three values.

Every triangle has six elements, with just three sides (a, b, c) and three angles (A, B, C), where each side sits opposite the same-letter angle. Once you know any three of these (with at least one side), the other three are uniquely determined… with one famous exception we'll come back to.

Naming convention

Vertices use upper-case letters; the side opposite each vertex shares its letter in lower case. So side a connects vertices B and C, and is opposite angle A. Every formula on this page assumes that convention.

The five solvable cases

  • SSS: three sides. Use the Law of Cosines (rearranged) to recover each angle.
  • SAS: two sides and the angle between them. Law of Cosines gives the third side; the remaining angles fall out via Law of Cosines again or via the Law of Sines.
  • ASA: two angles and the side between them. The third angle is 180° − A − B; the Law of Sines gives the other sides.
  • AAS: two angles and a side not between them. Same approach as ASA.
  • SSA: two sides and an angle that's not between them. The ambiguous case: zero, one, or two valid triangles depending on the numbers.

The Pythagorean theorem

Right triangles get a special-case shortcut. With angle C equal to 90°, the Law of Cosines collapses to:

a² + b² = c²

That's the Pythagorean theorem, algebraically a corollary of the Law of Cosines, and historically the seed of all Euclidean geometry.

The Law of Cosines

Generalises the Pythagorean theorem to any triangle. Three equivalent forms exist, one per side:

a² = b² + c² − 2bc·cos(A)
b² = a² + c² − 2ac·cos(B)
c² = a² + b² − 2ab·cos(C)

For SSS, rearrange to solve for an angle: cos A = (b² + c² − a²) / 2bc.

The Law of Sines

In any triangle, the ratio of each side to the sine of its opposite angle is constant and that constant equals the diameter of the circumscribed circle. The most useful form for the solver:

a / sin A = b / sin B = c / sin C

Once you have one matched side/angle pair, every other side and angle is anchored to that ratio. ASA, AAS, and SSA all lean on this directly.

The SSA ambiguous case

SSA is the only case that doesn't guarantee uniqueness. Given side a opposite angle A, plus another side b, the Law of Sines gives:

sin B = (b · sin A) / a

From sin B you can recover B with asin, but sine is positive in two quadrants, so both B (acute) and 180° − B (obtuse) are mathematically valid. Whether both are geometrically valid depends on whether the obtuse candidate still leaves a positive third angle. The calculator surfaces both real solutions when they exist.

Heron's formula

Once the three sides are known, whatever case you started from, the area is computed via Heron's formula:

s = (a + b + c) / 2 (the semi-perimeter)
Area = √(s(s−a)(s−b)(s−c))

It's numerically stable and works for every valid triangle, including very thin ones where alternative area formulas can lose precision.

The triangle inequality

For three lengths to actually close into a triangle, each must be strictly less than the sum of the other two:

a + b > c, a + c > b, b + c > a

The solver validates this on every SSS input. If the inequality fails, the three sides simply cannot meet at vertices.

Worked example: SSS for a 3-4-5 triangle

Sides a = 3, b = 4, c = 5. Apply the Law of Cosines:

cos A = (4² + 5² − 3²) / (2·4·5) = 32 / 40 = 0.80
A = acos(0.80) ≈ 36.87°
cos B = (3² + 5² − 4²) / (2·3·5) = 18 / 30 = 0.60
B = acos(0.60) ≈ 53.13°
C = 180° − 36.87° − 53.13° = 90°

That confirms the 3-4-5 right triangle. Heron's formula gives s = 6 and area = √(6·3·2·1) = 6.

Why AAA is rejected

Three angles fix the shape (the similarity class) but not the size. Two triangles with identical angle triples can scale by any factor; they're geometrically similar, not congruent. The calculator asks for at least one side because, without that anchor, there's no unique numerical answer to give.

Disclaimer

This is a teaching-grade solver. For high-precision engineering or surveying work, software with arbitrary precision (or the closed-form symbolic expressions) avoids the ~10⁻¹⁰ floating-point rounding floor visible at extreme scales.