Solve any triangle from three known values. Pick SSS, SAS, ASA, AAS or SSA, enter your sides and angles, and get every missing side and angle with the law of sines or cosines worked out step by step, including both triangles in the ambiguous SSA case.
Last updated:
What do you know?
Enter your values to see the result.
Advertisement
Advertisement
How to use the Law of Sines and Cosines Calculator
Choose what you know: three sides, two sides and an angle, or two angles and a side.
Enter the values. Side a is opposite angle A, b opposite B and c opposite C.
Press Solve triangle to get the missing sides and angles.
For SSA, check the number of solutions: the tool shows both triangles when two fit.
Review the steps, drawing and full property table, or download it as CSV.
Laws of sines and cosines
Law
Formula
Use it for
Law of cosines (side)
c² = a² + b² − 2ab·cos C
SAS: find the third side
Law of cosines (angle)
cos A = (b² + c² − a²) / (2bc)
SSS: find each angle
Law of sines
a / sin A = b / sin B = c / sin C = 2R
ASA, AAS, SSA
Angle sum
A + B + C = 180°
Third angle from two
Area
K = ½·a·b·sin C
Any case once solved
Inradius / circumradius
r = K / s, R = a / (2 sin A)
s = (a + b + c) / 2
The five cases at a glance
Case
You know
Solution path
Number of triangles
SSS
a, b, c
Cosines for A and B, then C = 180° − A − B
1 (if triangle inequality holds)
SAS
a, b and included C
Cosines for c, then cosines for A
Always 1
ASA
A, B and included c
C = 180° − A − B, then sines
1 (if A + B < 180°)
AAS
A, B and a
C = 180° − A − B, then sines
1 (if A + B < 180°)
SSA
a, b and A
sin B = b·sin A / a, check both B and 180° − B
0, 1 or 2
Working through the ambiguous case
With a = 7, b = 10 and A = 40°, the height is h = 10 × sin 40° ≈ 6.428. Because 6.428 < 7 < 10, side a can swing to meet the base in two places. The law of sines gives sin B ≈ 0.9183, so B ≈ 66.67° or B ≈ 113.33°. That produces two valid triangles with C ≈ 73.33° (c ≈ 10.432) or C ≈ 26.67° (c ≈ 4.889). If a were 4, shorter than h, no triangle could be formed at all.
Frequently asked questions
When do I use the law of cosines and when the law of sines?
Use the law of cosines, c² = a² + b² − 2ab·cos C, when you know three sides (SSS) or two sides and the angle between them (SAS). Use the law of sines, a / sin A = b / sin B = c / sin C, when you know two angles and a side (ASA, AAS) or two sides and a non-included angle (SSA).
What is the ambiguous case (SSA)?
When you know sides a and b and angle A opposite a, there can be no triangle, one, or two. Compute the height h = b·sin A. If a < h there is no triangle; if a = h there is one right triangle; if h < a < b there are two triangles; if a ≥ b there is one.
Why is there no triangle for my values?
For three sides, the longest side must be shorter than the sum of the other two (triangle inequality). For angles, the given angles must add up to less than 180°. In the SSA case, side a must be at least the height b·sin A.
How is the area calculated?
The calculator uses K = ½·a·b·sin C, which works for any triangle once two sides and the included angle are known. For three sides it gives the same result as Heron's formula, √(s(s − a)(s − b)(s − c)) with s the semi-perimeter.
Does the law of cosines work for right triangles?
Yes. When C = 90°, cos C = 0, so the law of cosines c² = a² + b² − 2ab·cos C reduces to the Pythagorean theorem c² = a² + b².
Which side is a, b and c?
By convention each side is named after the opposite angle: side a is across from angle A, b across from B and c across from C. Label your triangle that way before entering values, or the results will belong to a different triangle.
Can I enter angles in radians?
Yes. Switch Angles in to Radians; every angle you enter and every angle in the results then uses radians. π radians equals 180°.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.