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.

AAS / ASA / SSA SAS / SSS Ambiguous Case Detection Step-by-Step Working · Area & Perimeter
Share this tool

Solving Mode

C A B a b c

Side a is opposite angle A, side b is opposite angle B, side c is opposite angle C.

Angle at vertex A.

Angle at vertex B.

The side opposite angle A.

Quick Load:

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

A B Cabc
a opposite A — side BC b opposite B — side AC c opposite C — side AB
Law of Sines
a/sin(A) = b/sin(B) = c/sin(C)

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.

Law of Cosines
c² = a² + b² − 2ab·cos(C)

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².

Area Formula
Area = ½ × a × b × sin(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

A C B₁ B₂b a a

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

CaseKnownLaw UsedFind
AASA, B, aLaw of Sinesb, c, C
ASAA, B, cLaw of Sinesa, b, C
SASa, C, bLaw of Cosinesc, A, B
SSSa, b, cLaw of CosinesA, B, C
SSAa, b, ALaw of SinesB, C, c (0, 1, or 2 solutions)

Worked Examples

AAS — Law of Sines
A=40°, B=60°, a=8
C = 180−40−60 = 80°
b = 8·sin60°/sin40° ≈ 10.78
c = 8·sin80°/sin40° ≈ 12.26
SSS — Law of Cosines
a=3, b=4, c=5
A = arccos(32/40) ≈ 36.87°
B = arccos(18/30) ≈ 53.13°
C = 90° (right triangle)
SSA — Ambiguous Case
a=8, b=10, A=35°
sinB = 10·sin35°/8 ≈ 0.717
B₁ ≈ 45.76° → C₁ ≈ 99.24°
B₂ ≈ 134.24° → C₂ ≈ 10.76°

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.