TOPICS
Search

Law of Cosines


LawofCosines

The law of cosines states that if a, b, and c are the lengths of the sides of a triangle opposite angles A, B, and C, then

a^2=b^2+c^2-2bccosA
(1)
b^2=a^2+c^2-2accosB
(2)
c^2=a^2+b^2-2abcosC.
(3)

Solving for the cosines yields the equivalent formulas

cosA=(-a^2+b^2+c^2)/(2bc)
(4)
cosB=(a^2-b^2+c^2)/(2ac)
(5)
cosC=(a^2+b^2-c^2)/(2ab).
(6)

This law can be derived in a number of ways. The definition of the dot product incorporates the law of cosines, so that the length of the vector from X to Y is given by

|X-Y|^2=(X-Y)·(X-Y)
(7)
=X·X-2X·Y+Y·Y
(8)
=|X|^2+|Y|^2-2|X||Y|costheta,
(9)

where theta is the angle between X and Y.

The corresponding relation for a triangle in the hyperbolic plane is the hyperbolic law of cosines. For curvature -R^(-2), the Euclidean law above is recovered as R->infty, when the curvature approaches zero from below. Equivalently, the Euclidean formula approximates the hyperbolic formula when the side lengths are small compared with R (Anderson 1999). Thus the hyperbolic formula is the counterpart of the Euclidean law in hyperbolic geometry.

LawOfCosinesTriangles

The formula can also be derived using a little geometry and simple algebra. From the above diagram,

c^2=(asinC)^2+(b-acosC)^2
(10)
=a^2sin^2C+b^2-2abcosC+a^2cos^2C
(11)
=a^2+b^2-2abcosC.
(12)

The law of cosines for the sides of a spherical triangle states that

cosa=cosbcosc+sinbsinccosA
(13)
cosb=cosccosa+sincsinacosB
(14)
cosc=cosacosb+sinasinbcosC
(15)

(Beyer 1987). The law of cosines for the angles of a spherical triangle states that

cosA=-cosBcosC+sinBsinCcosa
(16)
cosB=-cosCcosA+sinCsinAcosb
(17)
cosC=-cosAcosB+sinAsinBcosc
(18)

(Beyer 1987).

For two similar triangles with corresponding side lengths a, b, c and a^', b^', c^', respectively, a generalized law of cosines is

 aa^'=bb^'+cc^'-(bc^'+b^'c)cosA
(19)

(Lee 1997), where A is the angle opposite the sides a and a^'. Now consider an arbitrary tetrahedron A_1A_2A_3A_4 with triangle faces T_1=DeltaA_2A_3A_4, T_2=DeltaA_1A_3A_4, T_3=DeltaA_1A_2A_4, and T_4=DeltaA_1A_2A_3. Let their areas be s_1, s_2, s_3, and s_4, respectively, and let theta_(ij) be the dihedral angle between T_i and T_j for 1<=i<j<=4, with theta_(ij)=theta_(ji). Then

 s_k=sum_(i!=k; 1<=i<=4)s_icostheta_(ki),
(20)

and the associated law of cosines in a tetrahedron is

 s_k^2=sum_(i!=k; 1<=i<=4)s_i^2-2sum_(1<=i<j<=4; i,j!=k)s_is_jcostheta_(ij)
(21)

(Lee 1997). For two similar tetrahedra with corresponding face areas s_i and s_i^' and common dihedral angles theta_(ij), the corresponding polarized identity is

 s_1s_1^'=s_2s_2^'+s_3s_3^'+s_4s_4^'-(s_2s_3^'+s_2^'s_3)costheta_(23)-(s_3s_4^'+s_3^'s_4)costheta_(34)-(s_2s_4^'+s_2^'s_4)costheta_(24).
(22)

See also

Hyperbolic Law of Cosines, Law of Sines, Law of Tangents, Spherical Triangle, Tetrahedron, Triangle Explore this topic in the MathWorld classroom

Explore with Wolfram|Alpha

References

Abramowitz, M. and Stegun, I. A. (Eds.). Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, p. 79, 1972.Anderson, J. W. "Trigonometry in the Hyperbolic Plane." §5.7 in Hyperbolic Geometry. New York: Springer-Verlag, pp. 146-151, 1999.Beyer, W. H. CRC Standard Mathematical Tables, 28th ed. Boca Raton, FL: CRC Press, pp. 148-149, 1987.Lee, J. R. "The Law of Cosines in a Tetrahedron." J. Korea Soc. Math. Ed. Ser. B: Pure Appl. Math. 4, 1-6, 1997.

Referenced on Wolfram|Alpha

Law of Cosines

Cite this as:

Weisstein, Eric W. "Law of Cosines." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/LawofCosines.html

Subject classifications