How to use the triangle calculator
- Fill in any three values from side a, side b, side c, angle A, angle B and angle C, and leave the rest blank. At least one must be a side.
- Remember that side a sits opposite angle A, side b opposite angle B and side c opposite angle C.
- Read the full solution table: all sides and angles, area, perimeter, inradius, circumradius, the three heights and the triangle type.
- If the values describe the ambiguous side-side-angle case, both possible triangles are shown side by side.
Formula
Law of cosines: c^2 = a^2 + b^2 - 2ab cos C
Law of sines: a / sin A = b / sin B = c / sin C
Angles: A + B + C = 180 degrees
Area = 1/2 x b x c x sin A, perimeter = a + b + c
Inradius = area / semi-perimeter, circumradius = abc / (4 x area)
The calculator recognizes the case from what you entered: SSS, SAS, ASA, AAS or SSA. For SSA it checks whether zero, one or two triangles fit and shows every valid one. Angles are in degrees.
Worked example
Sides 3, 4 and 5 (SSS) give angles of 36.869898, 53.130102 and 90 degrees, an area of 6, and a right, scalene triangle.
For SAS with b = 7, c = 8 and A = 60 degrees, a is sqrt(49 + 64 - 56) = 7.549834.
For ASA with c = 10, A = 40 and B = 60, the third angle is 80 degrees, a = 6.527036 and b = 8.793852.
The ambiguous case a = 6, b = 10, A = 30 degrees has two triangles: one with B = 56.44269, C = 93.55731, c = 11.976879 and area 29.942197, and one with B = 123.55731, C = 26.44269, c = 5.343629 and area 13.359073.
The SSA ambiguity
When you know two sides and an angle that is not between them, the data can fit two triangles, one, or none. If the side opposite the known angle is shorter than the other known side, the second side can swing to two positions and both triangles are valid as long as the angles still add up to less than 180 degrees. The calculator checks the sine value and reports no solution when it would exceed 1, one right triangle when it equals exactly 1 and two triangles when both fit.
Which inputs are valid
Three values are needed for a unique shape, and the calculator checks that they make sense.
- Three sides must satisfy the triangle inequality: the two shorter sides must add up to more than the longest.
- Three angles alone give a shape but not a size, so at least one side is required.
- Two angles must add up to less than 180 degrees.
- Entering four or more values is rejected because extra values could contradict each other.
Related tools
For right triangles only, the Pythagorean theorem calculator is faster. For angle functions, try the trigonometry calculator, and for slope and incline see the slope calculator.
Assumptions and limits
- Lengths can be in any unit, and areas are in the square of that unit.
- Angles are entered in degrees, strictly between 0 and 180.
- Right-triangle detection uses a relative tolerance of 1e-9 so that floating-point rounding does not hide a true right angle.
- Results are shown to 6 decimal places or fewer, rounded half up.
- Everything runs in your browser. Nothing you enter is sent anywhere.
Frequently asked questions
How do you solve a triangle with three sides?
Use the law of cosines to find each angle from the three sides. For sides 3, 4 and 5, the angle opposite the longest side is 90 degrees, so the triangle is a right triangle with area 6.
What is the ambiguous case of the law of sines?
It is the SSA situation: two sides and a non-included angle. The same data can describe two different triangles, and the calculator shows both when they exist.
Why does the calculator say no triangle exists?
Either the sides break the triangle inequality, the angles add up to 180 degrees or more, or in the SSA case the side opposite the angle is too short to reach the other side. The message states which one applies.
Can I solve a triangle from three angles?
Not completely. Three angles give the shape but any size fits. Enter at least one side along with two angles to get all dimensions.
How is the area calculated?
The area is half of side b times side c times the sine of angle A. For three given sides this matches Heron's formula, and for the 3-4-5 triangle it is 6.