<< CL_rot_defRot1Ax Coordinates and frames CL_rot_defRotVec >>

CelestLab >> Coordinates and frames > CL_rot_defRot2Ax

CL_rot_defRot2Ax

Determination of 2 successive rotations

Calling Sequence

[qa,angsa,Inok] = CL_rot_defRot2Ax(u,v,axis1,axis2 [,numsol=1])
[qa,angsa,qb,angsb,Inok] = CL_rot_defRot2Ax(u,v,axis1,axis2, numsol=2)

Description

Parameters

u:

Vector to be rotated (3xN or 3x1)

v:

Desired image of u by the rotation (3xN or 3x1)

axis1:

Axis vector (3xN or 3x1) or axis number (1x1) for the first rotation

axis2:

Axis vector (3xN or 3x1) or axis number (1x1) for the second rotation

numsol:

(optional, integer) Number of solutions returned: 1 or 2. Default is 1

qa:

Quaternion for the 1st solution (dim N)

angsa:

Rotation angles for the 1st solution (2xN)

qb:

Quaternion for the 2nd solution (dim N)

angsb:

Rotation angles for the 2nd solution (2xN)

Inok:

Indices for which the rotation is not uniquely defined, or the desired target vector cannot be reached

Authors

See also

Examples

// Example1: X axis then Y
u = [ 1 ; 2 ; 3 ];
v = [ 3 ; 1 ; 2 ];
n1 = 1;
n2 = 2;
[qa, angsa, Inok] = CL_rot_defRot2Ax(u, v, n1, n2);
// Check results :
v2 = CL_rot_rotVect(qa,u) // == v

// Example2: axes = vectors
u = [ 1 ; 2 ; 3 ];
v = [ 3 ; 1 ; 2 ];
axis1 = [-2;3;4];
axis2 = [1;0;1];
[qa, angsa, qb, angsb, Inok] = CL_rot_defRot2Ax(u, v, axis1, axis2, numsol=2);
// Check results :
v2a = CL_rot_rotVect(qa,u) // == v
v2b = CL_rot_rotVect(qb,u) // == v

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