Law of Cosines Calculator (Find Sides & Angles Fast)

The Law of Cosines Calculator computes a missing side or angle in a triangle using two known sides and the included angle (or two sides and the opposite side). It uses the Law of Cosines formulas to return accurate results quickly, with clear input checks for impossible triangles.

Use it when you know side lengths and an included angle, or when you know three sides and need an angle. This article explains the variables, shows how to apply the formula, and answers common questions.

What Is the Law of Cosines?

The Law of Cosines generalizes the Pythagorean theorem. It works for any triangle, not just right triangles. If you know two sides and the angle between them, you can find the third side.

For a triangle with sides a, b, c opposite angles A, B, C, the Law of Cosines states:

Core Formulas (Sides and Angles)

Use the version that matches what you’re solving for. The calculator supports two common workflows: SS + included angle → third side, and SSS → angle.

1) Find a missing side (two sides + included angle)

If you know a, b, and the included angle C, then the opposite side c is:

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

Equivalent forms let you solve for any third side by swapping variables.

2) Find an angle (three sides)

If you know all three sides a, b, and c, then angle C can be found using:

cos(C) = (a² + b² − c²) / (2ab)

Then compute C = arccos(cos(C)). The arccos step is why values must stay within the valid range for real triangles.

How the Variables Map to Triangle Parts

To avoid mistakes, remember: each side is opposite its matching angle.

  • a is opposite A
  • b is opposite B
  • c is opposite C

When the calculator asks for an “included angle,” it means the angle between the two sides you enter. In the formula c² = a² + b² − 2ab cos(C), the included angle is C between sides a and b.

When to Use the Law of Cosines (Practical Scenarios)

The Law of Cosines Calculator is useful whenever you have a triangle that is not guaranteed to be right. Here are two real-life cases.

Example 1: Navigation and Distance Between Points

Suppose you know two legs of a route from a map: distances a = 6 and b = 10 units, and the included turning angle C = 60°. You want the straight-line distance c between the start and end points.

Apply c² = a² + b² − 2ab cos(C). The result gives the direct distance even though the path forms an oblique triangle.

Example 2: Construction Layout and Diagonal Length

In framing or tiling, you may know two adjacent edges and the angle between them, then need the diagonal. If sides are a = 4 m and b = 7 m with included angle C = 110°, compute c using the calculator.

This helps you size braces, supports, or cut lengths without relying on right-angle assumptions.

Step-by-Step: How to Use the Law of Cosines Calculator

  1. Select what you want to solve: missing side or missing angle.
  2. Enter the required inputs: side lengths and the correct angle (if needed).
  3. Choose units for angles (degrees or radians) and for side length (just for labeling).
  4. Click Calculate to compute the result.
  5. Review validity warnings: the calculator flags cases where a triangle cannot exist.

For best accuracy, use consistent side units (meters, inches, centimeters) and select the angle unit that matches your input.

Common Mistakes (and How to Avoid Them)

  • Using the wrong included angle: the included angle must be between the two sides you multiply in the formula.
  • Mixing degrees and radians: cosine and arccos expect the same angle unit throughout. The calculator handles this.
  • Trying impossible inputs: if the computed cosine falls outside [-1, 1], there is no real angle. The calculator reports an error.

Frequently Asked Questions

What does the Law of Cosines Calculator calculate?

The Law of Cosines Calculator finds a missing side or a missing angle in a triangle. It uses two known sides and their included angle to compute the third side, or it uses three side lengths to compute an angle using arccos. Inputs are validated.

How do I know which angle is the included angle?

The included angle is the angle formed by the two sides you are using in the cosine term. For example, in c² = a² + b² − 2ab cos(C), sides a and b meet at angle C. Use that exact angle.

Why do I get an error when solving for an angle?

When solving for an angle from three sides, the calculator computes cos(θ). If the value is less than −1 or greater than 1, no real triangle exists for those lengths. This can happen due to measurement error or incorrect side assignments.

Can the Law of Cosines Calculator use radians instead of degrees?

Yes. The calculator lets you choose degrees or radians for angle inputs and output. Internally it converts to the correct format for cosine and arccos calculations, so you can enter angles in the unit you use most comfortably.

Is the Law of Cosines always accurate?

It is accurate for real triangles and valid inputs. Results are limited by floating-point rounding, especially for angles near 0° or 180°. If you enter consistent measurements, it will produce reliable answers that match standard math tools.

Bottom Line

The Law of Cosines Calculator gives you a fast, reliable way to solve non-right triangles. Enter the sides and the correct included angle (or all three sides), and it computes the missing side or angle using the standard formulas.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top