How to solve a triangle
A triangle has six basic measurements: three sides (a, b, c) and three angles (A, B, C). By convention each angle takes the capital letter of the side across from it, so angle A sits opposite side a. Knowing any three of the six, with at least one side among them, is usually enough to find the other three. Three angles alone are not enough, because they describe the shape without fixing the size: a small and a large equilateral triangle share the same angles.
The calculator recognizes the five standard cases and picks the right tool for each:
- SSS (three sides): angles come from the law of cosines.
- SAS (two sides and the angle between them): the third side comes from the law of cosines.
- ASA and AAS (two angles and one side): the third angle is 180° minus the other two, then the law of sines gives the missing sides.
- SSA (two sides and an angle that is not between them): the law of sines gives a second angle, and there may be zero, one or two valid triangles.
The law of sines and the law of cosines
The law of cosines is a generalization of the Pythagorean theorem. When C is 90°, cos C is zero and the formula collapses to c² = a² + b². The law of sines links each side to the sine of its opposite angle, and the common ratio equals the diameter of the circumscribed circle.
The ambiguous case (SSA)
When you know sides a and b and angle A, the law of sines gives sin B = b · sin A / a. Because two angles between 0° and 180° share the same sine (B and 180° − B), the data may fit two different triangles. If sin B is greater than 1, no triangle exists. If the obtuse candidate makes the angle sum reach 180°, only one triangle exists. Otherwise both are valid, and the calculator lists each one separately.
Worked example
Suppose a = 6, b = 5 and the angle between them is C = 60°. The law of cosines gives c² = 36 + 25 − 2 · 6 · 5 · cos 60° = 61 − 30 = 31, so c ≈ 5.56776. The area is ½ · 6 · 5 · sin 60° ≈ 12.99038, the perimeter is about 16.56776, and the semiperimeter is half of that, about 8.28388. Applying the law of cosines again gives A ≈ 68.948° and B ≈ 51.052°, so the largest angle is under 90° and the sides are all different: an acute scalene triangle.
Area of a triangle
There are several equivalent ways to find the area, depending on what you know:
- Base and height: Area = ½ · base · height.
- Two sides and the included angle: Area = ½ · a · b · sin C.
- Three sides (Heron's formula): Area = √(s(s − a)(s − b)(s − c)), where s = (a + b + c) / 2.
For a 3, 4, 5 triangle, s = 6 and Heron's formula gives √(6 · 3 · 2 · 1) = 6, the same result as ½ · 3 · 4.
Heights, medians, inradius and circumradius
A height (altitude) is the perpendicular distance from a vertex to the line containing the opposite side, so ha = 2 · Area / a. A median joins a vertex to the midpoint of the opposite side; the three medians meet at the centroid, the triangle's balance point. Their lengths follow from Apollonius's theorem: ma = ½ √(2b² + 2c² − a²).
The inradius r is the radius of the largest circle that fits inside the triangle, touching all three sides. It equals the area divided by the semiperimeter. The circumradius R is the radius of the circle through all three vertices, equal to a / (2 sin A) or, equivalently, abc / (4 · Area).
Types of triangles
| By sides | Meaning |
|---|---|
| Equilateral | All three sides equal, every angle 60° |
| Isosceles | Two sides equal, and the angles opposite them equal |
| Scalene | All sides different |
| By angles | Meaning |
|---|---|
| Acute | All angles below 90° |
| Right | One angle exactly 90° |
| Obtuse | One angle above 90° |
Tips for accurate results
Keep units consistent: all sides must use the same length unit, and the area comes out in that unit squared. Results are rounded for display, so if you copy a computed side back into the form, expect tiny differences in the last digit. The coordinate table places vertex A at the origin and vertex B on the positive x-axis, which makes it easy to redraw the triangle on graph paper or in CAD software.