Log in Sign up
Back to Discover
🔢

Law of cosines

math Maturity 7-9

Shapes like triangles are everywhere.

Triangle with notations 2.svg
Triangle with notations 2.svg
You can use math to find a missing side. It helps you know how long a side is. You can also find a corner's size. This math is very helpful. Do you like shapes?

43 words

Triangles have three sides and three corners.

Triangle with notations 2.svg
Triangle with notations 2.svg
Sometimes you know the length of the sides. Other times, you know how wide a corner is. This math rule helps you find what is missing. It can find a side if you know two sides and a corner.
triangle-with-an-unknown-angle-or-side.svg
triangle-with-an-unknown-angle-or-side.svg
It can also find a corner if you know all three sides. Long ago, people used this to solve star puzzles. It is a very useful tool for shapes.

80 words

Imagine you have a triangle. You know the length of two sides. You also know the angle between them. How long is the third side? The law of cosines helps you find out.

Triangle with notations 2.svg
Triangle with notations 2.svg
This rule works for any triangle. It is a bigger version of the Pythagorean theorem. That theorem only works for right triangles.
triangle-with-an-unknown-angle-or-side.svg
triangle-with-an-unknown-angle-or-side.svg
The law of cosines is also great for finding angles. You can do this if you know all three side lengths.
Obtuse Triangle With Altitude ZP.svg
Obtuse Triangle With Altitude ZP.svg
People have studied this for a very long time. Euclid wrote about it in ancient Greece. Later, mathematicians like al-Tusi and al-Kashi used it too. In France, some people call it the theorem of al-Kashi.
Law of cosines following al-Kashi.png
Law of cosines following al-Kashi.png
This rule is a very helpful tool. It helps us solve many puzzles about shapes and space.

143 words

Imagine you are looking at a triangle. You might know the lengths of two sides and the angle between them. You might also know all three side lengths but none of the angles. The law of cosines is a special math rule that helps you solve these puzzles. It connects the lengths of the sides to the cosine of an angle. This rule is very helpful because it works for every kind of triangle.

Triangle with notations 2.svg
Triangle with notations 2.svg
It is a bigger version of the Pythagorean theorem. That famous theorem only works for right triangles with one square corner. The law of cosines works even if the corners are very wide or very sharp.
triangle-with-an-unknown-angle-or-side.svg
triangle-with-an-unknown-angle-or-side.svg

How does this rule actually work? It uses the sides and an angle to find a missing piece of information. If you have two sides and the angle between them, you can find the third side. You can also use it to find the angles if you already know all three sides.

Obtuse Triangle With Altitude ZP.svg
Obtuse Triangle With Altitude ZP.svg
Sometimes, the math can be a bit tricky. If you are looking for a side, there might be two different possible answers. This happens in certain cases involving the side-side-angle setup. When the triangle has very small angles, computers might even have a hard time calculating the exact numbers.
Law of cosines in plane trigonometry.svg
Law of cosines in plane trigonometry.svg

People have been studying these triangle rules for a very long time. Around 300 BC, a mathematician named Euclid wrote about these ideas in his book called Elements. He did not use modern symbols, but he talked about the areas of rectangles. Later, mathematicians in India developed trigonometry with sines and cosines.

Ptolemy cos.svg
Ptolemy cos.svg
In the 11th century, al-Bīrūnī used these ideas to solve problems about the stars. In the 13th century, a Persian mathematician named Naṣīr al-Dīn al-Ṭūsī showed a systematic way to solve triangles. He used a method of dropping a straight line to create right triangles.
Triangle with trigonometric proof of the law of cosines.svg
Triangle with trigonometric proof of the law of cosines.svg

Many different thinkers added to this math over the centuries. Jamshīd al-Kāshī was a Persian mathematician who lived in the 15th century. He was very good at making accurate math tables. In France, some people call this rule the théorème d'Al-Kashi to honor his work.

Law of cosines following al-Kashi.png
Law of cosines following al-Kashi.png
Another mathematician named Regiomontanus wrote about these triangles in 1464. In the 16th century, François Viète began using the algebraic symbols we recognize today. By the 1800s, the law of cosines looked almost exactly like the formula we use in school now.

You can see how this rule links to things you already know. It builds directly on the Pythagorean theorem that you might have learned. If you use the law of cosines on a right triangle, it turns back into that simpler theorem.

Triangle-law-of-cosines-proof.png
Triangle-law-of-cosines-proof.png
It also connects to the way we use coordinates to map out points on a grid. By placing a triangle on a coordinate system, we can use the distance formula to prove it works. This shows how many different parts of math all fit together beautifully.

516 words

The law of cosines is a fundamental principle in trigonometry. It provides a mathematical relationship between the side lengths of a triangle and the cosine of one of its angles. This rule is essential for solving triangles, which means finding unknown side lengths or interior angles. While the famous Pythagorean theorem is limited to right triangles, the law of cosines is much more versatile. It applies to any triangle, whether it is acute, right, or obtuse.

Triangle with notations 2.svg
Triangle with notations 2.svg

To understand how the law works, consider its mechanism in solving for missing values. If you know the lengths of two sides and the angle between them, you can calculate the third side. This is often called the side-angle-side case. If you know all three side lengths, you can use the formula to find any of the three angles.

triangle-with-an-unknown-angle-or-side.svg
triangle-with-an-unknown-angle-or-side.svg
The formula can even be used to find a third side if you know two sides and an angle that is not between them. In this specific case, the math can lead to two, one, or zero possible positive solutions for the side length. This variation is related to what mathematicians call the side-side-angle congruence ambiguity.

There are different ways to categorize the triangles used in this law. An acute triangle has all angles less than 90 degrees. An obtuse triangle has one angle greater than 90 degrees. A right triangle has exactly one 90-degree angle. The law of cosines handles these cases through the properties of the cosine function. For an acute angle, the cosine value is positive. For an obtuse angle, the cosine value is negative.

Obtuse Triangle With Altitude ZP.svg
Obtuse Triangle With Altitude ZP.svg
When the angle is exactly 90 degrees, the cosine is zero. In this specific instance, the law of cosines simplifies perfectly into the Pythagorean theorem.
Law of cosines in plane trigonometry.svg
Law of cosines in plane trigonometry.svg

The history of this concept spans thousands of years and many cultures. Around 300 BC, the Greek mathematician Euclid described a geometric version of this rule in his work, *Elements*. He did not use modern algebraic notation, but instead expressed the idea through the areas of rectangles. Later, Hellenistic trigonometry and Indian mathematicians developed the concepts of sine and cosine. In the 11th century, al-Bīrūnī used these trigonometric principles to solve astronomical problems.

Ptolemy cos.svg
Ptolemy cos.svg
By the 13th century, the Persian mathematician Naṣīr al-Dīn al-Ṭūsī provided a systematic way to solve triangles by dropping a perpendicular line to create right triangles.
Triangle with trigonometric proof of the law of cosines.svg
Triangle with trigonometric proof of the law of cosines.svg

Significant contributions continued through the 15th century with Jamshīd al-Kāshī. He was a Persian mathematician known for computing highly accurate trigonometric tables. He described methods for solving triangles that were later consolidated into the modern formula. Because of his influence, the law of cosines is sometimes called the *théorème d'Al-Kashi* in France.

Law of cosines following al-Kashi.png
Law of cosines following al-Kashi.png
In 1464, the mathematician Regiomontanus published a comprehensive survey of trigonometry that included these methods. It was not until the 16th century that François Viète began using algebraic notation for such rules. By the start of the 19th century, the law reached its current symbolic form.

Modern mathematicians use various methods to prove the law of cosines. One common approach uses the Pythagorean theorem by dropping an altitude to create two right triangles. Another method uses coordinate geometry. By placing a triangle on a Cartesian coordinate system, one can use the distance formula to derive the law.

Triangle-law-of-cosines-proof.png
Triangle-law-of-cosines-proof.png
This coordinate method is particularly useful because it does not require treating acute and obtuse triangles as separate cases. There are even proofs involving the areas of shapes, where the law is demonstrated by cutting and pasting geometric pieces.
law of cosines with acute angles.svg
law of cosines with acute angles.svg

The law of cosines connects many different branches of mathematics. It serves as a bridge between geometry and algebra. It also links trigonometry to the study of vectors through the dot product. Furthermore, it relates to the study of circles via Ptolemy's theorem. Even in advanced fields like spherical trigonometry, versions of this law are used to understand shapes on a curved surface. This interconnectedness makes the law of cosines a vital tool in both theoretical math and practical science.

694 words
🖼️ Images & Media (18)
File:Triangle with notations 2.svg
Triangle with notations 2.svg
File:triangle-with-an-unknown-angle-or-side.svg
triangle-with-an-unknown-angle-or-side.svg
File:SSA triangle ambiguity.png
SSA triangle ambiguity.png
File:Obtuse Triangle With Altitude ZP2.svg
Obtuse Triangle With Altitude ZP2.svg
File:Law of cosines following al-Kashi.png
Law of cosines following al-Kashi.png
File:Law of cosines in plane trigonometry.svg
Law of cosines in plane trigonometry.svg
File:Obtuse Triangle With Altitude ZP.svg
Obtuse Triangle With Altitude ZP.svg
File:Triangle with trigonometric proof of the law of cosines.svg
Triangle with trigonometric proof of the...
File:Triangle-with-cosines.svg
Triangle-with-cosines.svg
File:Triangle-law-of-cosines-proof.png
Triangle-law-of-cosines-proof.png
File:Ptolemy cos.svg
Ptolemy cos.svg
File:law of cosines with acute angles.svg
law of cosines with acute angles.svg

+ 6 more

Up Next
🔢
Law of sines
Math
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.