Law of Cosines Calculator
Use the law of cosines to solve a triangle. Pick SAS for two sides and the included angle, or SSS for all three sides, and get the missing sides, all angles and the area.
How to use the law of cosines
- Choose SAS (two sides and the included angle C) or SSS (three sides).
- Enter the known sides and, for SAS, the included angle in degrees.
- Read the remaining side, all three angles and the triangle area.
Examples
SAS: two sides and the included angle
a = 5, b = 7, angle C = 37 degrees
c 4.2539, angle A 45.02, angle B 97.98, area 10.5318
SSS: three sides (3-4-5 triangle)
a = 3, b = 4, c = 5
angle C 90, angle A 36.87, angle B 53.13, area 6
Frequently asked questions
What is the law of cosines?
The law of cosines states that c squared equals a squared plus b squared minus 2ab times the cosine of angle C. It generalizes the Pythagorean theorem to any triangle.
When should I use SAS versus SSS?
Use SAS when you know two sides and the angle between them. Use SSS when you know all three side lengths and want to find the angles.
How is the area calculated?
For SAS the area is one half times a times b times the sine of angle C. For SSS the area comes from Heron's formula using the three sides.
Why are some three-side inputs rejected?
Three lengths only form a triangle when each pair of sides adds up to more than the third. Inputs that break this triangle inequality are rejected.
Are angles in degrees or radians?
Angles are entered and reported in degrees. The included angle is converted to radians internally before the cosine and sine are taken.
Related tools
Law of Sines Calculator
Solve a triangle with the law of sines. Enter a known angle and its opposite side plus one more angle or side to find the remaining angles and sides.
Triangle Area Calculator
Find the area of a triangle from base and height, three sides (Heron's formula) or two sides and an angle (SAS). Free, accurate and instant.
Triangle Calculator
Find a triangle's area from base and height or from three sides with Heron's formula, and solve right triangles with the Pythagorean theorem.
Pythagorean Theorem Calculator
Find the missing side of a right triangle with a squared plus b squared equals c squared. Get the legs, hypotenuse, area and perimeter instantly.
Annulus Area Calculator
Calculate the area of an annulus, the ring between two concentric circles, from its outer and inner radius. Returns both circumferences and width too. Free.
Area Calculator
Find the area of a circle, square, rectangle, triangle, trapezoid, parallelogram, ellipse, sector or rhombus. Free and runs in your browser.