ELI5: Explain Like I'm 5

Law of cosines

The law of cosines is a rule we can use when we have a triangle - which is a shape with three sides and three angles. It helps us figure out how long the sides of the triangle are if we know the lengths of some other sides and angles.

Imagine you have a triangle with sides a, b, and c. The law of cosines tells us that:

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

Let's break this down step by step:

1. c^2: This means we take the length of side c and square it (multiply it by itself). This gives us the total area of the square that c would make if it were stretched out to be a straight line.

2. a^2 + b^2: This means we take the lengths of sides a and b, and square them (multiply each one by itself). Then we add those two numbers together.

3. - 2ab cos(C): This part may seem a bit tricky, but stick with me! We take the length of side a and multiply it by the length of side b. Then we multiply that product by the cosine of the angle C (which is opposite to side c). The 'cos' function is something like a calculator that gives us a number between -1 and 1, depending on the angle we put in. The bigger the angle, the closer to -1 the answer will be; the smaller the angle, the closer to 1. When we multiply the product of the two sides by the cosine of the angle opposite to the third side c, we're just using the rules of triangles to figure out how that third side fits in relative to the other two.

4. Put it all together: So, the law of cosines is really just saying that when we know the angles and lengths of some sides of a triangle, we can use this equation to figure out the length of the missing side. For example, if we know sides a and b, and the angle opposite to side c, we can use this equation to figure out how long c is.

In summary, the law of cosines is a formula we use in math to figure out the length of a missing side of a triangle. We use the lengths of the other sides and angles to do this, and we multiply and add these values together in a specific way to get our answer.