Side Length Triangle Calculator: Find Missing Sides
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.
This calculator finds the missing side length of a triangle when you know the other two sides and the angle between them (SAS), or when you know all three sides and want to verify one. Enter the two known side lengths and the included angle (in degrees), and you get the third side using the Law of Cosines, plus the triangle’s perimeter and area.
Formula
The calculator uses the Law of Cosines:
c² = a² + b² − 2ab · cos(C)
Where:
- a and b are the two known side lengths (in meters, feet, or any consistent unit)
- C is the angle between those two sides (in degrees)
- c is the side opposite angle C – the side you want to find
The perimeter is simply a + b + c. The area is (1/2)·a·b·sin(C), the standard SAS area formula.
Worked Example
Using the default values: a = 5 m, b = 7 m, C = 60°.
- Square the sides: 5² = 25, 7² = 49.
- Multiply: 2·5·7 = 70.
- Cosine of 60° = 0.5, so 70·0.5 = 35.
- c² = 25 + 49 − 35 = 39.
- c = √39 ≈ 6.24 m.
- Perimeter = 5 + 7 + 6.24 = 18.24 m.
- Area = 0.5·5·7·sin(60°) = 17.5·0.8660 ≈ 15.16 m².
The calculator returns c = 6.24, perimeter = 18.24, area = 15.16, matching the manual calculation.
When to Use This Calculator
Use it whenever you have a triangle with two sides and the angle between them – the classic SAS case. This appears in:
- Construction: finding the diagonal of a rectangular plot when you know two sides and the angle.
- Navigation: calculating the distance between two points after moving along two legs of a journey.
- Physics: finding the resultant vector magnitude when two vectors act at an angle.
- Geometry homework: solving for a missing side in any oblique triangle.
If you instead know two angles and one side (ASA or AAS), you need the Law of Sines, not this calculator.
How to Choose the Right Inputs
Make sure the angle you enter is the included angle – the one directly between the two sides you know. If you have sides a and b, the angle must be the one formed where they meet, labeled C. If you have a different pair, relabel your triangle so the known sides are a and b and the known angle is C.
Units: all side lengths must be in the same unit. If you mix meters and centimeters, the result will be wrong. The calculator does not convert units – you must do that first.
Common Mistakes and Pitfalls
- Using the wrong angle: Entering an angle that is not between the two given sides gives a meaningless result. Always check the triangle diagram.
- Forgetting to convert degrees/radians: This calculator uses degrees. If you have radians, multiply by 180/Ï€ to convert.
- Rounding too early: If you round the cosine or intermediate products, the final side can be off by more than expected. Keep full precision until the end.
- Assuming it works for any three sides: The Law of Cosines is general, but if you enter three sides and no angle, you need a different formula (solve for the angle). This calculator expects two sides and an angle.
Limitations and Alternatives
This calculator only handles the SAS case. For other triangle problems, consider:
- SSS (three sides): Use the Law of Cosines to find an angle, then the Law of Sines.
- ASA/AAS (two angles, one side): Use the Law of Sines.
- Right triangles: Use the Pythagorean theorem (a² + b² = c²) when the angle is 90° – this calculator also works with C = 90°, giving c = √(a² + b²).
The formula assumes a flat (Euclidean) triangle. On a sphere, like Earth’s surface, you’d need spherical trigonometry. For most practical purposes, this is not a concern.
Why the Law of Cosines Works
The Law of Cosines generalizes the Pythagorean theorem. When C = 90°, cos(90°) = 0, so the term −2ab·cos(C) disappears, leaving c² = a² + b². For any other angle, the extra term adjusts for the fact that the triangle is not right-angled. It’s derived from the dot product of vectors: if you place side a along the x-axis and side b at angle C, then the vector difference has length c, and expanding the dot product gives the formula.
Frequently Asked Questions
Can I use this calculator if I only know two sides and an angle that is not between them?
No. That is the SSA (side-side-angle) case, which is ambiguous – there can be zero, one, or two possible triangles. You would need the Law of Sines and careful checking. This calculator is strictly for SAS (side-angle-side).
What if my angle is in radians?
Convert to degrees first: multiply radians by 180/π. For example, 1 radian ≈ 57.2958°. The calculator only accepts degrees.
Does the calculator work for obtuse angles?
Yes. The Law of Cosines works for any angle between 0° and 180°. For obtuse angles, cos(C) is negative, so the term −2ab·cos(C) becomes positive, correctly increasing the side length.
What if the triangle is a right triangle?
Enter the two legs as a and b, and set C = 90°. The calculator will return the hypotenuse using the Pythagorean theorem. If you know the hypotenuse and one leg, you can also use this to find the other leg by entering the known leg and the hypotenuse as a and b, with C = 90° – the result will be the missing leg.
How accurate is the result?
The calculator shows results rounded to 2 decimal places. If you need more precision, you can use the formula yourself with a high-precision calculator. Rounding errors are minimal as long as you input values with reasonable precision.
Can I use this for real-world measurements?
Yes, but remember that real-world measurements have errors. The formula is exact for a perfect triangle; measurement errors in a, b, or C will propagate to the result. For critical applications, consider the uncertainty in your inputs.
Related
Formula used
in a | Side a | m | 5 | 0 in b | Side b | m | 7 | 0 in C | Angle C (between a and b) | deg | 60 | 0 out c | Side c | m | sqrt(a^2 + b^2 - 2*a*b*cosd(C)) | 2 out perimeter | Perimeter | m | a + b + c | 2 out area | Area | m^2 | 0.5 * a * b * sind(C) | 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.