How to declare variable as quaternion?

Hi,

is there any way to declare a variable as a quaternion and use standard + - * ^ calculus?

Best regards,
Joerg.
joerg.kunze wrote:
Hi,

is there any way to declare a variable as a quaternion and use standard + - * ^ calculus?

Best regards,
Joerg.


To my knowing, you can not decalare a quaternion in Igor directly. Variable operation can only creates real or complex variables.
Structure or simply a 4-points wave can meet with your need. Using programming this is really not difficult.
Why not use the complex 2x2 matrix representation of a quaternion, and then apply matrix math with MatrixOP operations?
IMO all Variables in Igor should have been quaternions but that would probably have made some people very unhappy.

If you get IP8 (beta) you'll have access to the yet untested quaternion functions designed mostly for facilitating 3D rotations. These include quaternion to 4x4 matrix conversions, quaternion to rotation axis and rotation angle, quaternion to Euler angles (12 sequence definitions), conversions of axis (and angle) to quaternion and conversion of 4x4 matrix to quaternion.

A.G.