You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,11 +51,13 @@ A cool feature of quaternions is that they can be intuitively chained together t
51
51
52
52
>>> q1 = Quaternion(axis=[1, 0, 0], angle=3.14159265) # Rotate 180 about X
53
53
>>> q2 = Quaternion(axis=[0, 1, 0], angle=3.14159265 / 2) # Rotate 90 about Y
54
-
>>> q3 = q1 * q2 # Composite rotation of q1 then q2 expressed as standard multiplication
54
+
>>> q3 = q2 * q1 # Composite rotation of q1 then q2 expressed as standard multiplication (note quaternions are multiplied in reverse order of rotation)
55
55
>>> v_prime = q3.rotate(v)
56
56
>>> v_prime
57
-
array([ 1., 0., 0.])
57
+
array([ -1., 0., 0.])
58
58
>>>
59
+
> Note: pyquaternion assumes a right-handed coordinate system compatible with East-North-Up and North-East-Down conventions.
60
+
59
61
60
62
Quaternions are used extensively in animation to describe smooth transitions between known orientations. This is known as interpolation. This is an example of an area where quaternions are preferred to rotation matrices as smooth interpolation is not possible with the latter. Here's quaternion interpolation in action:
0 commit comments