Law of cosines

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Template:Short description Script error: No such module "about".

File:Triangle with notations 2.svg
Fig. 1 – A triangle. The angles αScript error: No such module "Check for unknown parameters". (or AScript error: No such module "Check for unknown parameters".), βScript error: No such module "Check for unknown parameters". (or BScript error: No such module "Check for unknown parameters".), and γScript error: No such module "Check for unknown parameters". (or CScript error: No such module "Check for unknown parameters".) are respectively opposite the sides aScript error: No such module "Check for unknown parameters"., bScript error: No such module "Check for unknown parameters"., and cScript error: No such module "Check for unknown parameters"..

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. For a triangle with sides Template:Tmath, Template:Tmath, and Template:Tmath, opposite respective angles Template:Tmath, Template:Tmath, and Template:Tmath (see Fig. 1), the law of cosines states:

c2=a2+b22abcosγ,a2=b2+c22bccosα,b2=a2+c22accosβ.

The law of cosines generalizes the Pythagorean theorem, which holds only for right triangles: if Template:Tmath is a right angle then Template:Tmath, and the law of cosines reduces to Template:Tmath.

The law of cosines is useful for solving a triangle when all three sides or two sides and their included angle are given.

Use in solving triangles

File:Triangle-with-an-unknown-angle-or-side.svg
Fig. 3 – Applications of the law of cosines: unknown side and unknown angle.
File:SSA triangle ambiguity.png
Given triangle sides Template:Mvar and Template:Mvar and angle Template:Mvar there are sometimes two solutions for Template:Mvar.

The theorem is used in solution of triangles, i.e., to find (see Figure 3):

  • the third side of a triangle if two sides and the angle between them is known: c=a2+b22abcosγ;
  • the angles of a triangle if the three sides are known: γ=arccos(a2+b2c22ab);
  • the third side of a triangle if two sides and an angle opposite to one of them is known (this side can also be found by two applications of the law of sines):Template:Efn a=bcosγ±c2b2sin2γ.

These formulas produce high round-off errors in floating point calculations if the triangle is very acute, i.e., if cScript error: No such module "Check for unknown parameters". is small relative to aScript error: No such module "Check for unknown parameters". and bScript error: No such module "Check for unknown parameters". or γScript error: No such module "Check for unknown parameters". 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 a2 − 2ab cos γ + b2c2 = 0Script error: No such module "Check for unknown parameters".. 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 < bScript error: No such module "Check for unknown parameters"., only one positive solution if c = b sin γScript error: No such module "Check for unknown parameters"., and no solution if c < b sin γScript error: No such module "Check for unknown parameters".. These different cases are also explained by the side-side-angle congruence ambiguity.

History

Book II of Euclid's Elements, compiled c. 300 BC from material up to a century or two older, contains a geometric theorem corresponding to the law of cosines but expressed in the contemporary language of rectangle areas; Hellenistic trigonometry developed later, and sine and cosine per se first appeared centuries afterward in India.

The cases of obtuse triangles and acute triangles (corresponding to the two cases of negative or positive cosine) are treated separately, in Propositions II.12 and II.13:[1]

Template:Quote

Proposition 13 contains an analogous statement for acute triangles. In his (now-lost and only preserved through fragmentary quotations) commentary, Heron of Alexandria provided proofs of the converses of both II.12 and II.13.[2]

File:Obtuse Triangle With Altitude ZP2.svg
Fig. 2 – Obtuse triangle ABCScript error: No such module "Check for unknown parameters". with perpendicular BHScript error: No such module "Check for unknown parameters".

Using notation as in Fig. 2, Euclid's statement of proposition II.12 can be represented more concisely (though anachronistically) by the formula

AB2=CA2+CB2+2(CA)(CH).

To transform this into the familiar expression for the law of cosines, substitute Template:Tmath, Template:Tmath, Template:Tmath, and CH=acos(πγ) =acosγ.

Proposition II.13 was not used in Euclid's time for the solution of triangles, but later it was used that way in the course of solving astronomical problems by al-Bīrūnī (11th century) and Johannes de Muris (14th century).[3] Something equivalent to the spherical law of cosines was used (but not stated in general) by al-Khwārizmī (9th century), al-Battānī (9th century), and Nīlakaṇṭha (15th century).[4]

The 13th century Persian mathematician Naṣīr al-Dīn al-Ṭūsī, in his Script error: No such module "Lang". (Book on the Complete Quadrilateral, c. 1250), systematically described how to solve triangles from various combinations of given data. Given two sides and their included angle in a scalene triangle, he proposed finding the third side by dropping a perpendicular from the vertex of one of the unknown angles to the opposite base, reducing the problem to finding the legs of one right triangle from a known angle and hypotenuse using the law of sines and then finding the hypotenuse of another right triangle from two known sides by the Pythagorean theorem.[5]

About two centuries later, another Persian mathematician, Jamshīd al-Kāshī, who computed the most accurate trigonometric tables of his era, also described the solution of triangles from various combinations of given data in his Script error: No such module "Lang". (Key of Arithmetic, 1427), and repeated essentially al-Ṭūsī's method, now consolidated into one formula and including more explicit details, as follows:[6]

File:Law of cosines following al-Kashi.png
Al-Kashi's version of the law of cosines (case where Template:Mvar is obtuse), expressed with modern algebraic notation.

Template:Quote

Using modern algebraic notation and conventions this might be written

c=(bacosγ)2+(asinγ)2

when Template:Tmath is acute or

c=(b+a|cosγ|)2+(asinγ)2

when Template:Tmath is obtuse. (When Template:Tmath is obtuse, the modern convention is that Template:Tmath is negative and cos(πγ)=cosγ is positive; historically sines and cosines were considered to be line segments with non-negative lengths.) By squaring both sides, expanding the squared binomial, and then applying the Pythagorean trigonometric identity Template:Tmath, we obtain the familiar law of cosines:

c2=b22bacosγ+a2cos2γ+a2sin2γ=a2+b22abcosγ.

In France, the law of cosines is sometimes referred to as the théorème d'Al-Kashi.[7][8]

The same method used by al-Ṭūsī appeared in Europe as early as the 15th century, in Regiomontanus's De triangulis omnimodis (On Triangles of All Kinds, 1464), a comprehensive survey of plane and spherical trigonometry known at the time.[9]

The theorem was first written using algebraic notation by François Viète 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.[10]

Proofs

Using the Pythagorean theorem

File:Law of cosines in plane trigonometry.svg
Proof for the Law of cosines in acute and obtuse triangles using the Pythagorean theorem
File:Obtuse Triangle With Altitude ZP.svg
Obtuse triangle ABCScript error: No such module "Check for unknown parameters". with height BHScript error: No such module "Check for unknown parameters".

Case of an obtuse angle

Euclid proved this theorem by applying the Pythagorean theorem to each of the two right triangles in Fig. 2 (AHBScript error: No such module "Check for unknown parameters". and CHBScript error: No such module "Check for unknown parameters".). Using aScript error: No such module "Check for unknown parameters". to denote the line segment CBScript error: No such module "Check for unknown parameters"., bScript error: No such module "Check for unknown parameters". to denote the line segment ACScript error: No such module "Check for unknown parameters"., cScript error: No such module "Check for unknown parameters". to denote the line segment ABScript error: No such module "Check for unknown parameters"., dScript error: No such module "Check for unknown parameters". to denote the line segment CHScript error: No such module "Check for unknown parameters". and hScript error: No such module "Check for unknown parameters". for the height BHScript error: No such module "Check for unknown parameters"., triangle AHBScript error: No such module "Check for unknown parameters". gives us c2=(b+d)2+h2,

and triangle CHBScript error: No such module "Check for unknown parameters". gives d2+h2=a2.

Expanding the first equation gives c2=b2+2bd+d2+h2.

Substituting the second equation into this, the following can be obtained: c2=a2+b2+2bd.

This is Euclid's Proposition 12 from Book 2 of the Elements.[11] To transform it into the modern form of the law of cosines, note that d=acos(πγ)=acosγ.

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 γScript error: No such module "Check for unknown parameters". and uses the square of a difference to simplify.

Another proof in the acute case

File:Triangle with trigonometric proof of the law of cosines.svg
Fig. 6 – A short proof using trigonometry for the case of an acute angle

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:

c2=(bacosγ)2+(asinγ)2=b22abcosγ+a2cos2γ+a2sin2γ=b2+a22abcosγ,

using the trigonometric identity Template:Tmath.

This proof needs a slight modification if b < a cos(γ)Script error: No such module "Check for unknown parameters".. In this case, the right triangle to which the Pythagorean theorem is applied moves outside the triangle ABCScript error: No such module "Check for unknown parameters".. The only effect this has on the calculation is that the quantity ba cos(γ)Script error: No such module "Check for unknown parameters". is replaced by a cos(γ) − b.Script error: No such module "Check for unknown parameters". As this quantity enters the calculation only through its square, the rest of the proof is unaffected. However, this problem only occurs when βScript error: No such module "Check for unknown parameters". is obtuse, and may be avoided by reflecting the triangle about the bisector of γScript error: No such module "Check for unknown parameters"..

Referring to Fig. 6 it is worth noting that if the angle opposite side aScript error: No such module "Check for unknown parameters". is αScript error: No such module "Check for unknown parameters". then: tanα=asinγbacosγ.

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

From three altitudes

File:Triangle-with-cosines.svg
Fig. 5 – An acute triangle with perpendicular

The altitude through vertex Template:Mvar is a segment perpendicular to side Template:Mvar. The distance from the foot of the altitude to vertex Template:Mvar plus the distance from the foot of the altitude to vertex Template:Mvar is equal to the length of side Template:Mvar (see Fig. 5). Each of these distances can be written as one of the other sides multiplied by the cosine of the adjacent angle,[12] c=acosβ+bcosα.

(This is still true if αScript error: No such module "Check for unknown parameters". or βScript error: No such module "Check for unknown parameters". is obtuse, in which case the perpendicular falls outside the triangle.) Multiplying both sides by cScript error: No such module "Check for unknown parameters". yields c2=accosβ+bccosα.

The same steps work just as well when treating either of the other sides as the base of the triangle: a2=accosβ+abcosγ,b2=bccosα+abcosγ.

Taking the equation for Template:Tmath and subtracting the equations for Template:Tmath and Template:Tmath, c2a2b2=accosβ+bccosαaccosβbccosα2abcosγc2=a2+b22abcosγ.

This proof is independent of the Pythagorean theorem, insofar as it is based only on the right-triangle definition of cosine and obtains squared side lengths algebraically. Other proofs typically invoke the Pythagorean theorem explicitly, and are more geometric, treating a cos γScript error: No such module "Check for unknown parameters". as a label for the length of a certain line segment.[12]

Unlike many proofs, this one handles the cases of obtuse and acute angles γScript error: No such module "Check for unknown parameters". in a unified fashion.

Cartesian coordinates

File:Triangle-law-of-cosines-proof.png
Fig. 4 – Coordinate geometry proof

Consider a triangle with sides of length aScript error: No such module "Check for unknown parameters"., bScript error: No such module "Check for unknown parameters"., cScript error: No such module "Check for unknown parameters"., where θScript error: No such module "Check for unknown parameters". is the measurement of the angle opposite the side of length cScript error: No such module "Check for unknown parameters".. This triangle can be placed on the Cartesian coordinate system with side aScript error: No such module "Check for unknown parameters". aligned along the x axis and angle θScript error: No such module "Check for unknown parameters". placed at the origin, by plotting the components of the 3 points of the triangle as shown in Fig. 4: A=(bcosθ,bsinθ),B=(a,0), and C=(0,0).

By the distance formula,[13]

c=(abcosθ)2+(0bsinθ)2.

Squaring both sides and simplifying c2=(abcosθ)2+(bsinθ)2=a22abcosθ+b2cos2θ+b2sin2θ=a2+b2(sin2θ+cos2θ)2abcosθ=a2+b22abcosθ.

An advantage of this proof is that it does not require the consideration of separate cases depending on whether the angle Template:Mvar is acute, right, or obtuse. However, the cases treated separately in Elements II.12–13 and later by al-Ṭūsī, al-Kāshī, and others could themselves be combined by using concepts of signed lengths and areas and a concept of signed cosine, without needing a full Cartesian coordinate system.

Using Ptolemy's theorem

File:Ptolemy cos.svg
Proof of law of cosines using Ptolemy's theorem

Referring to the diagram, triangle ABC with sides ABScript error: No such module "Check for unknown parameters". = cScript error: No such module "Check for unknown parameters"., BCScript error: No such module "Check for unknown parameters". = aScript error: No such module "Check for unknown parameters". and ACScript error: No such module "Check for unknown parameters". = bScript error: No such module "Check for unknown parameters". is drawn inside its circumcircle as shown. Triangle ABDScript error: No such module "Check for unknown parameters". is constructed congruent to triangle ABCScript error: No such module "Check for unknown parameters". with ADScript error: No such module "Check for unknown parameters". = BCScript error: No such module "Check for unknown parameters". and BDScript error: No such module "Check for unknown parameters". = ACScript error: No such module "Check for unknown parameters".. Perpendiculars from DScript error: No such module "Check for unknown parameters". and CScript error: No such module "Check for unknown parameters". meet base ABScript error: No such module "Check for unknown parameters". at EScript error: No such module "Check for unknown parameters". and FScript error: No such module "Check for unknown parameters". respectively. Then: BF=AE=BCcosB^=acosB^ DC=EF=AB2BF=c2acosB^.

Now the law of cosines is rendered by a straightforward application of Ptolemy's theorem to cyclic quadrilateral ABCDScript error: No such module "Check for unknown parameters".: AD×BC+AB×DC=AC×BD a2+c(c2acosB^)=b2 a2+c22accosB^=b2.

Plainly if angle BScript error: No such module "Check for unknown parameters". is right, then ABCDScript error: No such module "Check for unknown parameters". is a rectangle and application of Ptolemy's theorem yields the Pythagorean theorem: a2+c2=b2.

By comparing areas

File:Law of cosines with acute angles.svg
Fig. 7a – Proof of the law of cosines for acute angle γScript error: No such module "Check for unknown parameters". by "cutting and pasting".
File:Law of cosines with an obtuse angle.svg
Fig. 7b – Proof of the law of cosines for obtuse angle γScript error: No such module "Check for unknown parameters". by "cutting and pasting".

One can also prove the law of cosines by calculating areas. The change of sign as the angle γScript error: No such module "Check for unknown parameters". becomes obtuse makes a case distinction necessary.

Recall that

  • a2Script error: No such module "Check for unknown parameters"., b2Script error: No such module "Check for unknown parameters"., and c2Script error: No such module "Check for unknown parameters". are the areas of the squares with sides aScript error: No such module "Check for unknown parameters"., bScript error: No such module "Check for unknown parameters"., and cScript error: No such module "Check for unknown parameters"., respectively;
  • if γScript error: No such module "Check for unknown parameters". is acute, then ab cos γScript error: No such module "Check for unknown parameters". is the area of the parallelogram with sides aScript error: No such module "Check for unknown parameters". and bScript error: No such module "Check for unknown parameters". forming an angle of γ′ = Template:SfracγScript error: No such module "Check for unknown parameters".;
  • if γScript error: No such module "Check for unknown parameters". is obtuse, and so cos γScript error: No such module "Check for unknown parameters". is negative, then ab cos γScript error: No such module "Check for unknown parameters". is the area of the parallelogram with sides a and b forming an angle of γ′ = γTemplate:SfracScript error: No such module "Check for unknown parameters"..

Acute case. Figure 7a 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 a2Script error: No such module "Check for unknown parameters"., b2Script error: No such module "Check for unknown parameters". on the left and the areas 2ab cos γScript error: No such module "Check for unknown parameters". and c2Script error: No such module "Check for unknown parameters". on the right;
  • in blue, the triangle ABCScript error: No such module "Check for unknown parameters"., on the left and on the right;
  • in grey, auxiliary triangles, all congruent to ABCScript error: No such module "Check for unknown parameters"., 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 a2+b2=c2+2abcosγ.

Obtuse case. Figure 7b cuts a hexagon in two different ways into smaller pieces, yielding a proof of the law of cosines in the case that the angle γScript error: No such module "Check for unknown parameters". is obtuse. We have

  • in pink, the areas a2Script error: No such module "Check for unknown parameters"., b2Script error: No such module "Check for unknown parameters"., and −2ab cos γScript error: No such module "Check for unknown parameters". on the left and c2Script error: No such module "Check for unknown parameters". on the right;
  • in blue, the triangle ABCScript error: No such module "Check for unknown parameters". twice, on the left, as well as on the right.

The equality of areas on the left and on the right gives a2+b22abcos(γ)=c2.

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 circle geometry

File:Law-of-cosines-circle-1.svg
Fig. 8a – The triangle ABCScript error: No such module "Check for unknown parameters". (pink), an auxiliary circle (light blue) and an auxiliary right triangle (yellow)
File:Law-of-cosines-circle-2.svg
Fig. 8b – The triangle ABCScript error: No such module "Check for unknown parameters". (pink), an auxiliary circle (light blue) and two auxiliary right triangles (yellow)
File:Triangle with circle of center B and radius BC.svg
Fig. 9 – Proof of the law of cosines using the power of a point theorem.

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 γScript error: No such module "Check for unknown parameters"., where a > 2b cos γScript error: No such module "Check for unknown parameters".. Drop the perpendicular from AScript error: No such module "Check for unknown parameters". onto aScript error: No such module "Check for unknown parameters". = BCScript error: No such module "Check for unknown parameters"., creating a line segment of length b cos γScript error: No such module "Check for unknown parameters".. Duplicate the right triangle to form the isosceles triangle ACPScript error: No such module "Check for unknown parameters".. Construct the circle with center AScript error: No such module "Check for unknown parameters". and radius bScript error: No such module "Check for unknown parameters"., and its tangent h = BHScript error: No such module "Check for unknown parameters". through BScript error: No such module "Check for unknown parameters".. The tangent hScript error: No such module "Check for unknown parameters". forms a right angle with the radius bScript error: No such module "Check for unknown parameters". (Euclid's Elements: Book 3, Proposition 18; or see here), so the yellow triangle in Figure 8 is right. Apply the Pythagorean theorem to obtain c2=b2+h2.

Then use the tangent secant theorem (Euclid's Elements: Book 3, Proposition 36), which says that the square on the tangent through a point BScript error: No such module "Check for unknown parameters". outside the circle is equal to the product of the two lines segments (from BScript error: No such module "Check for unknown parameters".) created by any secant of the circle through BScript error: No such module "Check for unknown parameters".. In the present case: BH2 = BC·BPScript error: No such module "Check for unknown parameters"., or h2=a(a2bcosγ).

Substituting into the previous equation gives the law of cosines: c2=b2+a(a2bcosγ).

Note that h2Script error: No such module "Check for unknown parameters". is the power of the point BScript error: No such module "Check for unknown parameters". 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 γScript error: No such module "Check for unknown parameters"., where a < 2b cos γScript error: No such module "Check for unknown parameters".. Drop the perpendicular from AScript error: No such module "Check for unknown parameters". onto aScript error: No such module "Check for unknown parameters". = BCScript error: No such module "Check for unknown parameters"., creating a line segment of length b cos γScript error: No such module "Check for unknown parameters".. Duplicate the right triangle to form the isosceles triangle ACPScript error: No such module "Check for unknown parameters".. Construct the circle with center AScript error: No such module "Check for unknown parameters". and radius bScript error: No such module "Check for unknown parameters"., and a chord through BScript error: No such module "Check for unknown parameters". perpendicular to c = AB,Script error: No such module "Check for unknown parameters". half of which is h = BH.Script error: No such module "Check for unknown parameters". Apply the Pythagorean theorem to obtain b2=c2+h2.

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: BH2 = BC·BP,Script error: No such module "Check for unknown parameters". or h2=a(2bcosγa).

Substituting into the previous equation gives the law of cosines: b2=c2+a(2bcosγa).

Note that the power of the point BScript error: No such module "Check for unknown parameters". with respect to the circle has the negative value h2Script error: No such module "Check for unknown parameters"..

Case of obtuse angle γScript error: No such module "Check for unknown parameters".. 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 BScript error: No such module "Check for unknown parameters". and radius aScript error: No such module "Check for unknown parameters". (see Figure 9), which intersects the secant through AScript error: No such module "Check for unknown parameters". and CScript error: No such module "Check for unknown parameters". in CScript error: No such module "Check for unknown parameters". and KScript error: No such module "Check for unknown parameters".. The power of the point AScript error: No such module "Check for unknown parameters". with respect to the circle is equal to both AB2BC2Script error: No such module "Check for unknown parameters". and AC·AKScript error: No such module "Check for unknown parameters".. Therefore, c2a2=b(b+2acos(πγ))=b(b2acosγ),

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 > 0Script error: No such module "Check for unknown parameters".) and acute angle (CK < 0Script error: No such module "Check for unknown parameters".) can be treated simultaneously.

Using the law of sines

The law of cosines can be proven algebraically from the law of sines and a few standard trigonometric identities.[14] To start, three angles of a triangle sum to a straight angle (α+β+γ=π radians). Thus by the angle sum identities for sine and cosine,

sinγ=sin(πγ)=sin(α+β)=sinαcosβ+cosαsinβ,cosγ=cos(πγ)=cos(α+β)=sinαsinβcosαcosβ.

Squaring the first of these identities, then substituting cosαcosβ=sinαsinβcosγ from the second, and finally replacing cos2α+sin2α=cos2β+sin2β=1, the Pythagorean trigonometric identity, we have:

sin2γ=(sinαcosβ+cosαsinβ)2=sin2αcos2β+2sinαsinβcosαcosβ+cos2αsin2β=sin2αcos2β+2sinαsinβ(sinαsinβcosγ)+cos2αsin2β=sin2α(cos2β+sin2β)+sin2β(cos2α+sin2α)2sinαsinβcosγ=sin2α+sin2β2sinαsinβcosγ.

The law of sines holds that asinαβ=bsinβ=csinγβ=k,

so to prove the law of cosines, we multiply both sides of our previous identity by Template:Tmath:

sin2γc2sin2γ=sin2αa2sin2α+sin2βb2sin2β2sinαsinβcosγabsinαsinβsin2c2=a2+b22abcosγ.

This concludes the proof.

Using vectors

File:Dot product cosine rule.svg
Triangle with vector edges a and b, separated by angle θ.

Denote

CB=a, CA=b, AB=c

Therefore, c=ab

Taking the dot product of each side with itself: cc=(ab)(ab)c2=a2+b22ab

Using the identity

uv=uvcos(u, v)

leads to

c2=a2+b22abcos(a, b)

The result follows.

Isosceles case

When a = bScript error: No such module "Check for unknown parameters"., i.e., when the triangle is isosceles with the two sides incident to the angle γScript error: No such module "Check for unknown parameters". equal, the law of cosines simplifies significantly. Namely, because a2 + b2 = 2a2 = 2abScript error: No such module "Check for unknown parameters"., the law of cosines becomes cosγ=1c22a2

or c2=2a2(1cosγ).

Analogue for tetrahedra

Given an arbitrary tetrahedron whose four faces have areas Template:Mvar, Template:Mvar, Template:Mvar, and Template:Mvar, with dihedral angle Template:Tmath between faces Template:Mvar and Template:Mvar, etc., a higher-dimensional analogue of the law of cosines is:[15] A2=B2+C2+D22(BCcosφbc+CDcosφcd+DBcosφdb).

Version suited to small angles

When the angle, γScript error: No such module "Check for unknown parameters"., is small and the adjacent sides, aScript error: No such module "Check for unknown parameters". and bScript error: No such module "Check for unknown parameters"., 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, can prove useful: c2=(ab)2+4absin2(γ2)=(ab)2+4abhaversin(γ).

In the limit of an infinitesimal angle, the law of cosines degenerates into the circular arc length formula, c = a γScript error: No such module "Check for unknown parameters"..

In non-Euclidean geometry

Template:Main article

File:Law-of-haversines.svg
Spherical triangle solved by the law of cosines.

As in Euclidean geometry, one can use the law of cosines to determine the angles AScript error: No such module "Check for unknown parameters"., BScript error: No such module "Check for unknown parameters"., CScript error: No such module "Check for unknown parameters". from the knowledge of the sides aScript error: No such module "Check for unknown parameters"., bScript error: No such module "Check for unknown parameters"., cScript error: No such module "Check for unknown parameters".. In contrast to Euclidean geometry, the reverse is also possible in both non-Euclidean models: the angles AScript error: No such module "Check for unknown parameters"., BScript error: No such module "Check for unknown parameters"., CScript error: No such module "Check for unknown parameters". determine the sides aScript error: No such module "Check for unknown parameters"., bScript error: No such module "Check for unknown parameters"., cScript error: No such module "Check for unknown parameters"..

A triangle is defined by three points uScript error: No such module "Check for unknown parameters"., vScript error: No such module "Check for unknown parameters"., and wScript error: No such module "Check for unknown parameters". on the unit sphere, and the arcs of great circles connecting those points. If these great circles make angles AScript error: No such module "Check for unknown parameters"., BScript error: No such module "Check for unknown parameters"., and CScript error: No such module "Check for unknown parameters". with opposite sides aScript error: No such module "Check for unknown parameters"., bScript error: No such module "Check for unknown parameters"., cScript error: No such module "Check for unknown parameters". then the spherical law of cosines asserts that all of the following relationships hold:

cosa=cosbcosc+sinbsinccosAcosA=cosBcosC+sinBsinCcosacosa=cosA+cosBcosCsinBsinC.


In hyperbolic geometry, a pair of equations are collectively known as the hyperbolic law of cosines. The first is cosha=coshbcoshcsinhbsinhccosA

where sinhScript error: No such module "Check for unknown parameters". and coshScript error: No such module "Check for unknown parameters". are the hyperbolic sine and cosine, and the second is cosA=cosBcosC+sinBsinCcosha.

The length of the sides can be computed by:

cosha=cosA+cosBcosCsinBsinC.

Polyhedra

The law of cosines can be generalized to all polyhedra by considering any polyhedron with vector sides and invoking the divergence Theorem.[16]

See also

Notes

Template:Notelist

References

<templatestyles src="Reflist/styles.css" />

  1. Cite error: Script error: No such module "Namespace detect".Script error: No such module "Namespace detect".
  2. Script error: No such module "citation/CS1".
  3. Script error: No such module "Citation/CS1". Template:Pb Johannes de Muris credits an anonymous author for the relevant section of his work De Arte Mesurandi. See Script error: No such module "citation/CS1".
  4. Script error: No such module "citation/CS1".
  5. Script error: No such module "citation/CS1".
  6. Script error: No such module "Citation/CS1".
  7. Script error: No such module "citation/CS1".
  8. Script error: No such module "citation/CS1".
  9. Script error: No such module "citation/CS1". English translation of De triangulis omnimodis by Johann Müller, otherwise known as Regiomontanus, with facsimile of the 1533 Latin edition. Theorem I.49, Template:Pgs.
  10. For example in Script error: No such module "citation/CS1".
  11. Java applet version by Prof. D E Joyce of Clark University.
  12. a b Alexander Bogomolny credits this proof to teacher John Molokach (2011), but it may be older. Script error: No such module "citation/CS1".
  13. Script error: No such module "citation/CS1".
  14. Script error: No such module "Citation/CS1".
  15. Script error: No such module "citation/CS1".
  16. Script error: No such module "Citation/CS1".

Script error: No such module "Check for unknown parameters".

External links

Template:Sister project

Script error: No such module "Navbox".