Law of Cosines Calculator — Solve Oblique Triangles with SAS and SSS

Are you a civil engineer calculating the length of a bridge girder, a game developer computing character rotation vectors, or a student solving complex oblique triangles? Our professional Law of Cosines Calculator is the ultimate tool for non-right triangle geometry. Often called the 'Generalized Pythagorean Theorem', the law of cosines allows you to solve for any side or angle in SAS (Side-Angle-Side) and SSS (Side-Side-Side) configurations. Master the logic of advanced trigonometry with absolute mathematical precision and instant results.

  • Free Online Tool
  • Instant Results
  • No Installation
  • Secure & Private

Understanding This Calculator

What is the Law of Cosines? (The Cosine Rule)

The Law of Cosines is a fundamental trigonometric formula that relates all three sides of a triangle to the cosine of one of its angles. It is particularly powerful because it works for any triangle—acute, obtuse, or right-angled. While the Law of Sines requires an opposite side-angle pair, the cosine rule is your go-to solver when you only have information about the sides and the 'included' angle. Our online Law of Cosines solver provides step-by-step clarity for your geometric modeling.

The Law of Cosines Formula

Our triangle calculation tool utilizes the standard three-part equation:

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

  • a, b, c: The lengths of the triangle's sides.
  • C: The angle opposite to side c.
  • Right Triangle Relationship: Notice that if angle C is 90°, cos(90°) = 0, and the formula simplifies exactly to the Pythagorean Theorem: a² + b² = c².

Real-World Engineering & Science Applications

  1. Civil Engineering: Determining the distance between two survey points when an obstacle prevents a direct line-of-sight measurement.
  2. Celestial Navigation: Calculating the distance between two points on the surface of a sphere (Great Circle Distance), which uses a spherical version of the law of cosines.
  3. Robotics & Kinematics: Computing the joint angles needed for a robotic arm to reach a specific (x, y, z) coordinate in 3D space.
  4. Architecture: Designing structural supports for non-rectangular buildings where rafters and beams meet at irregular angles.
  5. Sports Science: Analyzing the path of a projectile or the angle of a golf swing relative to the target line.

SAS vs. SSS Configurations

Using our oblique triangle solver, you can approach problems from two directions: 1. **Side-Angle-Side (SAS)**: You know two sides and the angle between them; use the formula to find the third side. 2. **Side-Side-Side (SSS)**: You know all three side lengths; rearrange the formula (cos C = (a² + b² - c²) / 2ab) to find any of the interior angles. This geometric mapping tool is essential for anyone dealing with irregular polygons and structural layouts.

How to Use

  • Enter the lengths of 'Side a' and 'Side b'.
  • Enter the measure of 'Angle C' (the angle between sides a and b).
  • Review the 'Side c' result, along with 'Angle A' and 'Angle B' outputs.
  • For SSS problems, ensure all three sides satisfy the 'Triangle Inequality Theorem' (the sum of any two sides must be greater than the third).

Frequently Asked Questions

When should I use the Law of Cosines?

Use it when you know two sides and the included angle (SAS) or when you know all three sides (SSS).

Is it better than the Law of Sines?

It's not 'better,' but it is more versatile for specific starting data. For SAS and SSS, the Law of Sines cannot be used until you first apply the Law of Cosines.

Why is it called the Generalized Pythagorean Theorem?

Because it extends a² + b² = c² to non-right triangles by adding a correction term (-2ab cos C).

Can I calculate angles from sides alone?

Yes. If you have all three side lengths (SSS), you can use the law of cosines to find any of the interior angles.

What happens if cos(C) is negative?

The cosine of an angle is negative if the angle is obtuse (greater than 90°). The formula handles this automatically, increasing the length of side c.

Can I use this for 3D coordinates?

Yes. In 3D vectors, the dot product formula (A·B = |A||B|cos θ) is essentially a vector form of the Law of Cosines.

What is the Triangle Inequality Theorem?

It states that for any triangle, the sum of any two sides must be strictly greater than the third side. If not, no triangle can exist.

Is the law of cosines used in GPS?

Yes, it is part of the 'Haversine' formula used to calculate distances between two points on the Earth's surface using latitude and longitude.