Quaternion definition from real and imaginary components
q = CL_rot_defQuat(r,i1,i2,i3) q = CL_rot_defQuat(r,i) q = CL_rot_defQuat(ri) q = CL_rot_defQuat(ri,order)
Returns a quaternion defined by its real and imaginary components.
The quaternion components may be defined in several ways:
- real part (r) and imaginary part (i1,i2,i3) = 4 arguments.
- real part (r) and imaginary part (i) = 2 arguments.
- real and imaginary part (ri) = 1 argument.
- real and imaginary part (ri) + order = 2 arguments. The order helps determine the position of the real part in the 4-component vector.
=> order = "ri": the input vector corresponds to [r,i1,i2,i3] (real part first).
=> order = "ir": the input vector corresponds to [i1,i2,i3,r] (real part last).
Notes:
- The quaternion as defined is NOT normalized.
Real and Imaginary components (1xN)
Real part (1xN) and Imaginary part (3xN)
Real and imaginary part (4xN)
Real and imaginary part (4xN) and order ('ri' or 'ir' : see above).
Quaternion (dim N)
CNES - DCT/SB
// Example 1: All the following calls return the same quaternion: q = CL_rot_defQuat(1, 2, 3, 4) q = CL_rot_defQuat(1, [2; 3; 4]) q = CL_rot_defQuat([1; 2; 3; 4]) q = CL_rot_defQuat([1; 2; 3; 4], "ri" ) // (real part first) q = CL_rot_defQuat([2; 3; 4; 1], "ir" ) // (real part last) // Example 2: 1000 random quaternions q = CL_rot_defQuat(rand(4,1000)); |