5 my_quaternion = pyquaternion.Quaternion(axis=[0, 1, 0], degrees=90)
8 my_rotated_vector = my_quaternion.rotate(my_vector)
10 print(
'\nBasic Rotation')
11 print(
'--------------')
12 print(
'My Vector: {}'.format(my_vector))
13 print(
'Performing rotation of {angle} deg about {axis}'.format(angle=my_quaternion.degrees, axis=my_quaternion.axis))
14 print(
'My Rotated Vector: {}'.format(my_rotated_vector))
18 null_quaternion = pyquaternion.Quaternion(axis=[0, 1, 0], angle=0)
20 print(
'\nInterpolated Rotation')
21 print(
'---------------------')
24 for q
in pyquaternion.Quaternion.intermediates(null_quaternion, my_quaternion, 9, include_endpoints=
True):
25 my_interpolated_point = q.rotate(my_vector)
26 print(
'My Interpolated Point: {point}\t(after rotation of {angle} deg about {axis})'.format(
27 point=my_interpolated_point, angle=round(q.degrees, 4), axis=q.axis