求解二次方程

zyx040404 2018-07-28 11:25:53
W * cos(R) - H * sin(R) + x * cos(R) * 2 = a;
W * sin(R) + H * cos(R) + x * sin(R) * 2 = b;
已知W, H, a, b,求x和R
...全文
73 点赞 收藏 1
写回复
1 条回复
丁劲犇 2018年07月29日
?? 这是数学题?

W * cos(R) - H * sin(R) + x * cos(R) * 2 = a;
W * sin(R) + H * cos(R) + x * sin(R) * 2 = b;
-->
W * cos(R) * sin(R) - H * sin(R) * sin(R) + x * cos(R) * sin(R) * 2 = a * sin(R);
W * sin(R) * cos(R) + H * cos(R) * cos(R) + x * sin(R) * cos(R) * 2 = b * cos(R);
-->
W * cos(R) * sin(R) - H * sin(R) * sin(R) - W * sin(R) * cos(R) - H * cos(R) * cos(R) = a * sin(R) - b * cos(R)
-->
- H = a * sin(R) - b * cos(R)
-->
a * sin(R) + H = b * cos(R)
let u = sin(R)
-->
(a*u+H)^2 = b^2*(1-u^2)
-->
a*a*u*u + H*H + 2*a*u*H = b*b - b*b*u*u
-->
(a*a+b*b)*u*u + 2*a*H*u + (H*H-b*b) = 0
let
A = (a*a+b*b)
B = 2*a*H
C = (H*H-b*b)
-->
u(0) = -B + sqrt(B*B-4*A*C)/2/A
u(1) = -B - sqrt(B*B-4*A*C)/2/A

R = asin(u[])
反带回去求取X,并验证虚解。
回复 点赞
发动态
发帖子
C++ 语言
创建于2007-09-28

3.1w+

社区成员

24.8w+

社区内容

C++ 语言相关问题讨论,技术干货分享
社区公告
暂无公告