深度学习基础 - 余弦定理
flyfish
A
D
=
b
cos
A
,
C
D
=
b
sin
A
,
A D=b \cos A, \\C D=b \sin A,
AD=bcosA,CD=bsinA,
B
D
=
A
B
−
A
D
B
D
=
c
−
b
cos
A
B D=A B-A D \\ B D=c-b \cos A
BD=AB−ADBD=c−bcosA
根据是勾股定理
B
C
2
=
B
D
2
+
C
D
2
=
(
c
−
b
cos
A
)
2
+
(
b
sin
A
)
2
=
c
2
−
2
c
b
cos
A
+
b
2
整
理
得
 
a
2
=
b
2
+
c
2
−
2
b
c
cos
A
\begin{aligned} B C^{2} &=B D^{2}+C D^{2} \\ &=(c-b \cos A)^{2}+(b \sin A)^{2} \\ &=c^{2}-2 c b \cos A+b^{2} \\ \mathbb{整理得} \, a^{2}=& b^{2}+c^{2}-2 b c \cos A \end{aligned}
BC2整理得a2==BD2+CD2=(c−bcosA)2+(bsinA)2=c2−2cbcosA+b2b2+c2−2bccosA
也
就
是
a
2
=
b
2
+
c
2
−
2
b
c
cos
α
也就是 a^{2}= b^{2}+c^{2}-2 b c \cos \alpha
也就是a2=b2+c2−2bccosα
中间计算会用到
cos
2
(
θ
)
+
sin
2
(
θ
)
=
1
\cos ^{2}(\theta)+\sin ^{2}(\theta)=1
cos2(θ)+sin2(θ)=1
可以看 三角函数
同理可得其他的式子
c 2 = a 2 + b 2 − 2 a b cos γ b 2 = c 2 + a 2 − 2 a c cos β a 2 = b 2 + c 2 − 2 b c cos α \begin{array}{l} c^{2}=a^{2}+b^{2}-2 a b \cos \gamma \\ {b^{2}=c^{2}+a^{2}-2 a c \cos \beta} \\ {a^{2}=b^{2}+c^{2}-2 b c \cos \alpha}\end{array} c2=a2+b2−2abcosγb2=c2+a2−2accosβa2=b2+c2−2bccosα
转换下就是
cos
α
=
b
2
+
c
2
−
a
2
2
b
c
cos
β
=
c
2
+
a
2
−
b
2
2
c
a
cos
γ
=
a
2
+
b
2
−
c
2
2
a
b
\begin{aligned} \cos \alpha &=\frac{b^{2}+c^{2}-a^{2}}{2 b c} \\ \cos \beta &=\frac{c^{2}+a^{2}-b^{2}}{2 c a} \\ \cos \gamma &=\frac{a^{2}+b^{2}-c^{2}}{2 a b} \end{aligned}
cosαcosβcosγ=2bcb2+c2−a2=2cac2+a2−b2=2aba2+b2−c2
如果利用正弦定理是这样的
a sin A = b sin B = c sin C = c sin ( A + B ) \frac{a}{\sin A}=\frac{b}{\sin B}=\frac{c}{\sin C}=\frac{c}{\sin (A+B)} sinAa=sinBb=sinCc=sin(A+B)c
b
sin
A
=
a
sin
B
b \sin A=a \sin B
bsinA=asinB
c
sin
A
=
a
sin
(
A
+
B
)
=
a
sin
A
cos
B
+
a
cos
A
sin
B
c \sin A=a \sin (A+B)=a \sin A \cos B+a \cos A \sin B
csinA=asin(A+B)=asinAcosB+acosAsinB
a
2
=
(
c
−
b
cos
A
)
2
+
(
b
sin
A
)
2
=
b
2
+
c
2
−
2
b
c
cos
A
a^{2}=(c-b \cos A)^{2}+(b \sin A)^{2}=b^{2}+c^{2}-2 b c \cos A
a2=(c−bcosA)2+(bsinA)2=b2+c2−2bccosA
结果是
a
2
=
b
2
+
c
2
−
2
b
c
cos
A
a^{2}=b^{2}+c^{2}-2 b c \cos A
a2=b2+c2−2bccosA
sin
C
=
sin
(
A
+
B
)
\sin C=\sin (A+B)
sinC=sin(A+B)的理由是
∠
A
+
∠
B
+
∠
C
=
18
0
∘
\angle A+\angle B+\angle C=180^{\circ}
∠A+∠B+∠C=180∘
sin
(
A
+
B
)
=
sin
(
18
0
∘
−
∠
C
)
=
sin
C
\sin (A+B)=\sin \left(180^{\circ}-\angle C\right)=\sin C
sin(A+B)=sin(180∘−∠C)=sinC
也就是
sin
C
=
sin
(
π
−
(
A
+
B
)
)
=
sin
(
A
+
B
)
\begin{array}{l}{\sin C=\sin (\pi-(A+B))} \\ {=\sin (A+B)}\end{array}
sinC=sin(π−(A+B))=sin(A+B)