This old version of Proteopedia is provided for student assignments while the new version is undergoing repairs. Content and edits done in this old version of Proteopedia after March 1, 2026 will eventually be lost when it is retired in about June of 2026.


Apply for new accounts at the new Proteopedia. Your logins will work in both the old and new versions.


Jmol/Quaternions

From Proteopedia

(Difference between revisions)
Jump to: navigation, search
Line 50: Line 50:
Relevant Jmol command examples:
Relevant Jmol command examples:
-
r = quaternion({@x @y @z},@tilt) # rotation about an axis in direction xyz by tilt degrees
+
r = quaternion({@x @y @z},@tilt) # rotation about an axis xyz by tilt degrees
-
tilted = r * s # apply the rotation to the starting orientation to get the tilted orientation
+
tilted = r * s # rotate the starting orientation to get the tilted orientation
moveto @time quaternion @tilted # tilt the view, taking some time to do so.
moveto @time quaternion @tilted # tilt the view, taking some time to do so.
Line 76: Line 76:
q0 = quaternion
q0 = quaternion
angle = rotation%"theta" #Extract the rotation angle from the quaternion
angle = rotation%"theta" #Extract the rotation angle from the quaternion
-
angle = 2 * acos(rotation.w) #Alternative way to get the angle, avoids percent sign that gave me trouble
+
angle = 2 * acos(rotation.w) #Alternative way to get the angle, avoids percent sign
duration = angle/45 + 0.1 #take one second per 45 degrees rotation, plus 0.1 sec
duration = angle/45 + 0.1 #take one second per 45 degrees rotation, plus 0.1 sec
qnew = rotation * q0 #figure out the new orientation
qnew = rotation * q0 #figure out the new orientation

Revision as of 16:01, 25 July 2019

Drag the structure with the mouse to rotate

Resources

http://sacredsoftware.net/tutorials/quaternion.html

Proteopedia Page Contributors and Editors (what is this?)

Karsten Theis

Personal tools