求解方程A*cos + B*sin = C

问题

求解
A ∗ cos ⁡ ( θ ) + B ∗ sin ⁡ ( θ ) = C A *\cos(\theta) + B*\sin(\theta) = C Acos(θ)+Bsin(θ)=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θ)2sin(2θ)2=cos(2θ)2(1cos(2θ)2sin(2θ)2)=cos(2θ)211(1tan(2θ)2)=1+tan(2θ)21(1tan(2θ)2)=1+tan(2θ)21tan(2θ)2=1+t21t2

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(θ)=2sin(2θ)cos(2θ)=2(cos(2θ)sin(2θ))cos(2θ)2=2tan(2θ)1+tan(2θ)21=1+tan(2θ)22tan(2θ)=1+t22t
则上述方程可以写为
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 A1+t21t2+B1+t22t=C
化简得
( A + C ) ∗ t 2 − 2 ∗ B ∗ t − ( A − C ) = 0 (A+C)*t^2-2*B*t-(A-C)=0 (A+C)t22Bt(AC)=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+A2C2
所以方程的解为
θ = 2 ∗ arctan ⁡ ( t ) \theta = 2*\arctan(t) θ=2arctan(t)

  • 7
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

henry.zhu51

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值