Triangle Calculator (Advanced) Formula

Understand the math behind the triangle calculator (advanced). Each variable explained with a worked example.

Formulas Used

Area (Heron's)

area = sqrt(s * (s - side_a) * (s - side_b) * (s - side_c))

Perimeter

perimeter = side_a + side_b + side_c

Inradius

inradius = sqrt(s * (s - side_a) * (s - side_b) * (s - side_c)) / s

Variables

VariableDescriptionDefault
side_aSide a5
side_bSide b6
side_cSide c7
sDerived value= (side_a + side_b + side_c) / 2calculated

How It Works

Triangle Area via Heron's Formula

Formula

s = (a + b + c) / 2 (semi-perimeter)

Area = sqrt(s × (s-a) × (s-b) × (s-c))

Heron's formula computes the area of any triangle when you know all three side lengths, without needing height or angles.

Inradius

The inradius (radius of the inscribed circle) is: r = Area / s

Worked Example

Triangle with sides 5, 6, 7.

side_a = 5side_b = 6side_c = 7
  1. 01s = (5+6+7)/2 = 9
  2. 02Area = √(9 × 4 × 3 × 2) = √216 ≈ 14.6969
  3. 03Inradius = 14.6969 / 9 ≈ 1.6330

Ready to run the numbers?

Open Triangle Calculator (Advanced)