Law Of Cosines Article Index for
Law Of
Articles about
Law Of Cosines
Website Links For
Law
 

Information About

Law Of Cosines




This article is about the law of cosines in Euclidean geometry. For the cosine law of optics, see Lambert's Cosine Law .

In Trigonometry , the law of cosines (also known as the '''cosine formula''') is a statement about a general Triangle which relates the lengths of its sides to the Cosine of one of its Angles . Using notation as in Fig. 1, the law of cosines states that

: c^2 = a^2 + b^2 - 2ab \cos \gamma . \;

Note that ''c'' is the side opposite the angle ''γ'' and ''a'', ''b'' are the two sides enclosing ''γ''.

The law of cosines generalizes the Pythagorean Theorem , which holds only in Right Triangles . For, if the angle ''γ'' is a right angle, its cosine is 0, and so the the law of cosines reduces to

: c^2 = a^2 + b^2 , \;

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.

For the corresponding theorem in Spherical Geometry , see Law Of Cosines (spherical) .


HISTORY


Already Euclid 's Elements , dating to the 3rd Century BC , contain 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.


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 CH = ''a'' cos( π–γ) = – ''a'' cos γ

Proposition 13 contains an entirely analogous statement for acute triangles.

It was not until the development of modern trigonomotry in the .

The theorem was popularised in the Occident by François Viète , 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 Triangulation , for solving a triangle, i.e., to find (see Figure 3)

  • the third side of a triangle if one knows an angle and its adjacent sides:

  • ::\,c = \sqrt{a^2+b^2-2ab\cos\gamma};

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

  • ::\,\gamma = \arccos rac{a^2+b^2-c^2}{2ab}.


These formulas produce high Round-off Errors in Floating Point calculations if the triangle is very acute, i.e., if ''c'' is small relative to ''a'' and ''b'' or γ is small compared to 1.




PROOFS



Using trigonometry


Drop the Perpendicular onto the side ''c'' to get (see Fig. 4)

:c=a\cos\beta+b\cos\alpha\,.

(This is still true if α or β is obtuse, and so the perpendicular falls outside the triangle.) Multiply through by ''c'' to get

:c^2=ac\cos\beta+bc\cos\alpha\,.

By considering the other perpendiculars obtain

:a^2=ac\cos\beta+ab\cos\gamma\,,

:b^2=bc\cos\alpha+ab\cos\gamma\,.

Adding the latter two equations gives the law of cosines

:a^2 + b^2 = c^2 + 2ab\cos\gamma\,.

This proof uses Trigonometry 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 a\cos\gamma mereley 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. Euclid proves this theorem by applying the Pythagorean Theorem to each of the two right triangles in Fig. 4. Using d to denote the line segment CH and h for the height BH, triangle AHB gives us

: (b+d)^2+h^2=c^2,

and triangle CHB gives us

: d^2+h^2=a^2.

The Binomial Theorem then implies

: c^2=a^2+b^2+2bd.

This is Euclid's Proposition 12 from Book 2 of the Elements . 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 procedes 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 Pythatorean theorem only ''once''. In fact, by using the right triangle on the left hand side of Fig. 5 it can be shown that:

upon using the trigonometric identity

: \cos^2\gamma+\sin^2\gamma=1. \,

Remark. This proof needs a slight modification if b. 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\gamma is replaced by a\cos\gamma-b. As this quantity enters the calculation only through its square, the rest of the proof is unaffected.


By comparing areas


One can also prove the law of cosines by calculating Areas . The change of sign as the angle \gamma becomes obtuse, makes a case distinction necessary.

Recall that
  • a^2, b^2 et c^2 are the areas of the squares with sides a, b and c, respectively;

  • if \gamma is acute, ab\cos\gamma is the area of the Parallelogram with sides a and b forming an angle of \pi/2-\gamma;

  • if \gamma is obtuse, and so \cos\gamma is negative, -ab\cos\gamma is the area of the Parallelogram with sides a and b forming an angle of \gamma-\pi/2.



Acute case. Figure 6a shows a Heptagon 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 a^2, b^2 on the left and the areas 2ab \cos\gamma and c^2 on the right;

  • in blue, the triangle ABC, on the left and on the right;

  • en grey, auxiliary triangles, all Congruent 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

:\,a^2+b^2 = c^2+2ab \cos\gamma.




Obtuse case. Figure 6b cuts a Hexagon in two different ways into smaller pieces, yielding a proof of the law of cosines in the case that the angle \gamma is obtuse. We have
  • in pink, the areas a^2, b^2 and -2ab \cos\gamma on the left and c^2 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

:\,a^2+b^2-2ab\cos\gamma = c^2.

The rigorous proof will have to include proofs that various shapes are Congruent and therefore have equal area. This will use the theory of Congruent Triangles .




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 alone. Algebraic manipulations (in particular the Binomial Theorem ) are avoided.

Case of acute angle γ, where ''a'' > 2 ''b'' cos γ. Drop the ), so the yellow triangle in Figure 7 is right. Apply the Pythagorean Theorem to obtain

:c^2 = b^2 + h^2\,.

Now use the of the circle through B. In the present case: BH&2 = BC BP, or

:h^2 = a ( a - 2 b \cos \gamma )\,.

Substuting into the previous equation gives the law of cosines:

:c^2 = b^2 + a ( a - 2 b \cos \gamma ) \,.

Note that h^2 is the Power 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 Perpendicular from A onto ''a'' = BC, creating a line segment of length ''b'' cos γ. Duplicate the Right Triangle to form the Isosceles Triangle ACP. Construct the Circle with center A and radius ''b'', and a Chord through B perpendicular to ''c'' = AB, half of which is ''h'' = BH. Apply the Pythagorean Theorem to obtain

:b^2 = c^2 + h^2\,.

Now use the ''cord Theorem'' (Euclid's Elements: Book 3, Proposition 35), which says that if two cords intersect, the product of the two line segments obtained on one cord is equal to the product of the two line segments obtained on the other chord. In the present case: BH&2 = BC BP, or

:h^2 = a ( 2 b \cos \gamma - a)\,.

Substuting into the previous equation gives the law of cosines:

:b^2 = c^2 + a ( 2 b \cos \gamma - a ) \,.

Note that the power of the point B with respect to the circle has the negative value -h^2.



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 8), which intersects the Secant through A and C in C and K. The Power of the point A with respect to the circle is equal to both AB&2 - BC&2 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
: ec b\cdot ec c = \Vert ec b\Vert\Vert ec c\Vert\cos heta
in the theory of Vectors , which expresses the Dot Product of two vectors in terms of their respective Lengths and the Angle they enclose.

Proof of equivalence. Referring to Figure 9, note that
: ec a= ec b- ec c\,,
and so we may calculate:

The law of cosines formulated in this context states:
:\Vert ec a\Vert^2=\Vert ec b \Vert^2 + \Vert ec c \Vert^2 - 2 \Vert ec b\Vert\Vert ec c\Vert\cos heta \,,
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 Isosceles with the two sides incident to the angle \gamma equal, the law of cosines simplifies significantly. Namely, because a^2 + b^2 = 2 a^2 = 2 a b, the law of cosines becomes

: \cos \gamma = 1 - rac{c^2}{2 a^2}. \;


SEE ALSO




EXTERNAL LINKS