Name

CL_rot_rotVect — Rotation(defined by a quaternion) of a vector

Calling Sequence

   w = CL_rot_rotVect(q,v)
   
   

Description

  • Calculates w: frame transfer of vector v defined by quaternion q (see examples)

    If q is an attitude quaternion, then w gives the coordinates (in satellite frame) of vector v (v expressed on reference frame).

  • Last update : 27/6/2008

Parameters

q:

quaternion (dim N)

v:

vector (3xN)

w:

frame transformed vector (3xN)

Authors

CNES - DCT/SB

See also

CL_rot_defQuat, CL_rot_matrix2quat, CL_rot_quat2matrix

Examples

q=CL_rot_defQuat(rand(4,2));
q=q./norm(q);
M1=CL_rot_quat2matrix(q(1));
v=[1;2;3];
w1=M1*v
w1=CL_rot_rotVect(q(1),v)
M2=CL_rot_quat2matrix(q(2));
w2=[w1 M2*v]
qq=CL_rot_matrix2quat(M2*M1);
qqq=q(1)*q(2);
w3=CL_rot_rotVect(qq,v)
w3=CL_rot_rotVect(qqq,v)

//R is a reference frame. S is a frame obtained with a rotation of 10 deg on the Z axis of R
ang = CL_deg2rad(10)
q = CL_rot_eul2quat(0,0,ang)
w = [1;0;0]               //X axis of R expressed on R reference frame
v = [cos(ang);sin(ang);0] //vector w rotated 10 deg on Z axis (X axis of S frame expressed on R frame)
w = CL_rot_rotVect(q,v)          //w = vector v (which was expressed on R) expressed on S