Law of Sines and Cosines Calculator (Triangle Solver)
Solve any triangle from three known values (SSS, SAS, ASA, AAS or SSA) with the law of sines and law of cosines, including the ambiguous case.
How to use this calculator
Enter exactly three known values, including at least one side, and leave the rest as 0. Angle A is opposite side a, B opposite b and C opposite c. The calculator identifies the case (for example SAS: two sides and the angle between them), solves the triangle and reports the missing sides, angles, area and perimeter. For two sides and a non-included angle (SSA) it reports both triangles when two are possible.
Formula
Law of cosines: c² = a² + b² − 2ab cos C. Law of sines: a ÷ sin A = b ÷ sin B = c ÷ sin C. Angles sum to 180°. Area = ½ab sin C. SSA has 0, 1 or 2 solutions depending on whether sin B = b sin A ÷ a is above 1, equal to 1 or below 1 (with the obtuse alternative 180° − B also valid when it fits).
Calculator credits
Calculator developmentJulia Edwards
Editorial supervisionSamad Aslam Khan
Expert reviewIfrahMSc Mathematics
Published byThe Calculatorz
Last updated
Read how we research, test, review and correct our calculators in our editorial policy.
Frequently asked questions
When do I use the law of sines?
When you know an angle and its opposite side plus one more value (ASA, AAS or SSA).
When do I use the law of cosines?
When you know three sides (SSS) or two sides and the angle between them (SAS).
What is the ambiguous case?
With two sides and a non-included angle (SSA), there may be no triangle, one triangle or two different triangles that fit.
Why can't I solve with three angles?
Three angles fix the shape but not the size: infinitely many similar triangles fit. At least one side is needed.
How is the area found?
From two sides and the included angle: ½ab sin C, which works once the triangle is solved.
How does this differ from the Triangle Area Calculator?
That calculator starts from three sides; this one solves any combination of sides and angles.
References & methodology sources
These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.
- Abramson, J. (2017). Non-right triangles: Law of sines. In Precalculus (Section 8.1). OpenStax. View source
- Abramson, J. (2017). Non-right triangles: Law of cosines. In Precalculus (Section 8.2). OpenStax. View source
- Abramson, J. (2021). Precalculus 2e. OpenStax. View source
- Olver, F. W. J., Lozier, D. W., Boisvert, R. F., & Clark, C. W. (Eds.). (2024). NIST Digital Library of Mathematical Functions. National Institute of Standards and Technology. View source