About the Law of Cosines Calculator
When you know two sides of a triangle and the angle between them, the Pythagorean theorem alone won't get you the third side, unless that angle happens to be exactly 90°. Our Law of Cosines Calculator handles any triangle, right or not, given that SAS (side-angle-side) information.
How It Works
You enter two side lengths and the angle enclosed between them. The calculator applies the law of cosines to find the third side, then uses the law of cosines again in reverse to find the remaining two angles.
Formula & Methodology
The law of cosines generalizes the Pythagorean theorem to any triangle by adding a correction term that accounts for the included angle. When that angle is exactly 90°, cos(90°) equals 0, and the formula collapses exactly to c² = a² + b², the familiar Pythagorean relationship. For any other angle, the −2ab·cos(C) term adjusts the result up or down: an angle less than 90° shrinks the opposite side relative to a right triangle (since cosine is positive there), while an angle greater than 90° stretches it (since cosine turns negative). Once the third side is known, the same formula can be rearranged and applied again, solving for one of the remaining angles using all three now-known side lengths, and the final angle follows since a triangle's interior angles always sum to 180°.
Step-by-Step: Calculating It By Hand
- 1Convert the given angle to radians if working by hand with a calculator in radian mode.
- 2Square both known sides and add them together.
- 3Subtract 2 × (side a) × (side b) × cos(included angle) from that sum.
- 4Take the square root of the result to find the third side.
- 5Use the law of cosines again, rearranged, to solve for one of the remaining angles, then subtract from 180° for the last one.
Examples
Acute angle
With sides 8 and 6 and an included angle of 60°: the third side comes out to about 7.21.
Right angle check
With the same sides 8 and 6 and a 90° included angle instead, the third side is exactly 10, matching the Pythagorean theorem.
Advantages
- Works for any triangle, not just right triangles
- Finds the remaining side and both remaining angles in one calculation
- Reduces automatically to the Pythagorean theorem for a 90° included angle
- Validates that the entered angle actually forms a legitimate triangle
Common Mistakes
- Applying the Pythagorean theorem to a non-right triangle instead of the law of cosines
- Mixing up which angle is 'included' between the two known sides versus opposite one of them
- Forgetting to convert between degrees and radians consistently when calculating by hand
- Assuming the law of cosines only works for obtuse or only for acute triangles, when it works for both
Edge Cases to Watch For
- An included angle of exactly 90° reduces the law of cosines exactly to the Pythagorean theorem.
- The included angle must be strictly between 0° and 180° to form a valid triangle.
- A very small included angle produces a third side close in length to the difference between the two given sides.
- A very large included angle (close to 180°) produces a third side close to the sum of the two given sides.
Common Use Cases
- Trigonometry coursework involving non-right triangles
- Surveying and navigation problems involving triangulated distances
- Engineering and construction calculations involving angled supports or braces
- Physics problems involving resultant vectors and enclosed angles