Triangle Side Length Calculator — Law of Cosines & Sines
Solve for the missing side of any triangle. Choose the SAS method (two sides and the included angle) to apply the Law of Cosines, or the AAS method (one side and two angles) to apply the Law of Sines. All sides, angles, area, and perimeter are returned.
Method
°
Third side found via the Law of Cosines
- 1
cos(C)
cos(60°) = 0.5 - 2
a² + b² − 2ab·cos(C)
5² + 7² − 2 × 5 × 7 × 0.5 = 39The expression under the square root in the Law of Cosines. - 3
Side c
√39 = 6.2450
How does this calculator work?
To find a missing triangle side, use the Law of Cosines (SAS: c = √(a² + b² − 2ab·cos C)) or the Law of Sines (AAS: b = a·sin B / sin A). Select the method, enter the known values, and get the missing side plus all angles, area, and perimeter instantly.
Formula
How this is calculated
When you know two sides and the angle between them (SAS), the Law of Cosines is the direct formula: c² = a² + b² − 2ab·cos(C). After finding c, the remaining angles A and B follow from the same law rearranged to the inverse-cosine form.
When you know one side and two angles (AAS), the third angle is C = 180° − A − B, then the Law of Sines gives the remaining sides: b = a·sin B / sin A and c = a·sin C / sin A. This works because the ratio of a side to the sine of its opposite angle is constant for any triangle.
Both methods assume a valid (non-degenerate) triangle: angles must sum to exactly 180°, all sides must be positive, and the inputs must be geometrically consistent. The area is computed from Heron's formula once all three sides are known.
Frequently asked questions
Use SAS when you have two measured sides and the angle enclosed between them — common in surveying and engineering. Use AAS when you have one measured side and two angles — common in trigonometry problems where angles are easier to measure than sides.
SSA (two sides and a non-included angle) can yield zero, one, or two valid triangles, requiring extra disambiguation logic. Use a dedicated SSA or law-of-sines calculator for that case; SAS and AAS are always unambiguous.
The Law of Cosines is numerically well-behaved for all triangle shapes. Floating-point rounding at very small angles (near 0°) or very obtuse angles (near 180°) may introduce minor rounding errors in the last decimal place, but the result is accurate to at least 10 significant figures for typical inputs.
Also known as
TG we-Calculate Editorial Team. (2026). Triangle Side Length Calculator — Law of Cosines & Sines [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/triangle-length-calculator
TG we-Calculate Editorial Team. "Triangle Side Length Calculator — Law of Cosines & Sines." TG we-Calculate. 2026. https://we-calculate.com/calculator/triangle-length-calculator.
TG we-Calculate Editorial Team, "Triangle Side Length Calculator — Law of Cosines & Sines," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/triangle-length-calculator
@misc{wecalculate_triangle_length_calculator, title = {Triangle Side Length Calculator — Law of Cosines & Sines}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/triangle-length-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
