# 餘弦定理

${\displaystyle c^{2}=a^{2}+b^{2}-2ab\cos \gamma }$

${\displaystyle b^{2}=c^{2}+a^{2}-2ca\cos \beta }$
${\displaystyle a^{2}=b^{2}+c^{2}-2bc\cos \alpha }$

${\displaystyle c^{2}=a^{2}+b^{2}}$

## 歷史

${\displaystyle {\overline {AB}}^{2}={\overline {CA}}^{2}+{\overline {CB}}^{2}+2({\overline {CA}})({\overline {CH}})\,}$

${\displaystyle {\overline {AB}}^{2}={\overline {CA}}^{2}+{\overline {CB}}^{2}-2({\overline {CA}})({\overline {BC}})\cos \gamma }$

## 證明

### 三角函數

${\displaystyle c=a\cos \beta +b\cos \alpha }$

${\displaystyle c^{2}=ac\cos \beta +bc\cos \alpha }$

${\displaystyle a^{2}=ac\cos \beta +ab\cos \gamma }$
${\displaystyle b^{2}=bc\cos \alpha +ab\cos \gamma }$

${\displaystyle c^{2}}$的右式取代：

${\displaystyle c^{2}=ac\cos \beta +bc\cos \alpha =(a^{2}-ab\cos \gamma )+(b^{2}-ab\cos \gamma )=a^{2}+b^{2}-2ab\cos \gamma }$

### 勾股定理

#### 勾股定理之一

${\displaystyle \triangle ABC}$中，${\displaystyle {\overline {AB}}=c}$${\displaystyle {\overline {BC}}=a}$${\displaystyle {\overline {AC}}=b}$。過${\displaystyle B}$點作${\displaystyle AC}$垂線，垂足為${\displaystyle D}$，如果${\displaystyle D}$${\displaystyle AC}$內部，則${\displaystyle BD}$的長度為${\displaystyle a\sin C}$${\displaystyle DC}$的長度為${\displaystyle a\cos C}$${\displaystyle AD}$的長度為${\displaystyle b-a\cos C}$。根據勾股定理

${\displaystyle c^{2}=(a\sin C)^{2}+(b-a\cos C)^{2}\,}$
${\displaystyle c^{2}=a^{2}\sin ^{2}C+b^{2}-2ab\cos C+a^{2}\cos ^{2}C\,}$
${\displaystyle c^{2}=a^{2}(\sin ^{2}C+\cos ^{2}C)+b^{2}-2ab\cos C\,}$
${\displaystyle c^{2}=a^{2}+b^{2}-2ab\cos C\,}$

#### 勾股定理之二

${\displaystyle \triangle ABC}$中，${\displaystyle {\overline {AB}}=c}$${\displaystyle {\overline {BC}}=a}$${\displaystyle {\overline {AC}}=b}$。過${\displaystyle B}$點作${\displaystyle {\overline {AC}}}$垂線，垂足為${\displaystyle D}$，設${\displaystyle {\overline {AD}}=x}$，則${\displaystyle {\overline {CD}}=b-x}$，根據勾股定理

${\displaystyle c^{2}-x^{2}={\overline {BD}}^{2}=a^{2}-(b-x)^{2}}$
${\displaystyle c^{2}-x^{2}=a^{2}-b^{2}-x^{2}+2bx}$
${\displaystyle c^{2}=a^{2}-b^{2}+2bx}$
${\displaystyle x={\frac {b^{2}+c^{2}-a^{2}}{2b}}}$
${\displaystyle \cos A={\frac {x}{c}}={\frac {b^{2}+c^{2}-a^{2}}{2bc}}}$

## 應用

### 求邊

${\displaystyle a={\sqrt {b^{2}+c^{2}-2bc\cos A}}}$
${\displaystyle b={\sqrt {c^{2}+a^{2}-2ac\cos B}}}$
${\displaystyle c={\sqrt {a^{2}+b^{2}-2ab\cos C}}}$

### 求角

${\displaystyle \cos A={\frac {b^{2}+c^{2}-a^{2}}{2bc}}\,\!}$
${\displaystyle \cos B={\frac {c^{2}+a^{2}-b^{2}}{2ca}}\,\!}$
${\displaystyle \cos C={\frac {a^{2}+b^{2}-c^{2}}{2ab}}\,\!}$

${\displaystyle \angle A=\arccos {\frac {b^{2}+c^{2}-a^{2}}{2bc}}\,\!}$
${\displaystyle \angle B=\arccos {\frac {c^{2}+a^{2}-b^{2}}{2ca}}\,\!}$
${\displaystyle \angle C=\arccos {\frac {a^{2}+b^{2}-c^{2}}{2ab}}\,\!}$

## 參考資料

1. ^ 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.