reference orientation:
angle = 0 degrees
axis = 1,0,0
heading = atan2(y * sin(angle)- x * z * (1 - cos(angle)) , 1 - (y2 + z2 ) * (1 - cos(angle)))
attitude = asin(x * y * (1 - cos(angle)) + z * sin(angle))
bank = atan2(x * sin(angle)-y * z * (1 - cos(angle)) , 1 - (x2 + z2) * (1 - cos(angle)))
sin(angle)=0
1-cos(angle)=0
heading = atan(0 / 1)
attitude = asin(0)
bank = atan(0 / 1)
heading = 0
attitude = 0
bank = 0 |
rotate by 90 degrees about y axis:
angle = 90 degrees
axis = 0,1,0
heading = atan2(y * sin(angle)- x * z * (1 - cos(angle)) , 1 - (y2 + z2 ) * (1 - cos(angle)))
attitude = asin(x * y * (1 - cos(angle)) + z * sin(angle))
bank = atan2(x * sin(angle)-y * z * (1 - cos(angle)) , 1 - (x2 + z2) * (1 - cos(angle)))
sin(angle)=1
1-cos(angle)=1
heading = atan2(1 , 0)
attitude = asin(0)
bank = atan2(0 , 1)
heading = 90 degrees
attitude = 0
bank = 0 |
rotate by 180 degrees about y axis:
angle = 180 degrees
axis = 0,1,0
heading = atan2(y * sin(angle)- x * z * (1 - cos(angle)) , 1 - (y2 + z2 ) * (1 - cos(angle)))
attitude = asin(x * y * (1 - cos(angle)) + z * sin(angle))
bank = atan2(x * sin(angle)-y * z * (1 - cos(angle)) , 1 - (x2 + z2) * (1 - cos(angle)))
sin(angle)=0
1-cos(angle)=2
heading = atan2(0 , -1)
attitude = asin(0)
bank = atan2(0 , 1)
heading = 180 degrees
attitude = 0
bank = 0 |
rotate by 270 degrees about y axis:
angle = -90 degrees
axis = 0,1,0
heading = atan2(y * sin(angle)- x * z * (1 - cos(angle)) , 1 - (y2 + z2 ) * (1 - cos(angle)))
attitude = asin(x * y * (1 - cos(angle)) + z * sin(angle))
bank = atan2(x * sin(angle)-y * z * (1 - cos(angle)) , 1 - (x2 + z2) * (1 - cos(angle)))
sin(angle)=-1
1-cos(angle)=1
heading = atan2(-1 ,0)
attitude = asin(0)
bank = atan2(0 , 1)
heading = -90 degrees
attitude = 0
bank = 0 |