【发布时间】:2021-05-10 09:02:48
【问题描述】:
我有如下内容: 输入 x、y 和 h 以获得平移和倾斜方向
double dz = Math.sqrt( x*x + y*y );
double rotPan = Math.toDegrees(Math.atan(x / y));
double rotTilt = Math.toDegrees(Math.atan( h / dz ));
是否可以仅将 h 指定为起点并达到初始 x 和 y 值来反转 Math 的效果?
【问题讨论】:
-
除了你的问题:用
Math.hypot(x, y)代替Math.sqrt(x * x + y * y),用Math.atan2(x, y)代替Math.atan(x / y)(其他atan也一样)。 -
谢谢,我改变了那些。仍然对反向 x/y 感兴趣:-)
-
只是重新排列方程。在纸上做,会容易得多。
标签: java math trigonometry