<< CL_rot_defFrameVec Coordinates and frames CL_rot_defRot1Ax >>

CelestLab >> Coordinates and frames > CL_rot_defQuat

CL_rot_defQuat

Quaternion definition from real and imaginary components

Calling Sequence

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)

Description

Parameters

r, i1, i2, i3 :

Real and Imaginary components (1xN)

r, i :

Real part (1xN) and Imaginary part (3xN)

ri :

Real and imaginary part (4xN)

ri, order :

Real and imaginary part (4xN) and order ('ri' or 'ir' : see above).

q :

Quaternion (dim N)

Authors

Examples

// 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));

Report an issue
<< CL_rot_defFrameVec Coordinates and frames CL_rot_defRot1Ax >>