Law of cosines or cosine formula

举报
李锐博恩 发表于 2021/07/15 05:57:58 2021/07/15
【摘要】 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 cosi...

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. Using notation as in Fig. 1, the law of cosines states

{displaystyle c^{2}=a^{2}+b^{2}-2abcos gamma ,}

where γ denotes the angle contained between sides of lengths a and b and opposite the side of length c.

Figure 1 – A triangle. The angles α (or A), β (or B), and γ(or C) are respectively opposite the sides ab, and c.

 

The law of cosines generalizes the Pythagorean theorem(勾股定理), which holds only for right triangles: if the angle γ is a right angle (of measure 90° [degrees], or π/2 radians), then cos γ = 0, and thus the law of cosines reduces to the Pythagorean theorem:

{displaystyle 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, and in computing the angles of a triangle if all three sides are known.

 

 


Applications

The theorem is used in triangulation, for solving a triangle or circle, i.e., to find (see Figure 3):

Fig. 3 – Applications of the law of cosines: unknown side and unknown angle.

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

,c={sqrt {a^{2}+b^{2}-2abcos gamma }},;

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

,gamma =arccos left({frac {a^{2}+b^{2}-c^{2}}{2ab}}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 theoremto do this if it is a right triangle):

,a=bcos gamma pm {sqrt {c^{2}-b^{2}sin ^{2}gamma }},.

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 bor γ 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 γ + 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 < b, only one positive solution if c = b sin γ, and no solution if c < b sin γ or c ≥ b. These different cases are also explained by the side-side-angle congruence ambiguity.


Proofs

Using the distance formula

Fig. 4 – Coordinate geometry proof

Consider a triangle with sides of length abc, where θ is the measurement of the angle opposite the side of length c. This triangle can be placed on the Cartesian coordinate system by plotting the following points, as shown in Fig. 4:

{displaystyle A=(bcos theta ,bsin theta ),B=(a,0),{text{ and }}C=(0,0).}

By the distance formula, we have

{displaystyle c={sqrt {(a-bcos theta )^{2}+(0-bsin theta )^{2}}}.}

Now, we just work with that equation:

{displaystyle {begin{aligned}c^{2}&{}=(a-bcos theta )^{2}+(-bsin theta )^{2}\c^{2}&{}=a^{2}-2abcos theta +b^{2}cos ^{2}theta +b^{2}sin ^{2}theta \c^{2}&{}=a^{2}+b^{2}(sin ^{2}theta +cos ^{2}theta )-2abcos theta \c^{2}&{}=a^{2}+b^{2}-2abcos theta .end{aligned}}}

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 the law of sines

By using the law of sines 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 {c}{sin gamma }}={frac {b}{sin beta }},

{frac {c}{sin gamma }}={frac {a}{sin alpha }},

{displaystyle alpha +beta +gamma =pi .}

Then, by using the third equation of the system, we obtain a system of two equations in two variables:

{frac {c}{sin gamma }}={frac {b}{sin(alpha +gamma )}},

{frac {c}{sin gamma }}={frac {a}{sin alpha }},

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)

sin(alpha +gamma )=sin alpha cos gamma +sin gamma cos alpha

leads to

{displaystyle c(sin alpha cos gamma +sin gamma cos alpha )=bsin gamma ,}

{displaystyle csin alpha =asin gamma .}

By dividing the whole system by cos γ, we have:

{displaystyle c(sin alpha +tan gamma cos alpha )=btan gamma ,}

{displaystyle {frac {csin alpha }{cos gamma }}=atan gamma ,}

{displaystyle {frac {c^{2}sin ^{2}alpha }{cos ^{2}gamma }}=a^{2}tan ^{2}gamma .}

Hence, from the first equation of the system, we can obtain

{frac {csin alpha }{b-ccos alpha }}=tan gamma

By substituting this expression into the second equation and by using

{displaystyle 1+tan ^{2}gamma ={frac {1}{cos ^{2}gamma }}}

we can obtain one equation with one variable:

{displaystyle c^{2}sin ^{2}alpha left(1+{frac {c^{2}sin ^{2}alpha }{(b-ccos alpha )^{2}}}right)=a^{2}cdot {frac {c^{2}sin ^{2}alpha }{(b-ccos alpha )^{2}}}}

By multiplying by (b − c cos α)2, we can obtain the following equation:

(b-ccos alpha )^{2}+c^{2}sin ^{2}alpha =a^{2}.

This implies

{displaystyle b^{2}-2bccos alpha +c^{2}cos ^{2}alpha +c^{2}sin ^{2}alpha =a^{2}.}

Recalling the Pythagorean identity, we obtain the law of cosines:

a^{2}=b^{2}+c^{2}-2bccos alpha .


Law of cosines in non-Euclidean geometry

A version of the law of cosines also holds in non-Euclidean geometry. In spherical geometry, a triangle is defined by three points uv, and won the unit sphere, and the arcs of great circles connecting those points. If these great circles make angles AB, and C with opposite sides abc then the spherical law of cosines asserts that both of the following relationships hold:

{begin{aligned}cos a&=cos bcos c+sin bsin ccos A\cos A&=-cos Bcos C+sin Bsin Ccos a.end{aligned}}

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

{displaystyle cosh a=cosh bcosh c-sinh bsinh ccos A}

where sinh and cosh are the hyperbolic sine and cosine, and the second is

{displaystyle cos A=-cos Bcos C+sin Bsin Ccosh a.}

As in Euclidean geometry, one can use the law of cosines to determine the angles ABC from the knowledge of the sides abc. However, unlike Euclidean geometry, the reverse is also possible in each of the models of non-Euclidean geometry: the angles ABC determine the sides abc.

 

Spherical triangle solved by the law of cosines.

https://en.wikipedia.org/wiki/Law_of_cosines

 

文章来源: reborn.blog.csdn.net,作者:李锐博恩,版权归原作者所有,如需转载,请联系作者。

原文链接:reborn.blog.csdn.net/article/details/84199364

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。