http://proteopedia.org/wiki/images/7/76/Wobble.spt
jmol script to move molecule around a given orientation in a precession movement.
Preliminaries
A quaternion is an mathematical object (like a matrix or a complex number) with four parameters x y z w. It is useful to express orientations and rotations, and to do calculations (combining, interpolating, dissecting) on them.
Jmol shows structures (e.g. atom positions) on a display and allows the view to be rotated and individual atomic positions to be manipulated. The atoms have Cartesian coordinates x, y, z, and when you rotate the model, the coordinate system is rotated (same coordinates x, y, z, but axes of coordinate system point in different directions).
When a new structure is loaded, the axes point left, up, and out of the screen. The Jmol command "reset" puts the coordinate system back into that initial orientation.
The Jmol command "q = quaternion()" assigns the current orientation to q.
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".
Combining two rotations
Interpolating between orientations
Interpreting a rotation