CalcRover

Triangle Calculator

Solve a whole triangle from what you know: three sides (SSS), or two sides and the angle between them (SAS). You get every side, every angle, the area and perimeter — with the law of cosines and Heron's formula written out.

How triangles are solved

Three independent facts determine a triangle. From three sides, the law of cosines recovers each angle (cos A = (b² + c² − a²) ÷ 2bc) and Heron's formula gives the area from the sides alone. From two sides and the included angle, the law of cosines builds the third side and ½ab·sin C gives the area directly.

Sanity rules the calculator enforces: any two sides must sum to more than the third (triangle inequality), and the three angles always total 180°. For right triangles specifically, the Pythagorean calculator is the shortcut.

SSS: angles via law of cosines; area via Heron
SAS: c² = a² + b² − 2ab·cos C; area = ½ab·sin C

Worked examples

Example 1: the 3-4-5 triangle (SSS)

Sides 3, 4 and 5 — find the angles and area.

  1. Largest angle from the law of cosines.
    cos C = (9 + 16 − 25) ÷ 24 = 0 → C = 90°
  2. Heron's area with s = 6.
    √(6 × 3 × 2 × 1) = 6

Angles ≈ 36.9°, 53.1°, 90°; area 6 — the classic right triangle.

Example 2: fence corner (SAS)

Two fence runs of 5 m and 7 m meet at 60° — how long is the straight brace between their ends?

  1. Law of cosines for the third side.
    √(25 + 49 − 70 × 0.5) = √39 ≈ 6.24 m
  2. Area of the enclosed triangle.
    ½ × 5 × 7 × sin 60° ≈ 15.2 m²

The brace is about 6.24 m; the triangle encloses ~15.2 m².

Example 3: can 2, 3 and 7 make a triangle?

Check the triangle inequality.

  1. Sort the sides and compare the two shorter against the longest.
    2, 3 vs 7
  2. The triangle inequality fails.
    2 + 3 = 5 < 7 ✗

No — the short sides can't even touch. The calculator reports exactly this instead of NaN angles.

FAQ

Which combinations of values determine a triangle?+

SSS (three sides), SAS (two sides + included angle), ASA/AAS (two angles + a side) determine it uniquely. SSA is ambiguous (can give two triangles), and AAA fixes only the shape, not the size. This page covers SSS and SAS; ASA is planned.

Why does my angle come out as NaN on other calculators?+

Usually an impossible triangle — sides violating the inequality push cos beyond ±1 and acos explodes. This calculator checks first and tells you in words.

What if my triangle is right-angled?+

Everything here still works, but the Pythagorean theorem calculator is faster and speaks in legs and hypotenuse — use it when you know the 90° is there.

Does it do degrees or radians?+

Degrees in, degrees out — the convention of carpentry, navigation and school homework. Multiply by π/180 if you need radians.

Related calculators