问题
求解
A
∗
cos
(
θ
)
+
B
∗
sin
(
θ
)
=
C
A *\cos(\theta) + B*\sin(\theta) = C
A∗cos(θ)+B∗sin(θ)=C
中的
θ
\theta
θ值。
方法一
采用三角函数的万能公式进行求解,假设
t
=
tan
(
θ
2
)
t = \tan(\frac{\theta}{2})
t=tan(2θ)
其中
1
cos
(
θ
2
)
2
=
1
+
tan
(
θ
2
)
2
\frac{1}{\cos(\frac{\theta}{2})^2} = 1 + \tan(\frac{\theta}{2})^2
cos(2θ)21=1+tan(2θ)2
则
cos ( θ ) = cos ( θ 2 ) 2 − sin ( θ 2 ) 2 = cos ( θ 2 ) 2 ( 1 − sin ( θ 2 ) 2 cos ( θ 2 ) 2 ) = 1 1 cos ( θ 2 ) 2 ( 1 − tan ( θ 2 ) 2 ) = 1 1 + tan ( θ 2 ) 2 ( 1 − tan ( θ 2 ) 2 ) = 1 − tan ( θ 2 ) 2 1 + tan ( θ 2 ) 2 = 1 − t 2 1 + t 2 \cos(\theta) = \cos(\frac{\theta}{2})^2 - \sin(\frac{\theta}{2})^2 \\ \qquad\qquad =\cos(\frac{\theta}{2})^2(1 - \frac{\sin(\frac{\theta}{2})^2}{\cos(\frac{\theta}{2})^2}) \\ \qquad \quad =\frac{1}{\frac{1}{\cos(\frac{\theta}{2})^2}}(1 - \tan(\frac{\theta}{2})^2)\\ \qquad \qquad \qquad =\frac{1}{1 + \tan(\frac{\theta}{2})^2}(1 - \tan(\frac{\theta}{2})^2)\\ \!\!=\frac{1 - \tan(\frac{\theta}{2})^2}{1 + \tan(\frac{\theta}{2})^2}\\ \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!=\frac{1 - t^2}{1 + t^2} cos(θ)=cos(2θ)2−sin(2θ)2=cos(2θ)2(1−cos(2θ)2sin(2θ)2)=cos(2θ)211(1−tan(2θ)2)=1+tan(2θ)21(1−tan(2θ)2)=1+tan(2θ)21−tan(2θ)2=1+t21−t2
sin
(
θ
)
=
2
∗
sin
(
θ
2
)
∗
cos
(
θ
2
)
=
2
∗
(
sin
(
θ
2
)
cos
(
θ
2
)
)
∗
cos
(
θ
2
)
2
=
2
∗
tan
(
θ
2
)
∗
1
1
+
tan
(
θ
2
)
2
=
2
∗
tan
(
θ
2
)
1
+
tan
(
θ
2
)
2
=
2
∗
t
1
+
t
2
\sin(\theta) = 2*\sin(\frac{\theta}{2})*\cos(\frac{\theta}{2}) \\ \qquad\qquad= 2*(\frac{\sin(\frac{\theta}{2})}{\cos(\frac{\theta}{2})})*\cos(\frac{\theta}{2})^2\\ \qquad\qquad\quad= 2*\tan(\frac{\theta}{2})*\frac{1}{1+\tan(\frac{\theta}{2})^2}\\ = \frac{2*\tan(\frac{\theta}{2})}{1+\tan(\frac{\theta}{2})^2}\\ \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!= \frac{2*t}{1 + t^2}
sin(θ)=2∗sin(2θ)∗cos(2θ)=2∗(cos(2θ)sin(2θ))∗cos(2θ)2=2∗tan(2θ)∗1+tan(2θ)21=1+tan(2θ)22∗tan(2θ)=1+t22∗t
则上述方程可以写为
A
∗
1
−
t
2
1
+
t
2
+
B
∗
2
∗
t
1
+
t
2
=
C
A*\frac{1 - t^2}{1 + t^2} + B*\frac{2*t}{1 + t^2} = C
A∗1+t21−t2+B∗1+t22∗t=C
化简得
(
A
+
C
)
∗
t
2
−
2
∗
B
∗
t
−
(
A
−
C
)
=
0
(A+C)*t^2-2*B*t-(A-C)=0
(A+C)∗t2−2∗B∗t−(A−C)=0
故二次方程的解为
t
=
B
±
B
2
+
A
2
−
C
2
A
+
C
t = \frac{B\pm\sqrt{B^2 + A^2 - C^2}}{A + C}
t=A+CB±B2+A2−C2
所以方程的解为
θ
=
2
∗
arctan
(
t
)
\theta = 2*\arctan(t)
θ=2∗arctan(t)