Home / Math / Triangle Calculator
Triangle Calculator
Solve a triangle from three sides (SSS), two sides with the angle between them (SAS), or two angles with one side (ASA or AAS). The result lists every side and angle, the area, perimeter, inradius and type.
How each case is solved
Sides are named a, b, c, and each angle A, B, C sits opposite the side with the same letter. Three standard results do all the work:
- Law of cosines:
c² = a² + b² − 2ab·cos C. It finds a side from two sides and the included angle, or an angle from three sides. - Law of sines:
a / sin A = b / sin B = c / sin C. Once one side and its opposite angle are known, it scales to the other sides. - Angle sum: A + B + C = 180°, which gives the third angle in the ASA and AAS cases.
The area comes from Heron's formula √(s(s−a)(s−b)(s−c)) when all three sides are given, and from ½ab·sin C otherwise. The inradius is the area divided by the semi-perimeter s, and the circumradius is abc ÷ (4 × area).
Why the SSA case is left out
Two sides and an angle that is not between them (SSA) can describe zero, one or two different triangles. The side opposite the known angle may be too short to reach, may just touch the base, or may swing to either side of the altitude and land at two points. Because the law of sines then yields a sine that matches two different angles (an acute one and its obtuse supplement), the answer is ambiguous and needs a judgment about which solution you want. If you know two sides and a non-included angle, first work out whether both solutions are geometrically possible, or measure another quantity so that the case becomes SAS or ASA.
Triangle types and what the inradius means
By sides, a triangle is equilateral (three equal sides), isosceles (at least two equal) or scalene (all different). By angles it is acute (all angles under 90°), right (one angle of exactly 90°) or obtuse (one angle over 90°). The inradius is the radius of the largest circle that fits inside the triangle touching all three sides; the circumradius is the radius of the circle through all three corners. For a right triangle the inradius equals (a + b − c) / 2, where c is the hypotenuse, so the 3-4-5 triangle has an inradius of 1.
Input tips and limits
Use the same unit for every side, and the area will be in that unit squared. Angles are entered in degrees. In SSS mode the sides must satisfy the triangle inequality: the two shorter sides must add up to more than the longest. In ASA mode the two angles must sum to less than 180°. Results are shown to four decimals, so very flat triangles, where one angle is close to 0° or 180°, may lose a few digits of accuracy in the displayed angles.
Worked example
Two sides of 7 and 9 enclose an angle of 40 degrees. The law of cosines gives the third side, and the law of sines or cosines gives the other angles.
Inputs
| What do you know? | Two sides and the included angle (SAS) |
|---|---|
| Side a | 7 |
| Side b | 9 |
| Angle C between sides a and b | 40 ° |
Result
Scalene and acute triangle. Perimeter 21.7861.
| Side a (opposite A) | 7.0000 |
|---|---|
| Side b (opposite B) | 9.0000 |
| Side c (opposite C) | 5.7861 |
| Angle A | 51.0458° |
| Angle B | 88.9542° |
| Angle C | 40.0000° |
| Perimeter | 21.7861 |
| Semi-perimeter | 10.8930 |
| Area | 20.2478 |
| Inradius (inscribed circle) | 1.8588 |
| Circumradius (circumscribed circle) | 4.5007 |
| Type by sides | Scalene |
| Type by angles | Acute |
Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.
Frequently asked questions
How do I find the area of a triangle with three known sides?
Use Heron's formula. Compute the semi-perimeter s = (a + b + c) / 2, then area = √(s(s−a)(s−b)(s−c)). For sides 3, 4 and 5, s is 6 and the area is √(6×3×2×1) = 6.
What does SAS mean?
SAS stands for side-angle-side: two sides and the angle between them. This is enough to fix a single triangle, and the law of cosines gives the third side directly.
What is the difference between ASA and AAS?
ASA has the known side between the two known angles, while AAS has it opposite one of them. Both work the same way because the third angle follows from the 180 degree sum, so this calculator treats them together.
Why does my triangle show as impossible?
For three sides, the longest side must be shorter than the sum of the other two. For two angles, their sum must be under 180 degrees. Otherwise the shape cannot close.
Is a triangle with sides 5, 12 and 13 a right triangle?
Yes. Since 5² + 12² = 25 + 144 = 169 = 13², the angle opposite the side of 13 is exactly 90 degrees, and the calculator labels it as right.
Related calculators
References and sources
- Standard trigonometry texts for the law of sines, law of cosines and Heron's formula.
- Wolfram MathWorld: Triangle, for properties such as the inradius and circumradius. Link