In my previous post I described the different qualities in a quaternion depending on choice of definition. The choice of direction: local-to-global or global-to-local, when you read an equation from right-to-left will not change the operations when you operate on a vector, it will just mean different things. But when you multiply two quaternions, like for example in the quaternion derivative, we need to multiply in different order. In the JPL definition (global-to-local), the quaternion derivative will be a the small angular change expressed in a quaternion, multiplied with the quaternion at the time of derivation:

While in the Hamilton definition, the multiplication is in the opposite order:

To confuse everything, I have used a combination of the above definitions in my program. I have the scalar part in the end but use a right handed quaternion with global-to-local direction of operation. Sigh…