Triangle Calculation Methods and Formulas
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
Triangle calculation methods use known side lengths, angles, or both to find missing measurements, area, and perimeter. Enter three valid measurements into the calculator to get the remaining sides and angles, plus area and perimeter; the three inputs must include enough information to determine one triangle uniquely.
Formula
The calculator uses the law of cosines to find side c, then the inverse cosine form of the law of cosines to find angle A. It gets angle B from the fact that a triangle’s interior angles sum to 180 degrees, and calculates area from two sides and their included angle.
- a and b are the entered side lengths, in the same length unit.
- C is the angle between sides a and b, in degrees.
- c is the side opposite angle C, in the same length unit.
- A and B are the other interior angles, in degrees.
- Area is measured in square units matching the chosen length unit.
The formulas are c = √(a² + b² − 2ab cos C), A = cos⁻¹((b² + c² − a²) / 2bc), B = 180° − A − C, and Area = ab sin C / 2. The calculator’s angle functions interpret degrees, not radians. Use any consistent length unit: for example, inches give square inches, while centimeters give square centimeters. Convert units before entering measurements if they differ.
Worked Example
Using the default values, a = 3 units, b = 4 units, and C = 90°:
- Find side c: c = √(3² + 4² − 2 × 3 × 4 × cos 90°) = √25 = 5 units.
- Find angle A: A = cos⁻¹((4² + 5² − 3²) / (2 × 4 × 5)) = cos⁻¹(32/40) = 36.87°.
- Find angle B: B = 180° − 36.87° − 90° = 53.13°.
- Find area: Area = (3 × 4 × sin 90°) / 2 = 6 square units.
Displayed to two decimal places, the calculator returns c = 5.00, A = 36.87°, B = 53.13°, and area 6.00 square units. The unrounded angles add to 180 degrees.
What Triangle Measurements Are Enough?
A triangle is determined by three suitable measurements, but not every set of three works. Common valid combinations are:
- SSS: all three side lengths. The triangle inequalities must hold: the sum of any two sides must be greater than the third.
- SAS: two side lengths and the angle between them. This calculator follows this method.
- ASA or AAS: two angles and a side. Find the third angle by subtracting the known angles from 180 degrees, then use the law of sines to find missing sides.
- Right triangle: two independent measurements, such as two sides or one side and one acute angle. Use the Pythagorean theorem and/or trigonometric ratios.
Knowing two sides and an angle that is not between them (SSA) can be ambiguous: the measurements may describe no triangle, one triangle, or two. This is why “three measurements” alone does not always guarantee a unique answer.
Other Useful Triangle Methods
Law of sines: For sides opposite their matching angles, a/sin A = b/sin B = c/sin C. It is especially useful when you know an angle-side opposite pair and another angle or side. Check that each side is paired with the angle directly opposite it.
Right-triangle trigonometry: Relative to an acute angle, sin θ = opposite/hypotenuse, cos θ = adjacent/hypotenuse, and tan θ = opposite/adjacent. The hypotenuse is the side opposite the 90-degree angle and is the longest side. The Pythagorean theorem, a² + b² = c², applies only to right triangles when c is the hypotenuse.
Heron’s formula: When all three sides are known, calculate the semiperimeter s = (a + b + c)/2, then area √(s(s − a)(s − b)(s − c)). It avoids needing an angle, though rounding intermediate values too early can affect the result.
How to Choose and Check a Method
Start by labeling each side opposite its same-letter angle: side a is opposite angle A, and so on. Then select a formula that uses the measurements you actually have. Use the law of cosines for SSS or SAS, the law of sines for a known opposite pair plus another measurement, and right-triangle ratios when a 90-degree angle is present.
For a SAS calculation, confirm the entered angle is the included angle between the two entered sides. If it is a different angle, the calculator’s result will describe a different triangle. For a general triangle, sides must be positive and the angles must be between 0 and 180 degrees. A valid triangle’s angles total 180 degrees, and each side must be shorter than the sum of the other two.
Common Errors and Limits
- Mixing units: Do not combine, for example, inches with centimeters without conversion. Area units are squared: a result based on meters is in square meters, not meters.
- Using the wrong angle mode: Many calculators can switch between degrees and radians. This calculator expects degrees.
- Rounding too soon: Keep extra digits in intermediate calculations and round only displayed results. Rounded angles may appear to total 179.99 or 180.01 degrees.
- Entering impossible measurements: A zero side or an invalid angle cannot form the intended ordinary triangle. In calculations from three sides, check the triangle inequalities first.
- Expecting measurements to be exact: A formula can only be as accurate as the values supplied. Small measurement errors can have a noticeable effect, particularly when an angle is very small or close to 180 degrees.
The results describe ideal, flat Euclidean triangles. They do not account for measurement uncertainty, curved surfaces, or construction tolerances. For practical work, treat displayed decimals as calculated precision, not proof that the original measurements were that precise.
Frequently Asked Questions
How do I calculate a missing side of a triangle?
Use the law of cosines when you know two sides and their included angle, or use the Pythagorean theorem for a right triangle with two known sides. The law of sines can also find a side when a known side-angle opposite pair is available.
Can I find a triangle with only two side lengths?
Not usually. Two sides alone can form triangles with many different angles and third-side lengths. You need an additional independent measurement, such as an included angle, a third side, or a suitable angle.
What is the easiest way to calculate triangle area?
If you know a base and its perpendicular height, use Area = base × height / 2. If you know two sides and their included angle, use Area = ab sin C / 2. With all three sides, Heron’s formula is an option.
Do the three angles always add up to 180 degrees?
Yes, for a flat Euclidean triangle. A small discrepancy in displayed results usually comes from rounding; calculations using unrounded values sum to 180 degrees.
What is the difference between the law of sines and the law of cosines?
The law of sines relates each side to the sine of its opposite angle and is useful when an opposite pair is known. The law of cosines relates a side to the other two sides and their included angle, making it useful for SAS and SSS cases.
Related
Formula used
in a | Side a | units | 3 | 0 in b | Side b | units | 4 | 0 in C | Angle C | degrees | 90 | 0 out c | Side c | units | sqrt(a^2 + b^2 - 2*a*b*cosd(C)) | 2 out A | Angle A | degrees | acosd((b^2 + c^2 - a^2) / (2*b*c)) | 2 out B | Angle B | degrees | 180 - A - C | 2 out area | Area | square units | a*b*sind(C)/2 | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.