⚖️ Law of Sines & Cosines Calculator

Solve any triangle using the powerful law of sines and law of cosines. Find unknown sides and angles with step-by-step solutions.

📊 18,000+ triangles solved 🔄 Updated: February 2026 ⭐ 4.8/5 Rating

Understanding the Laws of Sines and Cosines

The law of sines and law of cosines are fundamental theorems that extend triangle solving beyond right triangles. While the Pythagorean theorem only applies to right triangles, these laws work for any triangle - acute, obtuse, or right. They provide powerful tools for navigation, surveying, engineering, and any field requiring precise angle and distance calculations.

The law of sines states that the ratio of each side to the sine of its opposite angle is constant for all three sides of a triangle. The law of cosines generalizes the Pythagorean theorem, relating the square of one side to the squares of the other sides and the cosine of the included angle. Together, these laws can solve any triangle given sufficient information.

The Mathematical Laws

Law of Sines

a/sin(A) = b/sin(B) = c/sin(C)

Use when you have:

  • Two angles and one side (AAS or ASA)
  • Two sides and an angle opposite one of them (SSA)

Law of Cosines

c² = a² + b² - 2ab·cos(C)

Use when you have:

  • Three sides (SSS)
  • Two sides and the included angle (SAS)

Interactive Triangle Solver

Sides

Angles

Instructions: Fill in the known values based on your selected case. Leave unknown values empty.

Triangle Solving Cases

Case 1: SSS (Three Sides)

Given: All three sides a, b, c

Method: Use law of cosines to find angles

1. Find angle C: cos(C) = (a² + b² - c²)/(2ab)

2. Find angle A: cos(A) = (b² + c² - a²)/(2bc)

3. Find angle B: B = 180° - A - C

Case 2: SAS (Two Sides, Included Angle)

Given: Two sides and the angle between them

Method: Law of cosines, then law of sines

1. Find third side: c² = a² + b² - 2ab·cos(C)

2. Use law of sines for remaining angles

Case 3: ASA (Two Angles, Included Side)

Given: Two angles and the side between them

Method: Law of sines

1. Find third angle: C = 180° - A - B

2. Use law of sines to find remaining sides

Case 4: AAS (Two Angles, Non-included Side)

Given: Two angles and a side not between them

Method: Law of sines

1. Find third angle: C = 180° - A - B

2. Use law of sines for remaining sides

Case 5: SSA (Two Sides, Non-included Angle)

Given: Two sides and angle opposite one of them

Method: Law of sines (ambiguous case)

1. Check for ambiguous case

2. Use law of sines carefully

3. May have 0, 1, or 2 solutions

Worked Examples

Example 1: Using Law of Cosines (SAS)

Given: a = 5, b = 7, C = 60°

Find: Side c and angles A and B

Solution:

Step 1: Find side c using law of cosines

c² = a² + b² - 2ab·cos(C)

c² = 5² + 7² - 2(5)(7)·cos(60°)

c² = 25 + 49 - 70·(0.5) = 74 - 35 = 39

c = √39 ≈ 6.24

Step 2: Find angle A using law of sines

sin(A)/a = sin(C)/c

sin(A) = a·sin(C)/c = 5·sin(60°)/6.24 ≈ 0.694

A = arcsin(0.694) ≈ 44.0°

Step 3: Find angle B

B = 180° - A - C = 180° - 44.0° - 60° = 76.0°

Example 2: Using Law of Sines (ASA)

Given: A = 50°, B = 70°, c = 10

Find: Sides a and b, and angle C

Solution:

Step 1: Find angle C

C = 180° - A - B = 180° - 50° - 70° = 60°

Step 2: Find side a using law of sines

a/sin(A) = c/sin(C)

a = c·sin(A)/sin(C) = 10·sin(50°)/sin(60°) ≈ 8.84

Step 3: Find side b using law of sines

b/sin(B) = c/sin(C)

b = c·sin(B)/sin(C) = 10·sin(70°)/sin(60°) ≈ 10.84

The Ambiguous Case (SSA)

The SSA case (two sides and an angle opposite one of them) can be tricky because it may result in zero, one, or two valid triangles. This happens because the given information might not uniquely determine a triangle.

How to Handle the Ambiguous Case:

Step 1: Check if a triangle exists

If the given angle is obtuse (> 90°), the side opposite to it must be the longest side.

Step 2: Apply law of sines

Calculate the other angle using law of sines. If sin(angle) > 1, no triangle exists.

Step 3: Check for two solutions

If the calculated angle is acute, there might be a second solution where the angle is obtuse (supplementary angle).

Real-World Applications

🧭 Navigation

Ships and aircraft use these laws to calculate distances and bearings when direct measurement isn't possible. GPS systems internally use similar triangulation principles.

📏 Surveying

Land surveyors use the law of cosines to measure inaccessible distances, such as across rivers or between mountain peaks, using triangulation methods.

🏗️ Engineering

Structural engineers apply these laws to analyze forces in trusses and frameworks, ensuring buildings and bridges can handle various loads safely.

🌌 Astronomy

Astronomers use these laws to calculate distances between celestial objects and determine orbital parameters of planets and satellites.

Frequently Asked Questions

When should I use the law of sines vs. law of cosines?

Use the law of cosines when you have three sides (SSS) or two sides and the included angle (SAS). Use the law of sines when you have two angles and any side (AAS/ASA) or two sides and a non-included angle (SSA). The law of cosines is generally more reliable and doesn't have ambiguous cases.

What is the ambiguous case and how do I handle it?

The ambiguous case occurs with SSA information, where you might have zero, one, or two valid triangles. Always check if your calculated angle makes sense geometrically. If you get an acute angle, consider whether the supplementary angle might also create a valid triangle.

How accurate are these laws for real-world measurements?

The laws are mathematically exact, but real-world accuracy depends on measurement precision. Small errors in angle or distance measurements can compound, especially in long chains of triangulation. Professional surveyors use high-precision instruments and error-checking methods to maintain accuracy.