What is the law of cosines?
Answers
Answer:Derivation of Cosine Law
The following are the formulas for cosine law for any triangles with sides a, b, c and angles A, B, C, respectively.
a
2
=
b
2
+
c
2
−2bccosA
a2=b2+c2−2bccosA
b
2
=
a
2
+
c
2
−2accosB
b2=a2+c2−2accosB
c
2
=
a
2
+
b
2
−2abcosC
c2=a2+b2−2abcosC
Derivation:
Consider the triangle to the right:
Cosine function for triangle ADB
cosA=
x
c
cosA=xc
x=ccosA
x=ccosA
Pythagorean theorem for triangle ADB
x
2
+
h
2
=
c
2
x2+h2=c2
h
2
=
c
2
−
x
2
h2=c2−x2
Pythagorean theorem for triangle CDB
(b−x
)
2
+
h
2
=
a
2
(b−x)2+h2=a2
Substitute h2 = c2 - x2
(b−x
)
2
+(
c
2
−
x
2
)=
a
2
(b−x)2+(c2−x2)=a2
(
b
2
−2bx+
x
2
)+(
c
2
−
x
2
)=
a
2
(b2−2bx+x2)+(c2−x2)=a2
b
2
−2bx+
c
2
=
a
2
b2−2bx+c2=a2
Substitute x = c cos A
b
2
−2b(ccosA)+
c
2
=
a
2
b2−2b(ccosA)+c2=a2
Rearrange:
a
2
=
b
2
+
c
2
−2bccosA
a2=b2+c2−2bccosA
The other two formulas can be derived in the same manner
Step-by-step explanation:
In trigonometry, the law of cosines (also known as the cosine formula or cosine rule) relates the lengths of the sides of a triangle to the cosine of one of its angles. Using notation as in Fig. 1, the law of cosines states
{\displaystyle c^{2}=a^{2}+b^{2}-2ab\cos \gamma ,} {\displaystyle c^{2}=a^{2}+b^{2}-2ab\cos \gamma ,}
where γ denotes the angle contained between sides of lengths a and b and opposite the side of length c. For the same figure, the other two relations are analogous:
{\displaystyle a^{2}=b^{2}+c^{2}-2bc\cos \alpha ,} {\displaystyle a^{2}=b^{2}+c^{2}-2bc\cos \alpha ,}
{\displaystyle b^{2}=a^{2}+c^{2}-2ac\cos \beta .} {\displaystyle b^{2}=a^{2}+c^{2}-2ac\cos \beta .}
The law of cosines generalizes the Pythagorean theorem, which holds only for right triangles: if the angle γ is a right angle (of measure 90 degrees, or
π
/
2
radians), then cos γ = 0, and thus the law of cosines reduces to the Pythagorean theorem:
{\displaystyle c^{2}=a^{2}+b^{2}.} {\displaystyle c^{2}=a^{2}+b^{2}.}
The law of cosines is useful for computing the third side of a triangle when two sides and their enclosed angle are known, and in computing the angles of a triangle if all three sides are known.