I'm trying to write an MFD that will mimic the functionality of the default HUDs and I need some help with the math.
I have a matrix made up of a x, a y, and a z reference vector. (Yes they are perpendicular to each-other). For eas of reference I am referint to these vectors as "vertical" "horizon" and "north" where horizon and north form a plane and vertical is that plane's "normal".
At the moment I know I can get pitch from the following...
x = dot product of vertical and vessel's z axis
Pitch angle = PI/2(radians) - acos (x)
Ideally Yaw would show 0 when the vessel's z axis is aligned with north and roll would be the angle of the vessel's x axis relative to the horizon/north plane.
Unfortunately I am having difficult visualizing how to get there. Any help would be greatly appreciated.:tiphat:
ETA:
It seems I asked almost this same question 2 years ago but never got an answer.
I have a matrix made up of a x, a y, and a z reference vector. (Yes they are perpendicular to each-other). For eas of reference I am referint to these vectors as "vertical" "horizon" and "north" where horizon and north form a plane and vertical is that plane's "normal".
At the moment I know I can get pitch from the following...
x = dot product of vertical and vessel's z axis
Pitch angle = PI/2(radians) - acos (x)
Ideally Yaw would show 0 when the vessel's z axis is aligned with north and roll would be the angle of the vessel's x axis relative to the horizon/north plane.
Unfortunately I am having difficult visualizing how to get there. Any help would be greatly appreciated.:tiphat:
ETA:
It seems I asked almost this same question 2 years ago but never got an answer.