Yaw and Pitch between 2 3D points

前端 未结 1 981
醉话见心
醉话见心 2021-01-29 03:49

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 fo

1条回答
  •  不思量自难忘°
    2021-01-29 04:18

    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.

    0 讨论(0)
提交回复
热议问题