如何解决在C ++中使用三角函数时如何校正nan
cout << "Please enter the A vector's magnitude \n";
cin >> A_v;
cout << "Please enter the B vector's magnitude \n";
cin >> B_v;
cout << "The general form to find the direction of the resultant vector = \n" << "tan^-1 X " << UL << " [B X sin] \n" << UL_
<< " [A + B X cos]\n";
cout << "Please enter the angle value \n";
cin >> ct;
cost = cos(ct);
sint = sin(ct);
itan = atan(ct);
al = itan*((B*sint)/(A+(B*cost)));
ald = al*(180/3.141562);
cout << "The direction of the vector is inclined at " << ald << " degrees \n";
这是一个用于查找矢量的倾角/方向的程序(在物理学中)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。