Law of Sines & Cosines Calculator
Solve any oblique triangle from just three pieces of information. Choose AAS, ASA, SAS, SSS, or SSA — get all sides, all angles, area, and step-by-step working instantly.
Solving triangle...
Select a solving mode, enter the known values, and solve the triangle instantly.
What Are the Law of Sines and Law of Cosines?
Both laws solve oblique triangles — triangles that have no right angle — where the basic SOH-CAH-TOA approach does not apply. Together they cover every possible combination of known sides and angles: give any three pieces of information and one of the two laws will unlock all six measurements of the triangle.
The naming convention is consistent: side a is opposite angle A, side b is opposite angle B, and side c is opposite angle C. This symmetry makes both formulas easy to apply once you know which vertices carry which labels.
How the Two Triangle Laws Work
Use when you know two angles and any side (AAS or ASA), or two sides and a non-included angle (SSA). The ratio of each side to the sine of the opposite angle is constant throughout the triangle.
Use when you know two sides and their included angle (SAS) or all three sides (SSS). This is a generalisation of the Pythagorean theorem — when C = 90°, cos(90°) = 0 and the law reduces to a² + b² = c².
Works for any triangle: two sides and their included angle are sufficient. For the 3-4-5 right triangle with C = 90°: Area = ½ × 3 × 4 × sin(90°) = ½ × 12 × 1 = 6.
When to Use the Law of Sines (AAS, ASA, SSA)
Reach for the law of sines whenever you have an angle-side opposite pair — one angle and the side directly across from it. If you know that angle A = 40° and side a = 8, you immediately have the ratio a/sin(A). From there, any other angle or its opposite side can be found in one step.
- AAS (Angle-Angle-Side): Two angles uniquely determine the third because all three must sum to 180°. Knowing the third angle gives you the full ratio table.
- ASA (Angle-Side-Angle): Two angles and the side between them. Find the third angle, then use the law of sines twice to recover the remaining two sides.
- SSA (Side-Side-Angle): This is the ambiguous case — see the section below for why it can have zero, one, or two solutions.
A useful mnemonic: Cosines when you know SAS or SSS; Sines for everything else.
When to Use the Law of Cosines (SAS, SSS)
The law of cosines is your tool when you have no ready angle-side opposite pair to start with:
- SAS (Side-Angle-Side): Two sides and the angle they form a "sandwich" around. The law of cosines gives you the third side directly, then the law of sines recovers the remaining angles.
- SSS (Side-Side-Side): Three sides, no angles. Rearrange the law of cosines to solve for each angle: A = arccos((b² + c² − a²) / (2bc)).
Engineers use the law of cosines constantly — to find the resultant magnitude of two force vectors separated by a known angle, or to compute a distance between two GPS waypoints when the bearing angle is known.
The Ambiguous Case (SSA) Explained
SSA gives two sides and a non-included angle, which means the triangle may "swing" into more than one valid position. To test for ambiguity, compute sin(B) = b·sin(A)/a:
- If sin(B) greater than 1: no triangle exists — the given side is too short to reach the opposite edge.
- If sin(B) = 1: exactly one triangle — a right triangle at B.
- If sin(B) less than 1: there is always an acute solution at B₁ = arcsin(sin(B)). A second obtuse solution exists at B₂ = 180° − B₁ only when B₂ + A is less than 180°.
Ambiguous Case — Visual
Both triangles share the same angle A, the same side b (A→C), and the same side length a — yet they produce two distinct triangles.
The dashed arc from C with radius a shows every possible location for the third vertex. When the arc crosses the baseline at two points (B₁ and B₂), two valid triangles exist.
Teal = primary solution. Muted dashes = alternate solution. The calculator labels them Solution 1 and Solution 2.
This two-solution scenario is the reason SSA is called the ambiguous case and appears so often in trigonometry exams. This calculator detects both solutions automatically and displays them side by side when they exist.
Triangle Solving Reference Table
| Case | Known | Law Used | Find |
|---|---|---|---|
| AAS | A, B, a | Law of Sines | b, c, C |
| ASA | A, B, c | Law of Sines | a, b, C |
| SAS | a, C, b | Law of Cosines | c, A, B |
| SSS | a, b, c | Law of Cosines | A, B, C |
| SSA | a, b, A | Law of Sines | B, C, c (0, 1, or 2 solutions) |
Worked Examples
Law of Sines and Cosines FAQ
What is the law of sines?
The law of sines states that in any triangle, the ratio of each side length to the sine of its opposite angle is the same: a/sin(A) = b/sin(B) = c/sin(C). This common ratio equals the diameter of the triangle's circumscribed circle. It holds for all triangles — acute, right, and obtuse.
What is the law of cosines?
The law of cosines generalises the Pythagorean theorem to all triangles. In its most common form: c² = a² + b² − 2ab·cos(C), where C is the angle between sides a and b. Setting C = 90° recovers the Pythagorean theorem immediately because cos(90°) = 0. It can also be rearranged to find any angle given all three sides.
When should I use the law of sines vs. the law of cosines?
Use the law of sines when you have at least one angle-side opposite pair (AAS, ASA, or SSA). Use the law of cosines when you have no such pair — that means two sides and their included angle (SAS) or all three sides (SSS). Memory aid: Cosines for SAS and SSS; Sines for everything else.
What is the ambiguous case in trigonometry?
The ambiguous case arises in SSA — two sides and a non-included angle. Because the sine function returns the same value for both an acute angle and its supplement, sin(B) = sin(180° − B), a single value of sin(B) can correspond to two different triangles. You get zero solutions when sin(B) exceeds 1, one solution when sin(B) equals 1 or the obtuse candidate B₂ makes the angle sum exceed 180°, and two valid solutions otherwise.
Can I use the law of cosines for a right triangle?
Yes. Setting the right angle C = 90° simplifies c² = a² + b² − 2ab·cos(90°) = a² + b² because cos(90°) = 0. The result is the Pythagorean theorem, so the law of cosines works perfectly on right triangles — it just reduces to a simpler formula you already know.
How do I find the area of a triangle using these laws?
Once you have two sides and their included angle, use Area = ½ × side₁ × side₂ × sin(included angle). After solving any case with this calculator you will always have at least one such angle-side pair available, so the area is always computable. For the classic 3-4-5 triangle: Area = ½ × 3 × 4 × sin(90°) = 6 square units.
Related Calculators
Triangle Calculator
Solve any triangle from three known values with a proportional diagram
Pythagorean Theorem Calculator
Find any side of a right triangle from the other two
Angle Calculator
Complementary, supplementary, and missing triangle angles
Area & Perimeter Calculator
Area and perimeter for circles, rectangles, triangles, and more
Significant Figures Calculator
Round to correct sig figs for physics and chemistry problems
Quadratic Formula Calculator
Solve ax² + bx + c = 0 with real or complex roots and steps