All Topics  
Law of cosines

 

 

 

 

 

Law of cosines


 
 



This article is about the law of cosines in Euclidean geometry. For the corresponding theorem in spherical geometrySpherical geometry Overview

Spherical geometry is the geometry of the two-dimensional surface of a sphere....
, see law of cosines (spherical)Law of cosines (spherical)

In spherical trigonometry, the law of cosines refers to a theorem relating the sides and angles of spherical triangles, anal...
. For the cosine law of optics, see Lambert's cosine lawLambert's cosine law

Lambert's cosine law says that the total radiant power observed from a "Lambertian" surface is directly proportional t...
.


In trigonometryTrigonometry

Trigonometry is a branch of mathematics dealing with angles, triangles and trigonometric functions such as sine...
, the law of cosines (also known as Al-KashiJamshid al-Kashi

' was a Persian astronomer and mathematician....
 law
or the cosine formula or cosine rule) is a statement about a general triangleTriangle

A triangle is one of the basic shapes of geometry: a polygon with three vertices and three sides which are straight line seg...
 which relates the lengths of its sides to the cosine of one of its angleAngle

An angle is the figure formed by two rays sharing a common endpoint, called the vertex of the angle....
s. Using notation as in Fig. 1, the law of cosines states that




or, equivalently:




Note that c is the side opposite of angle ?, and that a and b are the two sides enclosing ?. All three of the identities above say the same thing; they are listed separately only because in solving triangles with three given sides one may apply the identity three times with the roles of the three sides permuted.

The law of cosines generalizes the Pythagorean theoremFacts About Pythagorean theorem

In mathematics, the Pythagorean theorem or Pythagoras' theorem is a relation in Euclidean geometry among the three sid...
, which holds only in right triangles: if the angle ? is a right angle (of measure 90°Degree (angle)

A degree, usually symbolized ', is a measurement of plane angle, representing 1/360 of a full rotation....
 or radians), then , and thus the law of cosines reduces to




which is the Pythagorean theorem.

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.

History



EuclidEuclid Overview

Euclid , a Greek mathematician, who lived in Alexandria, Hellenistic Egypt, almost certainly during the reign of Ptolemy I...
's ElementsEuclid's Elements

Euclid's Elements is a mathematical and geometric treatise, consisting of 13 books, written by the Hellenistic mathemat...
, dating back to the 3rd century BC, contains a version of the law of cosines. The case of obtuse triangle and acute triangle (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:

Proposition 12
In obtuse-angled triangles the square on the side subtending the obtuse angle is greater than the squares on the sides containing the obtuse angle by twice the rectangle contained by one of the sides about the obtuse angle, namely that on which the perpendicular falls, and the straight line cut off outside by the perpendicular towards the obtuse angle. --- Euclid's Elements, translation by Thomas L. Heath.


Using notation as in Fig. 2, Euclid's statement can be represented by the formula




This formula may be transformed into the law of cosines by noting that CH = a cos(p – ?) = −a cos(?).

Proposition 13 contains an entirely analogous statement for acute triangles.

It was not until the development of modern trigonometry in the Middle AgesMiddle Ages

The Middle Ages formed the middle period in a traditional schematic division of European history into three "ages": the clas...
 by Muslim mathematiciansIslamic mathematics

In the history of mathematics, "Islamic mathematics" refers to the mathematics developed by mathematicians of the Islamic cu...
 that the law of cosines evolved beyond Euclid's two theorems. The astronomerAstronomer

An astronomer or astrophysicist is a person whose area of interest is astronomy or astrophysics....
 and mathematicianMathematician

A mathematician is a person whose primary area of study and research is the field of mathematics....
 al-BattaniAl-Battani

Abu ?Abdullah Mu?ammad ibn Jabir ibn Sinan ar-Raqqi al-?arrani a?-?abi? al-Battani was an Arab astronomer/astrologer and mat...
 generalized Euclid's result to spherical geometrySpherical geometry

Spherical geometry is the geometry of the two-dimensional surface of a sphere....
 at the beginning of the 10th century, which permitted him to calculate the angular distances between stars. During the 15th century, al-Kashi in Samarcand computed trigonometric tables to great accuracy and put the theorem into a form suitable for triangulationTriangulation

In trigonometry and elementary geometry, triangulation is the process of finding coordinates and distance to a point by calc...
. In FranceFrance

France, officially the French Republic, is a country whose metropolitan territory is located in Western Europe and whi...
, the law of cosines is still referred to as the .

The theorem was popularised in the Western worldWestern world

The term Western World or "the West" can have multiple meanings depending on its context....
 by François VièteFrançois Viète

Franois Vite, seigneur de la Bigotire, generally known as Franciscus Vieta, was a French mathematician....
, who apparently discovered it independently. At the beginning of the 19th century modern algebraic notation allowed the law of cosines to be written in its current form.

Applications



The theorem is used in triangulationTriangulation Summary

In trigonometry and elementary geometry, triangulation is the process of finding coordinates and distance to a point by calc...
, for solving a triangle, i.e., to find (see Figure 3)

  • the third side of a triangle if one knows two sides and the angle between them:



  • the angles of a triangle if one knows the three sides:



  • the third side of a triangle if one knows two sides and an angle opposite to one of them (you may also use the Pythagorean Theorem to do this):




These formulas produce high round-off errorRound-off error

A round-off error, also called rounding error, is the difference between the calculated approximation of a number and ...
s in floating pointFloating point

Floating-point is a means of representing real numbers in terms of digits or bits in a computer or calculator, similar to ho...
 calculations if the triangle is very acute, i.e., if c is small relative to a and b or ? is small compared to 1.

The third formula shown is the result of solving for a the quadratic equationFacts About Quadratic equation

In mathematics, a quadratic equation is a polynomial equation of the second degree....
 a2 − 2ab cos ? + b2 − c2 = 0. 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 b sin(C) < c < b, only one positive solution if c > b or c = b sin(C), and no solution if c < b sin(C). These different cases are also explained by the Side-Side-Angle congruenceCongruence (geometry)

In geometry, two sets are called congruent if one can be transformed into the other by an isometry, i.e., a combination of ...
 ambiguity.


Proofs


Using the distance formula

Consider a triangle with sides of length a, b, c, where is the measurement of the angle opposite the side of length c. We can place this triangle on the coordinate system by plotting By the distance formula, we have . Now, we just work with this equation:




An advantage of this proof is that it does not require the consideration of different cases for when the triangle is acute vs. obtuse.

Using trigonometry



Drop the perpendicularPerpendicular

In geometry, two lines are considered perpendicular if one falls on the other in such a way as to create two equal angles....
 onto the side c to get (see Fig. 4)

(This is still true if a or ß is obtuse, in which case the perpendicular falls outside the triangle.) Multiply through by c to get

By considering the other perpendiculars obtain

Adding the latter two equations gives

Rearrange to get
Substitute this in the first equation for to yield the law of cosines

This proof uses trigonometryTrigonometry Summary

Trigonometry is a branch of mathematics dealing with angles, triangles and trigonometric functions such as sine...
 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 case of obtuse and acute angle ? separately.

Using the Pythagorean theorem



Case of an obtuse angle. EuclidEuclid

Euclid , a Greek mathematician, who lived in Alexandria, Hellenistic Egypt, almost certainly during the reign of Ptolemy I...
 proves this theorem by applying the Pythagorean theoremPythagorean theorem

In mathematics, the Pythagorean theorem or Pythagoras' theorem is a relation in Euclidean geometry among the three sid...
 to each of the two right triangles in Fig. 5. Using d to denote the line segment CH and h for the height BH, triangle AHB gives us




and triangle CHB gives us




ExpandingPolynomial expansion

In mathematics, an expansion of a product of sums expresses it as a sum of products by using the fact that multiplication di...
 the first equation gives us




Substituting the second equation into this, the following can be obtained




This is Euclid's Proposition 12 from Book 2 of the ElementsEuclid's Elements

Euclid's Elements is a mathematical and geometric treatise, consisting of 13 books, written by the Hellenistic mathemat...
. To transform it into the modern form of the law of cosines, note that

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 binomial theorem to simplify.


Another proof in the acute case. Using a little more trigonometry, the law of cosines by applying 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:




upon using the trigonometric identity




Remark. This proof needs a slight modification if b < a cos(?). In this case, the right triangle to which the Pythagorean theorem is applied moves outside the triangle ABC. The only effect this has on the calculation is that the quantity b − a cos(?) is replaced by a cos(?) − b. As this quantity enters the calculation only through its square, the rest of the proof is unaffected.
Note. This problem only occurs when ß is obtuse, and may be avoided by reflecting the triangle about the bisector of ?.

Observation. Referring to Fig 6 it's worth noting that if the angle opposite side a is then:




This is useful for direct calculation of a second angle when two sides and an included angle are given.

Using Ptolemy's theoremPtolemy's theorem Overview

In mathematics, Ptolemy's theorem is a relation in Euclidean geometry between the four sides and two diagonals or chords of ...

Referring to the diagram, triangle ABC with sides AB = c, BC = a and AC = b is drawn inside its circumcircle as shown. Triangle ABD is constructed congruent to triangle ABC with AD = BC and BD = AC. Perpendiculars from D and C meet base AB at E and F respectively. Then:




Now the law of cosines is rendered by a straightforward application of Ptolemy's theorem to cyclic quadrilateralCyclic quadrilateral

External links* of Euclid's Elements* by Antonio Gutierrez from "Geometry Step by Step from the Land of the Incas"....
 ABCD:




Plainly if angle B is 90 degrees, then ABCD is a rectangle and application of Ptolemy's theorem yields Pythagoras' theorem:



By comparing areas


One can also prove the law of cosines by calculating areaArea

Area is a physical quantity expressing the size of a part of a surface....
s. The change of sign as the angle becomes obtuse, makes a case distinction necessary.

Recall that
  • a2, b2, and c2 are the areas of the squares with sides a, b, and c, respectively;
  • if ? is acute, then ab cos(?) is the area of the parallelogramParallelogram

    A parallelogram is a four-sided plane figure that has two sets of opposite parallel sides....
     with sides a and b forming an angle of ;
  • if ? is obtuse, and so cos(?) is negative, then −ab cos(?) is the area of the parallelogramParallelogram

    A parallelogram is a four-sided plane figure that has two sets of opposite parallel sides....
     with sides a' and b forming an angle of .



Acute case. Figure 7a shows a heptagonHeptagon

In geometry, a heptagon is a polygon with seven sides and seven angles....
 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 a2, b2 on the left and the areas 2ab cos(?) and c2 on the right;
  • in blue, the triangle ABC, on the left and on the right;
  • in grey, auxiliary triangles, all congruentCongruence (geometry)

    In geometry, two sets are called congruent if one can be transformed into the other by an isometry, i.e., a combination of ...
     to ABC, 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





Obtuse case. Figure 7b cuts a hexagonHexagon

In geometry, a hexagon is a polygon with six edges and six vertices....
 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 a2, b2, and −2ab cos(?) on the left and c2 on the right;
  • in blue, the triangle ABC twice, on the left, as well as on the right.


The equality of areas on the left and on the right gives

The rigorous proof will have to include proofs that various shapes are congruentCongruence (geometry)

In geometry, two sets are called congruent if one can be transformed into the other by an isometry, i.e., a combination of ...
 and therefore have equal area. This will use the theory of congruent trianglesCongruence (geometry)

In geometry, two sets are called congruent if one can be transformed into the other by an isometry, i.e., a combination of ...
.


Using geometry of the circle


Using the geometry of the circleCircle

In Euclidean geometry, a circle is the set of all points in a plane at a fixed distance, called the radius, from a fixed poi...
 it is possible to give a more geometricGeometry

Geometry arose as the field of knowledge dealing with spatial relationships....
 proof than using the Pythagorean theoremPythagorean theorem

In mathematics, the Pythagorean theorem or Pythagoras' theorem is a relation in Euclidean geometry among the three sid...
 alone. AlgebraicElementary algebra

Elementary algebra is a fundamental and relatively basic form of algebra taught to students who are presumed to have little ...
 manipulations (in particular the binomial theoremBinomial theorem

In mathematics, the binomial theorem is an important formula giving the expansion of powers of sums....
) are avoided.


Case of acute angle ?, where a > 2 b cos(?). Drop the perpendicularPerpendicular

In geometry, two lines are considered perpendicular if one falls on the other in such a way as to create two equal angles....
 from A onto a = BC, creating a line segment of length b cos(?). Duplicate the right triangleFacts About Triangle

A triangle is one of the basic shapes of geometry: a polygon with three vertices and three sides which are straight line seg...
 to form the isosceles triangleTriangle Summary

A triangle is one of the basic shapes of geometry: a polygon with three vertices and three sides which are straight line seg...
 ACP. Construct the circleCircle

In Euclidean geometry, a circle is the set of all points in a plane at a fixed distance, called the radius, from a fixed poi...
 with center A and radius b, and its tangent h = BH through B. The tangent h forms a right angle with the radius b (Euclid's Elements: Book 3, Proposition 18; or see hereCircle Overview

In Euclidean geometry, a circle is the set of all points in a plane at a fixed distance, called the radius, from a fixed poi...
), so the yellow triangle in Figure 8 is right. Apply the Pythagorean theoremPythagorean theorem

In mathematics, the Pythagorean theorem or Pythagoras' theorem is a relation in Euclidean geometry among the three sid...
 to obtain

Then use the tangent secant theoremCircle

In Euclidean geometry, a circle is the set of all points in a plane at a fixed distance, called the radius, from a fixed poi...
 (Euclid's Elements: Book 3, Proposition 36), which says that the square on the tangent through a point B outside the circle is equal to the product of the two lines segments (from B) created by any secantSecant line

A secant line of a curve is a line that intersects two or more points on the curve....
 of the circle through B. In the present case: BH2 = BC BP, or

Substuting into the previous equation gives the law of cosines:

Note that h2 is the powerPower of a point

The power of a point A with respect to a circle with center 0 and radius r is defined as...
 of the point B 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.




Case of acute angle ?, where a < 2 b cos ?. Drop the perpendicularPerpendicular

In geometry, two lines are considered perpendicular if one falls on the other in such a way as to create two equal angles....
 from A onto a = BC, creating a line segment of length b cos(?). Duplicate the right triangleTriangle

A triangle is one of the basic shapes of geometry: a polygon with three vertices and three sides which are straight line seg...
 to form the isosceles triangleFacts About Triangle

A triangle is one of the basic shapes of geometry: a polygon with three vertices and three sides which are straight line seg...
 ACP. Construct the circleCircle

In Euclidean geometry, a circle is the set of all points in a plane at a fixed distance, called the radius, from a fixed poi...
 with center A and radius b, and a chordChord (geometry)

A chord of a curve is a geometric line segment whose endpoints both lie on the curve....
 through B perpendicular to c = AB, half of which is h = BH. Apply the Pythagorean theoremPythagorean theorem

In mathematics, the Pythagorean theorem or Pythagoras' theorem is a relation in Euclidean geometry among the three sid...
 to obtain

Now use the chord theoremCircle

In Euclidean geometry, a circle is the set of all points in a plane at a fixed distance, called the radius, from a fixed poi...
 (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: BH2 = BC BP, or

Substuting into the previous equation gives the law of cosines:

Note that the power of the point B with respect to the circle has the negative value −h2.




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 B and radius a (see Figure 9), which intersects the secantSecant line

A secant line of a curve is a line that intersects two or more points on the curve....
 through A and C in C and K. The powerPower of a point

The power of a point A with respect to a circle with center 0 and radius r is defined as...
 of the point A with respect to the circle is equal to both AB2 − BC2 and AC·AK. Therefore,




which is the law of cosines.

Using algebraic measures for line segments (allowing negative numbers as lengths of segments) the case of obtuse angle (CK > 0) and acute angle (CK < 0) can be treated simultaneously.


Vector formulation


The law of cosines is equivalent to the formula
in the theory of vectorsVector (spatial)

In physics and in vector calculus, a spatial vector, or simply vector, is a concept characterized by a magnitude and a...
, which expresses the dot productDot product

In mathematics, the dot product, also known as the scalar product, is a binary operation which takes two vectors over ...
 of two vectors in terms of their respective lengthsVector (spatial)

In physics and in vector calculus, a spatial vector, or simply vector, is a concept characterized by a magnitude and a...
 and the angleAngle

An angle is the figure formed by two rays sharing a common endpoint, called the vertex of the angle....
 they enclose.

Proof of equivalence. Referring to Figure 10, note that


and so we may calculate:
 
   



The law of cosines formulated in this context states:
which is now visibly equivalent to the above formula from the theory of vectors.


Isosceles case


When a = b, i.e., when the triangle is isoscelesTriangle

A triangle is one of the basic shapes of geometry: a polygon with three vertices and three sides which are straight line seg...
 with the two sides incident to the angle ? equal, the law of cosines simplifies significantly. Namely, because a2 + b2 = 2a2 = 2ab, the law of cosines becomes



Analog for tetrahedra


An analogous statement begins by taking to be the areas of the four faces of a tetrahedronTetrahedron

A tetrahedron is a polyhedron composed of four triangular faces, three of which meet at each vertex....
. Denote the dihedral angleDihedral angle

In geometry, the angle between two planes is called their dihedral angle....
s by etc. Then

See also


  • TriangulationTriangulation Overview

    In trigonometry and elementary geometry, triangulation is the process of finding coordinates and distance to a point by calc...
  • Law of sinesLaw of sines

    In trigonometry, the law of sines is a statement about arbitrary triangles in the plane....
  • Law of tangentsLaw of tangents

    In trigonometry, the law of tangents is a statement about arbitrary triangles in the plane....
  • Law of cosines (spherical)Law of cosines (spherical)

    In spherical trigonometry, the law of cosines refers to a theorem relating the sides and angles of spherical triangles, anal...


External links

  • From PlainMath.Net
  • at cut-the-knotCut-the-knot

    cut-the-knot is an educational website maintained by Alexander Bogomolny and devoted to popular exposition of a great variet...