reference orientation
heading = 0
attitude = 0
bank = 0
angle = 2 * acos(c_{1}c_{2}c_{3} - s_{1}s_{2}s_{3})
x = s1 s2 c3 +c1 c2 s3
y = s1 c2 c3 + c1 s2 s3
z = c1 s2 c3 - s1 c2 s3
where:
c1 = cos(heading/2) =1
c2 = cos(attitude/2) =1
c3 = cos(bank/2) =1
s1 = sin(heading/2) =0
s2 = sin(attitude/2) =0
s3 = sin(bank/2) =0
which gives:
angle = 0
x = 0
y = 0
z = 0
Normalise axis, since angle is 0 axis can be anything so set axis to
(1,0,0)
angle = 0 degrees
axis = 1,0,0 |
rotate by 90 degrees about y axis
heading = 90 degrees
attitude = 0
bank = 0
angle = 2 * acos(c_{1}c_{2}c_{3} - s_{1}s_{2}s_{3})
x = s1 s2 c3 +c1 c2 s3
y = s1 c2 c3 + c1 s2 s3
z = c1 s2 c3 - s1 c2 s3
where:
c1 = cos(heading/2) =0.7071
c2 = cos(attitude/2) =1
c3 = cos(bank/2) =1
s1 = sin(heading/2) =0.7071
s2 = sin(attitude/2) =0
s3 = sin(bank/2) =0
which gives:
angle = 90 degrees
x = 0
y = 0.7071
z = 0
Normalising axis gives:
angle = 90 degrees
axis = 0,1,0 |
rotate by 180 degrees about y axis
heading = 180 degrees
attitude = 0
bank = 0
angle = 2 * acos(c_{1}c_{2}c_{3} - s_{1}s_{2}s_{3})
x = s1 s2 c3 +c1 c2 s3
y = s1 c2 c3 + c1 s2 s3
z = c1 s2 c3 - s1 c2 s3
where:
c1 = cos(heading/2) =0
c2 = cos(attitude/2) =1
c3 = cos(bank/2) =1
s1 = sin(heading/2) =1
s2 = sin(attitude/2) =0
s3 = sin(bank/2) =0
which gives:
angle = 180 degrees
x = 0
y = 1
z = 0
axis is already normalised
angle = 180 degrees
axis = 0,1,0 |
rotate by 270 degrees about y axis
heading = -90 degrees
attitude = 0
bank = 0
angle = 2 * acos(c_{1}c_{2}c_{3} - s_{1}s_{2}s_{3})
x = s1 s2 c3 +c1 c2 s3
y = s1 c2 c3 + c1 s2 s3
z = c1 s2 c3 - s1 c2 s3
where:
c1 = cos(heading/2) =0.7071
c2 = cos(attitude/2) =1
c3 = cos(bank/2) =1
s1 = sin(heading/2) =-0.7071
s2 = sin(attitude/2) =0
s3 = sin(bank/2) =0
which gives:
angle = 90 degrees
x = 0
y = -0.7071
z = 0
Normalising axis gives:
angle = 90 degrees
axis = 0,-1,0
or
angle = -90 degrees
axis = 0,1,0 |