A triangle solver calculator takes any three known values of a triangle (sides, angles, or both) and computes the remaining sides and angles. You enter what you know—like two sides and the included angle, or all three sides—and the calculator returns the missing angles and side lengths, often with the area and perimeter as well. This page explains the math behind the tool, how to use it correctly, and common pitfalls to avoid.
Formula
This calculator uses the law of cosines to find the missing side, then the law of sines or the law of cosines again to find the remaining angles. For the default case—two sides and the included angle (SAS)—the formulas are:
- Side c = √(a² + b² − 2ab·cos C)
- Angle A = arccos((b² + c² − a²) / (2bc))
- Angle B = arccos((a² + c² − b²) / (2ac))
- Area = ½·a·b·sin C
Where a and b are the two known sides, C is the angle between them (in degrees), c is the side opposite angle C, and A and B are the other two angles. All angles are in degrees; the side lengths can be any unit (cm, inches, feet) as long as they are consistent.
Worked Example
Using the default values: a = 5, b = 7, C = 60°.
- Compute side c: c = √(5² + 7² − 2·5·7·cos 60°) = √(25 + 49 − 70·0.5) = √(74 − 35) = √39 ≈ 6.245
- Compute angle A: A = arccos((7² + 6.245² − 5²) / (2·7·6.245)) = arccos((49 + 39 − 25) / (87.43)) = arccos(63/87.43) ≈ arccos(0.7206) ≈ 43.86°
- Compute angle B: B = 180 − 60 − 43.86 = 76.14° (or use the law of cosines similarly)
- Compute area: Area = ½·5·7·sin 60° = 17.5·0.8660 ≈ 15.16 square units
The calculator rounds side c to 6.25, angle A to 43.86°, angle B to 76.14°, and area to 15.16.
When to Use a Triangle Solver
Triangle solvers are used in geometry homework, construction, navigation, and any field where you need to find unknown distances or angles from partial measurements. The most common scenarios are:
- SAS (side-angle-side): you know two sides and the angle between them—this is what the calculator above handles.
- SSS (side-side-side): you know all three sides, and need the angles.
- ASA (angle-side-angle): you know two angles and the side between them.
- AAS (angle-angle-side): you know two angles and a non-included side.
- Right triangles: you can use simpler trig (SOH-CAH-TOA) but a solver works too.
For SSS, the law of cosines finds each angle. For ASA/AAS, the law of sines is more direct. Many online solvers let you pick the known combination; the formula changes accordingly.
How to Choose the Right Solver
When picking a triangle calculator, check what inputs it accepts. Some only handle right triangles, others only SAS. For general triangles, the solver should support at least three known values, including at least one side. Also check whether the calculator uses degrees or radians—most use degrees, but if you’re working in a math context, radians might be expected. If you have a triangle that is not solvable (e.g., the sum of the two smaller sides is less than the largest side), a good calculator will warn you that no such triangle exists.
For this page’s calculator, the inputs are two sides and the included angle. If you have a different combination, you can often transform the problem: for example, if you know two angles and a side, you can find the third angle (sum = 180°) and then use the law of sines.
Common Mistakes and Misconceptions
One frequent error is mixing up which angle is “included.” The law of cosines requires the angle between the two known sides. If you provide an angle that is not between them, the formula gives a wrong answer. Another mistake is forgetting to convert between degrees and radians when using a calculator that expects radians. Also, when using the law of sines to find an angle, remember that there can be two possible angles (the ambiguous case): for a given side-side-angle, the sine function has two solutions between 0° and 180°. The law of cosines avoids this ambiguity, which is why this solver uses it for the first angle.
Another misconception: the sum of angles in a triangle is always 180° (in Euclidean geometry). If your solver returns angles that don’t sum to 180°, you’ve likely entered invalid inputs or the triangle is impossible.
Limitations of the Formula
The law of cosines works for any triangle, but it assumes you have exact values. In practice, measurements have errors, and the computed angles can be sensitive to small input changes, especially when the triangle is nearly degenerate (one angle close to 0° or 180°). Also, the calculator only works in degrees; if you need radians, you’ll have to convert (180° = π radians). The area formula ½ab·sin C gives the area in square units of whatever length unit you used—if sides are in feet, area is in square feet.
For right triangles, you could use simpler formulas, but the law of cosines still works (cos 90° = 0, so it reduces to the Pythagorean theorem).
Frequently Asked Questions
Can I use this calculator for any triangle?
Yes, as long as you have two sides and the included angle. For other combinations (SSS, ASA, etc.), you’d need a different solver or modify the inputs. For example, if you have all three sides, you can find angles using the law of cosines, but this particular calculator doesn’t accept three sides as input.
What if the triangle is impossible?
If you enter values that cannot form a triangle (e.g., a = 1, b = 2, C = 180°), the calculator will show an error or a “Cannot compute” result. The law of cosines might produce a negative value under the square root, which is invalid. Always check that the sum of any two sides is greater than the third side.
Does the calculator work in radians?
No, this calculator uses degrees. If you have an angle in radians, multiply by 180/π to convert. For example, 1 radian ≈ 57.2958°.
What is the ambiguous case?
This occurs when you know two sides and a non-included angle (SSA). The law of sines can give two possible triangles. The law of cosines, which this calculator uses for SAS, does not have this ambiguity, so you don’t need to worry about it here.
Can I find the area with this calculator?
Yes, the area is shown as the fourth output. It uses the formula ½·a·b·sin C, which is the area of the triangle formed by sides a and b with included angle C.
What units should I use for the sides?
Any unit works, as long as you use the same unit for both sides. The resulting side c will be in that same unit, and the area will be in square units of that unit. For example, if a and b are in meters, c is in meters and area is in square meters.
Related
Formula used
in a | Side a | - | 5 | 0 | 100000 in b | Side b | - | 7 | 0 | 100000 in C | Angle C (opposite c) | deg | 60 | 0 | 180 out c | Side c | - | sqrt(a^2 + b^2 - 2*a*b*cosd(C)) | 2 out A | Angle A | deg | acosd((b^2 + c^2 - a^2) / (2*b*c)) | 2 out B | Angle B | deg | acosd((a^2 + c^2 - b^2) / (2*a*c)) | 2 out area | Area | - | 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.
- Sharpe Ratio Calculator & Formula
- Stress Concentration Factor Calculator
- Work Rate Calculator: Formula & Examples5.00 hours
- SSS Triangle Calculator: Solve Side-Side-Side Triangles
- Sustainable Growth Rate Calculator & Formula10.50 %
- Spring Rate Calculator: Formula & Examples