HOME

TheInfoList



OR:

In
trigonometry Trigonometry () is a branch of mathematics that studies relationships between side lengths and angles of triangles. The field emerged in the Hellenistic world during the 3rd century BC from applications of geometry to astronomical studies. T ...
, the law of cosines (also known as the cosine formula, cosine rule, or
al-Kashi Ghiyāth al-Dīn Jamshīd Masʿūd al-Kāshī (or al-Kāshānī) ( fa, غیاث الدین جمشید کاشانی ''Ghiyās-ud-dīn Jamshīd Kāshānī'') (c. 1380 Kashan, Iran – 22 June 1429 Samarkand, Transoxania) was a Persian astronomer a ...
's theorem) relates the lengths of the sides of a
triangle A triangle is a polygon with three Edge (geometry), edges and three Vertex (geometry), vertices. It is one of the basic shapes in geometry. A triangle with vertices ''A'', ''B'', and ''C'' is denoted \triangle ABC. In Euclidean geometry, an ...
to the cosine of one of its
angle In Euclidean geometry, an angle is the figure formed by two Ray (geometry), rays, called the ''Side (plane geometry), sides'' of the angle, sharing a common endpoint, called the ''vertex (geometry), vertex'' of the angle. Angles formed by two ...
s. Using notation as in Fig. 1, the law of cosines states :c^2 = a^2 + b^2 - 2ab\cos\gamma, where denotes the angle contained between sides of lengths and and opposite the side of length . For the same figure, the other two relations are analogous: :a^2=b^2+c^2-2bc\cos\alpha, :b^2=a^2+c^2-2ac\cos\beta. The law of cosines generalizes the
Pythagorean theorem In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposite t ...
, which holds only for right triangles: if the angle is a right angle (of measure 90 degrees, or
radian The radian, denoted by the symbol rad, is the unit of angle in the International System of Units (SI) and is the standard unit of angular measure used in many areas of mathematics. The unit was formerly an SI supplementary unit (before that c ...
s), then , and thus the law of cosines reduces to the
Pythagorean theorem In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposite t ...
: :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.


History

Though the notion of the cosine was not yet developed in his time,
Euclid Euclid (; grc-gre, Wikt:Εὐκλείδης, Εὐκλείδης; BC) was an ancient Greek mathematician active as a geometer and logician. Considered the "father of geometry", he is chiefly known for the ''Euclid's Elements, Elements'' trea ...
's '' Elements'', dating back to the 3rd century BC, contains an early geometric theorem almost equivalent to the law of cosines. The cases of obtuse triangles and acute triangles (corresponding to the two cases of negative or positive cosine) are treated separately, in Propositions 12 and 13 of Book 2. Trigonometric functions and algebra (in particular negative numbers) being absent in Euclid's time, the statement has a more geometric flavor: Using notation as in Fig. 2, Euclid's statement can be represented by the formula :AB^2 = CA^2 + CB^2 + 2 (CA)(CH). This formula may be transformed into the law of cosines by noting that . Proposition 13 contains an entirely analogous statement for acute triangles. Euclid's ''Elements'' paved the way for the discovery of law of cosines. In the 15th century,
Jamshīd al-Kāshī Ghiyāth al-Dīn Jamshīd Masʿūd al-Kāshī (or al-Kāshānī) ( fa, غیاث الدین جمشید کاشانی ''Ghiyās-ud-dīn Jamshīd Kāshānī'') (c. 1380 Kashan, Iran – 22 June 1429 Samarkand, Transoxania) was a Persian astronomer ...
, a Persian mathematician and astronomer, provided the first explicit statement of the law of cosines in a form suitable for
triangulation In trigonometry and geometry, triangulation is the process of determining the location of a point by forming triangles to the point from known points. Applications In surveying Specifically in surveying, triangulation involves only angle me ...
. He provided accurate trigonometric tables and expressed the theorem in a form suitable for modern usage. As of the 2020s, in
France France (), officially the French Republic ( ), is a country primarily located in Western Europe. It also comprises of Overseas France, overseas regions and territories in the Americas and the Atlantic Ocean, Atlantic, Pacific Ocean, Pac ...
, the law of cosines is still referred to as the ''Théorème d'Al-Kashi.'' The theorem was popularized in the
Western world The Western world, also known as the West, primarily refers to the various nations and state (polity), states in the regions of Europe, North America, and Oceania.
by
François Viète François Viète, Seigneur de la Bigotière ( la, Franciscus Vieta; 1540 – 23 February 1603), commonly know by his mononym, Vieta, was a French mathematician whose work on new algebra was an important step towards modern algebra, due to i ...
in the 16th century. At the beginning of the 19th century, modern algebraic notation allowed the law of cosines to be written in its current symbolic form.


Uses

The theorem is used in
triangulation In trigonometry and geometry, triangulation is the process of determining the location of a point by forming triangles to the point from known points. Applications In surveying Specifically in surveying, triangulation involves only angle me ...
, for solving a triangle or circle, i.e., to find (see Figure 3): *the third side of a triangle if one knows two sides and the angle between them: c = \sqrt\,; *the angles of a triangle if one knows the three sides: \gamma = \arccos\left(\frac\right)\,; *the third side of a triangle if one knows two sides and an angle opposite to one of them (one may also use the
Pythagorean theorem In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposite t ...
to do this if it is a
right triangle A right triangle (American English) or right-angled triangle ( British), or more formally an orthogonal triangle, formerly called a rectangled triangle ( grc, ὀρθόσγωνία, lit=upright angle), is a triangle in which one angle is a right a ...
): a=b\cos\gamma \pm \sqrt\,. These formulas produce high
round-off error A roundoff error, also called rounding error, is the difference between the result produced by a given algorithm using exact arithmetic and the result produced by the same algorithm using finite-precision, rounded arithmetic. Rounding errors are d ...
s in
floating point In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. For example, 12.345 can be ...
calculations if the triangle is very acute, i.e., if is small relative to and or is small compared to 1. It is even possible to obtain a result slightly greater than one for the cosine of an angle. The third formula shown is the result of solving for ''a'' in the
quadratic equation In algebra, a quadratic equation () is any equation that can be rearranged in standard form as ax^2 + bx + c = 0\,, where represents an unknown (mathematics), unknown value, and , , and represent known numbers, where . (If and then the equati ...
. This equation can have 2, 1, or 0 positive solutions corresponding to the number of possible triangles given the data. It will have two positive solutions if , only one positive solution if , and no solution if . These different cases are also explained by the side-side-angle congruence ambiguity.


Proofs


Using the

distance formula In mathematics, the Euclidean distance between two points in Euclidean space is the length of a line segment between the two points. It can be calculated from the Cartesian coordinates of the points using the Pythagorean theorem, therefor ...

Consider a triangle with sides of length , , , where is the measurement of the angle opposite the side of length . This triangle can be placed on the Cartesian coordinate system with side aligned along the ''x'' axis and angle placed at the origin, by plotting the components of the 3 points of the triangle as shown in Fig. 4: :A = (b \cos\theta, b \sin\theta), B = (a, 0), \text C = (0, 0). By the
distance formula In mathematics, the Euclidean distance between two points in Euclidean space is the length of a line segment between the two points. It can be calculated from the Cartesian coordinates of the points using the Pythagorean theorem, therefor ...
, :c = \sqrt. Squaring both sides and simplifying :\begin c^2 & = (a - b \cos\theta)^2 + (- b \sin\theta)^2 \\ c^2 & = a^2 - 2 a b \cos\theta+ b^2 \cos^2 \theta+ b^2 \sin^2 \theta\\ c^2 & = a^2 + b^2 (\sin^2 \theta+ \cos^2 \theta) - 2 a b \cos\theta\\ c^2 & = a^2 + b^2 - 2 a b \cos\theta. \end An advantage of this proof is that it does not require the consideration of different cases for when the triangle is acute, right, or obtuse.


Using trigonometry

Dropping the
perpendicular In elementary geometry, two geometric objects are perpendicular if they intersect at a right angle (90 degrees or π/2 radians). The condition of perpendicularity may be represented graphically using the ''perpendicular symbol'', ⟂. It can ...
onto the side through point , an
altitude Altitude or height (also sometimes known as depth) is a distance measurement, usually in the vertical or "up" direction, between a reference datum and a point or object. The exact definition and reference datum varies according to the context ...
of the triangle, shows (see Fig. 5) :c=a\cos\beta+b\cos\alpha. (This is still true if or is obtuse, in which case the perpendicular falls outside the triangle.) Multiplying through by yields :c^2 = ac\cos\beta + bc\cos\alpha. Considering the two other altitudes of the triangle yields :a^2 = ac\cos\beta + ab\cos\gamma, :b^2 = bc\cos\alpha + ab\cos\gamma. Adding the latter two equations gives :a^2 + b^2 = ac\cos\beta + bc\cos\alpha + 2ab\cos\gamma. Subtracting the first equation from the last one results in :a^2 + b^2 - c^2 = ac\cos\beta + bc\cos\alpha + 2ab\cos\gamma - ( ac\cos\beta + bc\cos\alpha ) which simplifies to :c^2 = a^2 + b^2 - 2ab\cos\gamma. This proof uses
trigonometry Trigonometry () is a branch of mathematics that studies relationships between side lengths and angles of triangles. The field emerged in the Hellenistic world during the 3rd century BC from applications of geometry to astronomical studies. T ...
in that it treats the cosines of the various angles as quantities in their own right. It uses the fact that the cosine of an angle expresses the relation between the two sides enclosing that angle in ''any'' right triangle. Other proofs (below) are more geometric in that they treat an expression such as merely as a label for the length of a certain line segment. Many proofs deal with the cases of obtuse and acute angles separately.


Using the Pythagorean theorem


Case of an obtuse angle

Euclid Euclid (; grc-gre, Wikt:Εὐκλείδης, Εὐκλείδης; BC) was an ancient Greek mathematician active as a geometer and logician. Considered the "father of geometry", he is chiefly known for the ''Euclid's Elements, Elements'' trea ...
proved this theorem by applying the
Pythagorean theorem In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposite t ...
to each of the two right triangles in the figure shown ( and ). Using to denote the line segment and for the height , triangle gives us :c^2 = (b+d)^2 + h^2, and triangle gives :d^2 + h^2 = a^2. Expanding the first equation gives :c^2 = b^2 + 2bd + d^2 +h^2. Substituting the second equation into this, the following can be obtained: :c^2 = a^2 + b^2 + 2bd. This is Euclid's Proposition 12 from Book 2 of the '' Elements''.Java applet version
by Prof. D E Joyce of Clark University.
To transform it into the modern form of the law of cosines, note that :d = a\cos(\pi-\gamma)= -a\cos\gamma.


Case of an acute angle

Euclid's proof of his Proposition 13 proceeds along the same lines as his proof of Proposition 12: he applies the Pythagorean theorem to both right triangles formed by dropping the perpendicular onto one of the sides enclosing the angle and uses the square of a difference to simplify.


Another proof in the acute case

Using more trigonometry, the law of cosines can be deduced by using the Pythagorean theorem only once. In fact, by using the right triangle on the left hand side of Fig. 6 it can be shown that: \begin c^2 & = (b-a\cos\gamma)^2 + (a\sin\gamma)^2 \\ & = b^2 - 2ab\cos\gamma + a^2\cos^2\gamma+a^2\sin^2\gamma \\ & = b^2 + a^2 - 2ab\cos\gamma, \end using the
trigonometric identity In trigonometry, trigonometric identities are Equality (mathematics), equalities that involve trigonometric functions and are true for every value of the occurring Variable (mathematics), variables for which both sides of the equality are defined. ...
\cos^2\gamma + \sin^2\gamma = 1. This proof needs a slight modification if . In this case, the right triangle to which the Pythagorean theorem is applied moves ''outside'' the triangle . The only effect this has on the calculation is that the quantity is replaced by As this quantity enters the calculation only through its square, the rest of the proof is unaffected. However, this problem only occurs when is obtuse, and may be avoided by reflecting the triangle about the bisector of . Referring to Fig. 6 it is worth noting that if the angle opposite side is then: :\tan\alpha = \frac. This is useful for direct calculation of a second angle when two sides and an included angle are given.


Using Ptolemy's theorem

Referring to the diagram, triangle ''ABC'' with sides = , = and = is drawn inside its circumcircle as shown. Triangle is constructed congruent to triangle with = and = . Perpendiculars from and meet base at and respectively. Then: :\begin & BF=AE=BC\cos\hat=a\cos\hat \\ \Rightarrow \ & DC=EF=AB-2BF=c-2a\cos\hat. \end Now the law of cosines is rendered by a straightforward application of
Ptolemy's theorem In Euclidean geometry, Ptolemy's theorem is a relation between the four sides and two diagonals of a cyclic quadrilateral (a quadrilateral whose vertices lie on a common circle). The theorem is named after the Greek astronomer and mathematician ...
to
cyclic quadrilateral In Euclidean geometry, a cyclic quadrilateral or inscribed quadrilateral is a quadrilateral whose vertices all lie on a single circle. This circle is called the ''circumcircle'' or ''circumscribed circle'', and the vertices are said to be ''c ...
: :\begin & AD \times BC + AB \times DC = AC \times BD \\ \Rightarrow \ & a^2 + c(c-2a\cos\hat)=b^2 \\ \Rightarrow \ & a^2+c^2-2ac \cos\hat=b^2. \end Plainly if angle is
right Rights are law, legal, social, or ethics, ethical principles of Liberty, freedom or entitlement; that is, rights are the fundamental normative rules about what is allowed of people or owed to people according to some legal system, social convent ...
, then is a rectangle and application of Ptolemy's theorem yields the
Pythagorean theorem In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposite t ...
: :a^2+c^2=b^2.\quad


By comparing areas

One can also prove the law of cosines by calculating
area Area is the quantity that expresses the extent of a region on the plane or on a curved surface. The area of a plane region or ''plane area'' refers to the area of a shape A shape or figure is a graphics, graphical representation of an obje ...
s. The change of sign as the angle becomes obtuse makes a case distinction necessary. Recall that *, , and are the areas of the squares with sides , , and , respectively; *if is acute, then is the area of the parallelogram with sides and forming an angle of ; *if is obtuse, and so is negative, then is the area of the parallelogram with sides ''a'' and ''b'' forming an angle of . Acute case. Figure 7a shows a
heptagon In geometry, a heptagon or septagon is a seven-sided polygon or 7-gon. The heptagon is sometimes referred to as the septagon, using "sept-" (an elision of ''septua-'', a Latin-derived numerical prefix, rather than ''hepta-'', a Greek-derived num ...
cut into smaller pieces (in two different ways) to yield a proof of the law of cosines. The various pieces are *in pink, the areas , on the left and the areas and on the right; *in blue, the triangle , on the left and on the right; *in grey, auxiliary triangles, all
congruent Congruence may refer to: Mathematics * Congruence (geometry), being the same size and shape * Congruence or congruence relation, in abstract algebra, an equivalence relation on an algebraic structure that is compatible with the structure * In mod ...
to , an equal number (namely 2) both on the left and on the right. The equality of areas on the left and on the right gives :\,a^2 + b^2 = c^2 + 2ab\cos\gamma\,. Obtuse case. Figure 7b cuts a
hexagon In geometry, a hexagon (from Greek , , meaning "six", and , , meaning "corner, angle") is a six-sided polygon. The total of the internal angles of any simple (non-self-intersecting) hexagon is 720°. Regular hexagon A '' regular hexagon'' has ...
in two different ways into smaller pieces, yielding a proof of the law of cosines in the case that the angle is obtuse. We have *in pink, the areas , , and on the left and on the right; *in blue, the triangle twice, on the left, as well as on the right. The equality of areas on the left and on the right gives :\,a^2 + b^2 - 2ab\cos(\gamma) = c^2. The rigorous proof will have to include proofs that various shapes are
congruent Congruence may refer to: Mathematics * Congruence (geometry), being the same size and shape * Congruence or congruence relation, in abstract algebra, an equivalence relation on an algebraic structure that is compatible with the structure * In mod ...
and therefore have equal area. This will use the theory of
congruent triangles In geometry, two figures or objects are congruent if they have the same shape and size, or if one has the same shape and size as the mirror image of the other. More formally, two sets of points are called congruent if, and only if, one can be t ...
.


Using geometry of the circle

Using the geometry of the circle, it is possible to give a more geometric proof than using the
Pythagorean theorem In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposite t ...
alone. Algebraic manipulations (in particular the
binomial theorem In elementary algebra, the binomial theorem (or binomial expansion) describes the algebraic expansion of powers of a binomial. According to the theorem, it is possible to expand the polynomial into a sum involving terms of the form , where the ...
) are avoided. Case of acute angle , where . Drop the
perpendicular In elementary geometry, two geometric objects are perpendicular if they intersect at a right angle (90 degrees or π/2 radians). The condition of perpendicularity may be represented graphically using the ''perpendicular symbol'', ⟂. It can ...
from onto = , creating a line segment of length . Duplicate the ''
right triangle A right triangle (American English) or right-angled triangle ( British), or more formally an orthogonal triangle, formerly called a rectangled triangle ( grc, ὀρθόσγωνία, lit=upright angle), is a triangle in which one angle is a right a ...
'' to form the isosceles triangle . Construct the
circle A circle is a shape consisting of all points in a plane that are at a given distance from a given point, the centre. Equivalently, it is the curve traced out by a point that moves in a plane so that its distance from a given point is const ...
with center and radius , and its
tangent In geometry, the tangent line (or simply tangent) to a plane curve at a given point is the straight line that "just touches" the curve at that point. Leibniz defined it as the line through a pair of infinitely close points on the curve. More ...
through . The tangent forms a right angle with the radius (Euclid's ''Elements'': Book 3, Proposition 18; or see
here Here is an adverb that means "in, on, or at this place". It may also refer to: Software * Here Technologies, a mapping company * Here WeGo (formerly Here Maps), a mobile app and map website by Here Technologies, Here Television * Here TV (form ...
), so the yellow triangle in Figure 8 is right. Apply the
Pythagorean theorem In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposite t ...
to obtain :c^2 = b^2 + h^2. Then use the ''tangent secant theorem'' (Euclid's ''Elements'': Book 3, Proposition 36), which says that the square on the tangent through a point outside the circle is equal to the product of the two lines segments (from ) created by any secant of the circle through . In the present case: , or :h^2 = a(a - 2b\cos\gamma). Substituting into the previous equation gives the law of cosines: :c^2 = b^2 + a(a - 2b\cos\gamma). Note that is the
power Power most often refers to: * Power (physics), meaning "rate of doing work" ** Engine power, the power put out by an engine ** Electric power * Power (social and political), the ability to influence people or events ** Abusive power Power may a ...
of the point with respect to the circle. The use of the Pythagorean theorem and the tangent secant theorem can be replaced by a single application of the
power of a point theorem In elementary plane geometry, the power of a point is a real number that reflects the relative distance of a given point from a given circle. It was introduced by Jakob Steiner in 1826. Specifically, the power \Pi(P) of a point P with respect to ...
. Case of acute angle , where . Drop the
perpendicular In elementary geometry, two geometric objects are perpendicular if they intersect at a right angle (90 degrees or π/2 radians). The condition of perpendicularity may be represented graphically using the ''perpendicular symbol'', ⟂. It can ...
from onto = , creating a line segment of length . Duplicate the
right triangle A right triangle (American English) or right-angled triangle ( British), or more formally an orthogonal triangle, formerly called a rectangled triangle ( grc, ὀρθόσγωνία, lit=upright angle), is a triangle in which one angle is a right a ...
to form the isosceles triangle . Construct the
circle A circle is a shape consisting of all points in a plane that are at a given distance from a given point, the centre. Equivalently, it is the curve traced out by a point that moves in a plane so that its distance from a given point is const ...
with center and radius , and a chord through perpendicular to half of which is Apply the
Pythagorean theorem In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposite t ...
to obtain :b^2 = c^2 + h^2. Now use the ''chord theorem'' (Euclid's ''Elements'': Book 3, Proposition 35), which says that if two chords intersect, the product of the two line segments obtained on one chord is equal to the product of the two line segments obtained on the other chord. In the present case: or :h^2 = a(2b\cos\gamma - a). Substituting into the previous equation gives the law of cosines: :b^2 = c^2 + a(2b\cos\gamma - a)\,. Note that the power of the point with respect to the circle has the negative value . Case of obtuse angle . This proof uses the power of a point theorem directly, without the auxiliary triangles obtained by constructing a tangent or a chord. Construct a circle with center and radius (see Figure 9), which intersects the secant through and in and . The
power Power most often refers to: * Power (physics), meaning "rate of doing work" ** Engine power, the power put out by an engine ** Electric power * Power (social and political), the ability to influence people or events ** Abusive power Power may a ...
of the point with respect to the circle is equal to both and . Therefore, :\begin c^2 - a^2 & = b(b + 2a\cos(\pi - \gamma)) \\ & = b(b - 2a\cos\gamma), \end which is the law of cosines. Using algebraic measures for line segments (allowing
negative numbers In mathematics, a negative number represents an opposite. In the real number system, a negative number is a number that is less than zero. Negative numbers are often used to represent the magnitude of a loss or deficiency. A debt that is owed ma ...
as lengths of segments) the case of obtuse angle () and acute angle () can be treated simultaneously.


Using the law of sines

By using the
law of sines In trigonometry, the law of sines, sine law, sine formula, or sine rule is an equation relating the lengths of the sides of any triangle to the sines of its angles. According to the law, \frac \,=\, \frac \,=\, \frac \,=\, 2R, where , and a ...
and knowing that the angles of a triangle must sum to 180 degrees, we have the following system of equations (the three unknowns are the angles): :\frac=\frac, :\frac=\frac, :\alpha + \beta + \gamma = \pi. Then, by using the third equation of the system, we obtain a system of two equations in two variables: :\frac=\frac, :\frac=\frac, where we have used the trigonometric property that the sine of a supplementary angle is equal to the sine of the angle. Using the identity (see
Angle sum and difference identities In trigonometry, trigonometric identities are equalities that involve trigonometric functions and are true for every value of the occurring variables for which both sides of the equality are defined. Geometrically, these are identities involvin ...
) :\sin (\alpha + \gamma)=\sin \alpha \cos \gamma + \sin \gamma \cos \alpha leads to :c (\sin \alpha \cos \gamma + \sin \gamma \cos \alpha)=b \sin \gamma, :c \sin \alpha = a \sin \gamma. By dividing the whole system by , we have: :c (\sin \alpha + \tan \gamma \cos \alpha)=b \tan \gamma, :\frac = a \tan \gamma, :\frac= a^2 \tan^2 \gamma. Hence, from the first equation of the system, we can obtain :\frac=\tan \gamma By substituting this expression into the second equation and by using :1+\tan^2 \gamma=\frac we can obtain one equation with one variable: :c^2 \sin^2 \alpha \left + \frac \right= a^2 \cdot \frac By multiplying by , we can obtain the following equation: :(b- c \cos \alpha)^2 + c^2 \sin^2 \alpha=a^2. This implies :b^2 - 2bc\cos\alpha +c^2 \cos^2 \alpha +c^2\sin^2\alpha=a^2. Recalling the
Pythagorean identity The Pythagorean trigonometric identity, also called simply the Pythagorean identity, is an identity expressing the Pythagorean theorem in terms of trigonometric functions. Along with the sum-of-angles formulae, it is one of the basic relations be ...
, we obtain the law of cosines: :a^2=b^2+c^2-2bc\cos\alpha.


Using vectors

Denote :\overrightarrow=\vec, \ \overrightarrow=\vec, \ \overrightarrow=\vec Therefore, :\vec = \vec-\vec Taking the
dot product In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an algebra ...
of each side with itself: :\vec\cdot\vec = (\vec-\vec)\cdot(\vec-\vec) :\Vert\vec\Vert^2 = \Vert\vec\Vert^2 + \Vert\vec\Vert^2 - 2\,\vec\cdot\vec Using the identity (see
Dot product In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an algebra ...
) :\vec\cdot\vec = \Vert\vec\Vert\,\Vert\vec\Vert \cos\angle(\vec, \ \vec) leads to :\Vert\vec\Vert^2 = \Vert\vec\Vert^2 + ^2 - 2\,\Vert\vec\Vert\!\;\Vert\vec\Vert \cos\angle(\vec, \ \vec) The result follows.


Isosceles case

When , i.e., when the triangle is
isosceles In geometry, an isosceles triangle () is a triangle that has two sides of equal length. Sometimes it is specified as having ''exactly'' two sides of equal length, and sometimes as having ''at least'' two sides of equal length, the latter versio ...
with the two sides incident to the angle equal, the law of cosines simplifies significantly. Namely, because , the law of cosines becomes :\cos\gamma = 1 - \frac or :c^2 = 2a^2 (1 - \cos\gamma).


Analogue for tetrahedra

An analogous statement begins by taking , , , to be the areas of the four faces of a
tetrahedron In geometry, a tetrahedron (plural: tetrahedra or tetrahedrons), also known as a triangular pyramid, is a polyhedron composed of four triangular faces, six straight edges, and four vertex corners. The tetrahedron is the simplest of all the o ...
. Denote the
dihedral angle A dihedral angle is the angle between two intersecting planes or half-planes. In chemistry, it is the clockwise angle between half-planes through two sets of three atoms, having two atoms in common. In solid geometry, it is defined as the uni ...
s by \widehat etc. Then :\alpha^2 = \beta^2 + \gamma^2 + \delta^2 - 2\left beta\gamma\cos\left(\widehat\right) + \gamma\delta\cos\left(\widehat\right) + \delta\beta\cos\left(\widehat\right)\right


Version suited to small angles

When the angle, , is small and the adjacent sides, and , are of similar length, the right hand side of the standard form of the law of cosines is subject to catastrophic cancellation in numerical approximations. In situations where this is an important concern, a mathematically equivalent version of the law of cosines, similar to the
haversine formula The haversine formula determines the great-circle distance between two points on a sphere given their longitudes and latitudes. Important in navigation, it is a special case of a more general formula in spherical trigonometry, the law of haversines, ...
, can prove useful: : \begin c^2 &= (a - b)^2 + 4ab\sin^2\left(\frac\right) \\ & = (a - b)^2 + 4ab\operatorname(\gamma). \end In the limit of an infinitesimal angle, the law of cosines degenerates into the circular arc length formula, .


In spherical and hyperbolic geometry

Versions similar to the law of cosines for the Euclidean plane also hold on a unit sphere and in a hyperbolic plane. In spherical geometry, a triangle is defined by three points , , and on the unit sphere, and the arcs of
great circle In mathematics, a great circle or orthodrome is the circular intersection of a sphere and a plane passing through the sphere's center point. Any arc of a great circle is a geodesic of the sphere, so that great circles in spherical geomet ...
s connecting those points. If these great circles make angles , , and with opposite sides , , then the
spherical law of cosines In spherical trigonometry, the law of cosines (also called the cosine rule for sides) is a theorem relating the sides and angles of spherical triangles, analogous to the ordinary law of cosines from plane trigonometry. Given a unit sphere, a "sph ...
asserts that both of the following relationships hold: :\begin \cos a &= \cos b\cos c + \sin b\sin c\cos A\\ \cos A &= -\cos B\cos C + \sin B\sin C\cos a. \end In
hyperbolic geometry In mathematics, hyperbolic geometry (also called Lobachevskian geometry or Bolyai–Lobachevskian geometry) is a non-Euclidean geometry. The parallel postulate of Euclidean geometry is replaced with: :For any given line ''R'' and point ''P ...
, a pair of equations are collectively known as the
hyperbolic law of cosines In hyperbolic geometry, the "law of cosines" is a pair of theorems relating the sides and angles of triangles on a hyperbolic plane, analogous to the planar law of cosines from plane trigonometry, or the spherical law of cosines in spherical trigono ...
. The first is :\cosh a = \cosh b\cosh c - \sinh b \sinh c \cos A where and are the hyperbolic sine and cosine, and the second is :\cos A = -\cos B \cos C + \sin B\sin C\cosh a. As in Euclidean geometry, one can use the law of cosines to determine the angles , , from the knowledge of the sides , , . In contrast to Euclidean geometry, the reverse is also possible in both non-Euclidean models: the angles , , determine the sides , , .


Unified formula for surfaces of constant curvature

Defining two functions \cos_R and \sin_R as :\cos_R(x) = \cos(x/R)\quad and \quad\sin_R(x) = R\cdot\sin(x/R) allows to unify the formulae for
plane Plane(s) most often refers to: * Aero- or airplane, a powered, fixed-wing aircraft * Plane (geometry), a flat, 2-dimensional surface Plane or planes may also refer to: Biology * Plane (tree) or ''Platanus'', wetland native plant * ''Planes' ...
,
sphere A sphere () is a Geometry, geometrical object that is a solid geometry, three-dimensional analogue to a two-dimensional circle. A sphere is the Locus (mathematics), set of points that are all at the same distance from a given point in three ...
and
pseudosphere In geometry, a pseudosphere is a surface with constant negative Gaussian curvature. A pseudosphere of radius is a surface in \mathbb^3 having curvature in each point. Its name comes from the analogy with the sphere of radius , which is a surface ...
into: :\cos_R(BC) = \cos_R(AB)\cdot\cos_R(AC) + \frac\sin_R(AB)\cdot\sin_R(AC)\cdot\cos(\widehat). In this notation R is a
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the form ...
, representing the surface's
radius of curvature In differential geometry, the radius of curvature, , is the reciprocal of the curvature. For a curve, it equals the radius of the circular arc which best approximates the curve at that point. For surfaces, the radius of curvature is the radius o ...
. *For R \in \mathbb R the surface is a
sphere A sphere () is a Geometry, geometrical object that is a solid geometry, three-dimensional analogue to a two-dimensional circle. A sphere is the Locus (mathematics), set of points that are all at the same distance from a given point in three ...
of radius R, and its constant curvature equals 1/R^2; *for R = iR'\colon R' \in \mathbb R the surface is a
pseudosphere In geometry, a pseudosphere is a surface with constant negative Gaussian curvature. A pseudosphere of radius is a surface in \mathbb^3 having curvature in each point. Its name comes from the analogy with the sphere of radius , which is a surface ...
of (imaginary) radius R, with constant curvature *for R \to \infty : the surface tends to a Euclidean
plane Plane(s) most often refers to: * Aero- or airplane, a powered, fixed-wing aircraft * Plane (geometry), a flat, 2-dimensional surface Plane or planes may also refer to: Biology * Plane (tree) or ''Platanus'', wetland native plant * ''Planes' ...
, with constant zero curvature. Verifying the formula for non-Euclidean geometry In the first two cases, \cos_R and \sin_R are well-defined over the whole
complex plane In mathematics, the complex plane is the plane formed by the complex numbers, with a Cartesian coordinate system such that the -axis, called the real axis, is formed by the real numbers, and the -axis, called the imaginary axis, is formed by the ...
for all R \neq 0, and retrieving former results is straightforward. Hence, for a sphere of radius 1 : \cos(BC) = \cos(AB)\cdot\cos(AC) + \sin(AB)\cdot\sin(AC)\cdot\cos(\widehat). Likewise, for a pseudosphere of radius i :\cosh(BC) = \cosh(AB)\cdot\cosh(AC) - \sinh(AB)\cdot\sinh(AC)\cdot\cos(\widehat). Indeed, \cosh(x) = \cos(x/i) and \sinh(x) = i\cdot\sin(x/i). Verifying the formula in the limit of Euclidean geometry In the Euclidean plane the appropriate limits for the above equation must be calculated: :\cos_R(x) = \cos(x/R) = 1 - \frac\cdot \frac + o\left(\frac\right) and :\sin_R(x) = R\cdot\sin(x/R) = x + o\left(\frac\right). Applying this to the general formula for a finite R yields: :\begin 1 - \frac + o\left frac\right= & \left - \frac + o\left(\frac\right)\rightcdot\left - \frac + o\left(\frac\right)\right+\\ pt& + \frac\left B + o\left(\frac\right)\rightcdot\left C + o\left(\frac\right)\rightcdot\cos(\widehat) \end Collecting terms, multiplying with -2R^2, and taking R\to\infty yields the expected formula: :BC^2 = AB^2 + AC^2 - 2\cdot AB \cdot AC \cdot\cos(\widehat).


See also

*
Half-side formula In spherical trigonometry, the half side formula relates the angles and lengths of the sides of spherical triangles, which are triangles drawn on the surface of a sphere and so have curved sides and do not obey the formulas for plane triangles. Fo ...
*
Law of sines In trigonometry, the law of sines, sine law, sine formula, or sine rule is an equation relating the lengths of the sides of any triangle to the sines of its angles. According to the law, \frac \,=\, \frac \,=\, \frac \,=\, 2R, where , and a ...
*
Law of tangents In trigonometry, the law of tangents is a statement about the relationship between the tangents of two angles of a triangle and the lengths of the opposing sides. In Figure 1, , , and are the lengths of the three sides of the triangle, and , , ...
*
Law of cotangents In trigonometry, the law of cotangentsThe Universal Encyclopaedia of Mathematics, Pan Reference Books, 1976, page 530. English version George Allen and Unwin, 1964. Translated from the German version Meyers Rechenduden, 1960. is a relationship am ...
*
List of trigonometric identities In trigonometry, trigonometric identities are equalities that involve trigonometric functions and are true for every value of the occurring variables for which both sides of the equality are defined. Geometrically, these are identities involvin ...
*
Mollweide's formula In trigonometry, Mollweide's formula is a pair of relationships between sides and angles in a triangle. A variant in more geometrical style was first published by Isaac Newton in 1707 and then by in 1746. Thomas Simpson published the now-standar ...
*
Solution of triangles Solution of triangles ( la, solutio triangulorum) is the main trigonometric problem of finding the characteristics of a triangle (angles and lengths of sides), when some of these are known. The triangle can be located on a plane or on a sphere. Appl ...
*
Triangulation In trigonometry and geometry, triangulation is the process of determining the location of a point by forming triangles to the point from known points. Applications In surveying Specifically in surveying, triangulation involves only angle me ...


References


External links

*
Several derivations of the Cosine Law, including Euclid's
at
cut-the-knot Alexander Bogomolny (January 4, 1948 July 7, 2018) was a Soviet-born Israeli-American mathematician. He was Professor Emeritus of Mathematics at the University of Iowa, and formerly research fellow at the Moscow Institute of Electronics and Math ...

Interactive applet of Law of Cosines
{{DEFAULTSORT:Law Of Cosines Trigonometry Angle Articles containing proofs Theorems about triangles