问题
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