User Rating 0.0
Total Usage 0 times
Presets:
Enter three side lengths and press Calculate to see results.
Is this tool helpful?

Your feedback helps us improve.

About

Misidentifying a triangle's angles from its side lengths is a common source of error in surveying, structural engineering, and CNC machining. The Law of Cosines generalizes the Pythagorean theorem to non-right triangles: given three sides a, b, and c, each angle is recovered via γ = arccos(a2 + b2 c22ab). This calculator applies that identity to all three vertices, then derives area via Heron's formula, altitudes, medians, circumradius R, and inradius r. Results assume Euclidean flat-plane geometry. For geodetic triangles on Earth's surface exceeding roughly 50 km per side, spherical excess introduces measurable deviation.

law of cosines triangle calculator triangle angles triangle area heron formula geometry calculator triangle solver

Formulas

The Law of Cosines relates each angle to the three side lengths. For a triangle with sides a, b, c opposite to angles α, β, γ respectively:

γ = arccos(a2 + b2 c22ab)

The area is computed via Heron's formula using the semi-perimeter s = a + b + c2:

A = s(s a)(s b)(s c)

Heights (altitudes) from the area relation:

ha = 2Aa

Medians via the median length formula:

ma = 122b2 + 2c2 a2

Circumscribed and inscribed circle radii:

R = abc4A
r = As

Where: a, b, c = side lengths. α, β, γ = angles opposite the respective sides. s = semi-perimeter. A = area. R = circumradius. r = inradius. hx = altitude to side x. mx = median to side x.

Reference Data

PropertyFormulaUnitNotes
Angle αarccos((b2 + c2 a2) ÷ 2bc)°Opposite side a
Angle βarccos((a2 + c2 b2) ÷ 2ac)°Opposite side b
Angle γarccos((a2 + b2 c2) ÷ 2ab)°Opposite side c
Semi-perimeter s(a + b + c) ÷ 2unitsHalf of perimeter
Area As(sa)(sb)(sc)units2Heron's formula
Perimeter Pa + b + cunitsSum of sides
Height ha2A ÷ aunitsAltitude to side a
Height hb2A ÷ bunitsAltitude to side b
Height hc2A ÷ cunitsAltitude to side c
Median ma122b2 + 2c2 a2unitsTo midpoint of a
Median mb122a2 + 2c2 b2unitsTo midpoint of b
Median mc122a2 + 2b2 c2unitsTo midpoint of c
Circumradius Rabc4AunitsCircumscribed circle radius
Inradius rAsunitsInscribed circle radius
Triangle inequalitya + b > c - Must hold for all permutations
Angle sumα + β + γ = 180°°Euclidean constraint
Right triangle testa2 + b2 = c2 - Pythagorean special case
Equilateral area34a2units2When a = b = c
Isosceles testTwo sides equal - Two angles also equal
Scalene definitionAll sides different - All angles different
Obtuse testc2 > a2 + b2 - Largest angle > 90°

Frequently Asked Questions

The triangle inequality theorem requires that the sum of any two sides must strictly exceed the third side. If a + b c for any permutation, no triangle exists in Euclidean geometry. The calculator validates all three inequalities before computing. A degenerate case where equality holds (e.g., sides 3, 4, 7) produces a zero-area collinear segment, not a triangle.
It does not handle them differently. The Pythagorean theorem is a special case of the Law of Cosines. When γ = 90°, cos(90°) = 0, so the cross term 2abcos(γ) vanishes, leaving c2 = a2 + b2. The calculator automatically classifies such triangles as right triangles when the largest angle falls within ±0.001° of 90°.
When two sides nearly sum to the third, the argument of arccos approaches −1 or +1. Floating-point rounding in IEEE 754 double precision can push it outside the valid [−1, +1] domain, producing NaN. This calculator clamps the cosine argument to that domain before applying arccos, preventing computation failure. However, the resulting angle values for near-degenerate triangles carry reduced significant digits. For critical surveying work, verify with independent measurements.
No. This tool assumes Euclidean (flat-plane) geometry where the interior angles sum to exactly 180°. On a sphere, the angle sum exceeds 180° by an amount called spherical excess, proportional to the triangle's area relative to the sphere's radius squared. For Earth-surface triangles with sides under approximately 10 km, the Euclidean approximation error is typically below 0.01°.
The extended Law of Sines states asin(α) = 2R. For obtuse triangles, the circumcenter lies outside the triangle. As the largest angle approaches 180°, the circumradius grows toward infinity because sin(α) approaches zero for the near-straight angle. For equilateral triangles, R = a3, the minimum circumradius for a given side length.
Classification operates on two independent axes. By sides: equilateral (all three sides equal within tolerance 0.0001), isosceles (exactly two sides equal), or scalene (all different). By angles: acute (all angles < 90°), right (one angle = 90° within 0.001°), or obtuse (one angle > 90°). Both classifications are reported simultaneously, e.g., "Scalene Obtuse".