What the triangle calculator does
Give the calculator three sides (SSS), or two sides and the angle between them (SAS), and it solves the whole triangle: all three sides, all three angles, the perimeter and the area, with a drawing to scale. It covers the geometry that turns up in carpentry, roofing, land measurement, navigation, surveying, physics homework and any time you need a distance you cannot measure directly. Runs in your browser.
The formulas
Law of cosines (find a side from two sides and the included angle):
c² = a² + b² − 2ab·cos(C)
Law of cosines (find an angle from three sides):
cos(C) = (a² + b² − c²) / (2ab)
Heron's formula (area from three sides), s = (a + b + c) / 2:
Area = √( s(s − a)(s − b)(s − c) )
Area from two sides and the included angle:
Area = ½ · a · b · sin(C)
Pythagoras (right triangle only): c² = a² + b²Given three sides, the calculator uses the law of cosines for each angle and Heron's formula for the area. Given two sides and the included angle, it finds the third side with the law of cosines, then proceeds as above. Angles are reported in degrees and always sum to 180°.
Worked example
Sides a = 7, b = 9, c = 12
cos(C) = (49 + 81 − 144) / (2 × 7 × 9) = −14 / 126 = −0.111 → C = 96.4°
cos(A) = (81 + 144 − 49) / (2 × 9 × 12) = 176 / 216 = 0.815 → A = 35.4°
B = 180 − 96.4 − 35.4 = 48.2°
s = 14; Area = √(14 × 7 × 5 × 2) = √980 = 31.3
Perimeter = 28Does the triangle exist?
- Triangle inequality: each side must be shorter than the sum of the other two. Sides 3, 4, 8 cannot form a triangle (3 + 4 < 8); the calculator reports this instead of a result.
- Included angle must be between 0° and 180° exclusive.
- SSS and SAS each define exactly one triangle. The ambiguous case (two sides and a non-included angle, SSA) can have two solutions and is not offered here for that reason.
Triangle types at a glance
| Type | Test | Note |
|---|---|---|
| Right | Largest angle = 90° (a² + b² = c²) | Pythagoras applies; 3-4-5 and 5-12-13 are integer examples |
| Acute | All angles < 90° | |
| Obtuse | One angle > 90° | Longest side opposite it |
| Equilateral | All sides equal | All angles 60°; area = (√3/4)·a² |
| Isosceles | Two sides equal | Base angles equal |
| Scalene | All sides different | All angles different |
Practical uses
- Checking a corner is square — measure 3 units along one wall, 4 along the other; the diagonal should be exactly 5. Any multiples work (60/80/100 cm).
- Roof and stair pitches — rise and run give the rafter or stringer length and the angle to cut.
- Bracing and trusses — the length of a diagonal brace between two known points.
- Land and property — the area of a triangular plot from its three boundary lengths, or a quadrilateral split into two triangles.
- Navigation and surveying — a distance across a river or to an inaccessible point from a measured baseline and angles.
Frequently asked questions
Can I enter two angles and a side?
Not directly. The third angle is 180° minus the two given; then use the law of sines by hand (a / sin A = b / sin B) or compute the sides and enter them here.
Why is my area different from length × width ÷ 2?
That shortcut works only for right triangles with the legs as length and width. For other triangles use Heron's formula or ½ab·sin(C), which the calculator applies.
What units should I use?
Any, as long as all sides use the same unit. Area comes out in that unit squared; angles are always degrees.
How do I convert the angle to a roof pitch?
Pitch is rise per 12 units of run in US practice: tan(angle) × 12. A 30° roof is about 6.9:12. In degrees, the angle is the pitch.
How accurate is it?
Double-precision floating point — far beyond any tape measure. Results are rounded to two decimals for display.
Are my values stored?
No. The calculation runs in your browser.