Yaw and Pitch between 2 3D points

依然范特西╮ 提交于 2020-01-22 02:34:13

问题


I have 2 3D points and I need to get Yaw and Pitch between then in radians.

I've tried s many formulas but it just doesn' work.

My coordinates system is the following:

X= left right
Y = forward backward
Z = up down

Any help? And please be specific. I would really appreciate the whole formula.


回答1:


You can use the formulas I posted here to calculate the yaw ("heading") and pitch between to points. The only difference is that my calculations take in a single point (the other point is the origin, (0,0,0). You can still use the same calculations though, simply subtract pointB from pointA, and feed it into the functions.

For example, if your two points are:

pointA = (20,3,8)
pointB = (34,2,0)

First subtract pointA from pointB:

pointB - pointA = (34,2,0) - (20,3,8)
                = (14,-1,-8)

Then name this new point pointC. Now use the same calculations as in the linked post between the origin and pointC. You will get the distance between the two points, the yaw (heading) between the two points, and the pitch between the two points.



来源:https://stackoverflow.com/questions/37512637/yaw-and-pitch-between-2-3d-points

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!