Law of cosines
In trigonometry, the law of cosines is a statement about arbitrary triangles which generalizes the Pythagorean theorem by correcting it with a term proportional to the cosine of the opposing angle. Let a, b, and c be the sides of the triangle and A, B, and C the angles opposite those sides. Then,
This formula is useful for computing the third side of a triangle when two sides' and their enclosed angle's values are known, and in computing the angles of a triangle if all three sides' values are known.
The law of cosines also shows that
The statement cos C = 0 implies that C is a right angle, since a and b are positive. In other words, this is the Pythagorean theorem and its converse. Although the law of cosines is a broader statement of the Pythagorean theorem, it isn't a proof of the Pythagorean theorem, because the law of cosines derivation given below depends on the Pythagorean theorem.
Derivation (for acute angles)
Let a, b, and c be the sides of the triangle and A, B, and C the angles opposite those sides. Draw a line from angle B that makes a right angle with the opposite side, b. If the length of that line is x, then which implies
That is, the length of this line is Similarly, the length of the part of b that connects the foot point of the new line and angle C is The remaining length of b is This makes two right triangles, one with legs and hypotenuse c. Therefore, according to the Pythagorean theorem:
Law of cosines using vectors
Using the dot product, we simplify this into
- Several derivations of the Cosine Law, including Euclid's