Triangle Calculator
u
u
u
Solved triangle:
Calculation:
This triangle calculator solves any triangle from three known values: three sides (SSS), two sides and the angle between them (SAS), two angles and a side (ASA or AAS), or two sides and an angle opposite one of them (SSA). In the ambiguous SSA case it shows both solutions. It also draws the triangle to scale with its sides and angles, gives the area and perimeter, and classifies it.
Below you will find the formulas, worked examples, a table of cases and the most common questions.
How to use the triangle calculator
Step 1: Under What you know, pick the case: SSS, SAS, ASA, AAS or SSA. The input boxes change with the case. You can also pick a length unit.
Step 2: Enter the three values. Sides use lowercase letters (a, b, c) and each one is opposite the angle with the matching capital letter (A, B, C). Angles are in degrees. A decimal point or comma both work.
Step 3: Click Calculate or press Enter.
Step 4: You get the drawing to scale, a table with sides, angles, area, perimeter and classification, and the Calculation box shows every step. If the SSA case has two solutions, both appear.
Formulas for solving a triangle
The law of cosines, for three sides or for two sides and the angle between them:
| c² = a² + b² - 2ab cos C cos A = (b² + c² - a²) ÷ (2bc) |
The law of sines, when you know a side and its opposite angle:
| a ÷ sin A = b ÷ sin B = c ÷ sin C |
The three angles of a triangle add up to 180°. The area comes from two sides and the angle between them, or from Heron's formula when only the three sides are known (s is the semiperimeter):
| A = ½ab sin C A = √[s(s - a)(s - b)(s - c)] |
To classify it: by sides it is equilateral (three equal), isosceles (two equal) or scalene (none equal); by angles it is acute (all below 90°), right (one of 90°) or obtuse (one above 90°).
Solved triangle examples
Example 1: Three sides (SSS)
A triangle has sides a = 5, b = 7 and c = 8. We use the law of cosines for two angles, the third comes from the 180° sum, and the area from Heron's formula:
cos A = (49 + 64 - 25) ÷ 112 = 0.785714, A = arccos(0.785714) ≈ 38.21°
cos B = (25 + 64 - 49) ÷ 80 = 0.5, B = arccos(0.5) = 60°
C = 180° - 38.21° - 60° ≈ 81.79°
s = 10, Area = √[10 × 5 × 3 × 2] ≈ 17.32
It is a scalene, acute triangle. Its perimeter is 20.
Example 2: Two sides and the angle between them (SAS)
Given a = 8, b = 11 and C = 40°. First the missing side with the law of cosines, then the angles:
c² = 64 + 121 - 2 × 8 × 11 × cos(40°) = 50.176178
c = √50.176178 ≈ 7.084
A ≈ 46.55°, B = 180° - 46.55° - 40° ≈ 93.45°
The area is ½ × 8 × 11 × sin 40° ≈ 28.28.
Example 3: Two angles and the side between them (ASA)
Given A = 40°, B = 60° and c = 10. The third angle comes from the 180° sum and the sides from the law of sines:
C = 180° - 40° - 60° = 80°
a = 10 × sin(40°) ÷ sin(80°) ≈ 6.527
b = 10 × sin(60°) ÷ sin(80°) ≈ 8.794
The perimeter is 25.32 and the area is 28.26.
Example 4: The ambiguous case (SSA)
Given a = 7, b = 10 and A = 30°. Since a is shorter than b but longer than b·sin A = 5, two triangles fit:
sin B = 10 × sin(30°) ÷ 7 = 0.714286
B = 45.58° or B′ = 180° - 45.58° = 134.42°
C = 104.42°, c = 7 × sin(104.42°) ÷ sin(30°) ≈ 13.56
C′ = 15.58°, c′ = 7 × sin(15.58°) ÷ sin(30°) ≈ 3.761
Both are valid: one with c ≈ 13.56 and another with c ≈ 3.761. The calculator draws both on the same base.
Which formula to use for each case
| You know | First step | How many triangles |
|---|---|---|
| SSS: three sides | Law of cosines | One, if the triangle inequality holds |
| SAS: two sides and the angle between them | Law of cosines | Always one |
| ASA: two angles and the side between them | 180° sum and law of sines | One, if the angles add up to less than 180° |
| AAS: two angles and a non-included side | 180° sum and law of sines | One, if the angles add up to less than 180° |
| SSA: two sides and an angle opposite one | Law of sines | None, one or two |
In the SSA case, with acute angle A and h = b·sin A: if a < h there is no triangle, if a = h there is one right triangle, if h < a < b there are two, and if a ≥ b there is one. With A of 90° or more there is a solution only when a > b.
Frequently asked questions
How do you solve a triangle when you know all three sides?
Use the law of cosines to find two angles, then subtract from 180° for the third. With sides 3, 4 and 5 the angles are 36.87°, 53.13° and 90°, so it is a right triangle.
What is the ambiguous SSA case?
It happens when you know two sides and an angle that is not between them. Depending on the numbers there can be zero, one or two triangles, because an angle and its supplement have the same sine. The calculator shows both solutions when they exist.
How do I know if three sides make a triangle?
Each side must be shorter than the sum of the other two (the triangle inequality). Sides 2, 3 and 6 do not work, because 2 + 3 is less than 6.
How do I find the area from the sides alone?
With Heron's formula. For sides 13, 14 and 15 the semiperimeter is 21 and the area is √(21 × 8 × 7 × 6) = 84.
How is a triangle classified?
By its sides (equilateral, isosceles, scalene) and by its largest angle (acute, right, obtuse). The calculator gives both classifications.
Learn more
- Law of sines
- Law of cosines
- Equilateral, isosceles and scalene triangles
- Sum of the interior angles of a triangle
- Triangle inequality
Related calculators
- Pythagorean Theorem Calculator
- Area and Perimeter Calculator
- Circle Calculator (Area and Circumference)
- Surface Area Calculator
- Sine Calculator (Degrees and Radians)
- Interactive Unit Circle
You can explore other calculators here.