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 33: Line 33:
The Jmol command "q = quaternion()" assigns the current orientation to q.
The Jmol command "q = quaternion()" assigns the current orientation to q.
-
<jmol><jmolButton><script>q = quaternion()</script><text>save orientation</text></jmolButton></jmol>
+
<jmol><jmolButton><script>q = quaternion()</script><text>store orientation</text></jmolButton></jmol>
So, again, how is an orientation different from a rotation? An orientation is the rotation necessary to get the coordinate system from the "reset" orientation to the current orientation. The quaternion ''q0'' for the initial orientation corresponds to no rotation, i.e. {0 0 1 0}. To get back to an orientation ''q'' after rotating, use "moveto 0 quaternion q". After you saved an orientation, click the reset button above and then go back to the saved orientation with the button below.
So, again, how is an orientation different from a rotation? An orientation is the rotation necessary to get the coordinate system from the "reset" orientation to the current orientation. The quaternion ''q0'' for the initial orientation corresponds to no rotation, i.e. {0 0 1 0}. To get back to an orientation ''q'' after rotating, use "moveto 0 quaternion q". After you saved an orientation, click the reset button above and then go back to the saved orientation with the button below.
-
<jmol><jmolButton><script>moveto 0 quaternion @q</script><text>go to saved orientation</text></jmolButton></jmol>
+
<jmol><jmolButton><script>moveto 0 quaternion @q</script><text>go to stored orientation instantly</text></jmolButton></jmol>
 +
 
 +
<jmol><jmolButton><script>moveto 2 quaternion @q</script><text>go to stored orientation gradually</text></jmolButton></jmol>
Relevant Jmol command examples:
Relevant Jmol command examples:
q = quaternion() # store current orientation
q = quaternion() # store current orientation
moveto 0 quaternion @q # go back to stored orientation instantly
moveto 0 quaternion @q # go back to stored orientation instantly
-
moveto 1 quaternion @q # go back to stored orientation gradually
+
moveto 2 quaternion @q # go back to stored orientation gradually (2 sec)
==Combining two rotations==
==Combining two rotations==

Revision as of 18:37, 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