1618.dev

small tools, one committed a day

Triangle solver

Enter any three parts of a triangle and get the rest. Convention: side a is opposite angle A, side b opposite B, side c opposite C. Angles are in degrees.

How it works

With three sides (SSS) we solve each angle directly from the law of cosines, cos A = (b2 + c2a2) / 2bc. With two sides and the included angle (SAS) the law of cosines gives the third side; the remaining angles follow. With two angles and any side (ASA / AAS) the third angle is 180° − AB and the missing sides come from the law of sines, a / sin A = b / sin B = c / sin C.

SSA is the ambiguous case. Given side a, side b, and angle A opposite a, there can be zero, one, or two valid triangles depending on whether b·sin A is greater than, equal to, or less than a. Both solutions are shown when they exist.

Area uses Heron's formula: with s = (a + b + c) / 2, area = √(s(sa)(sb)(sc)).