<< CL_rot_quatSlerp Coordinates and frames Geometry and events >>

CelestLab >> Coordinates and frames > CL_rot_rotVect

CL_rot_rotVect

Image of vector by a rotation defined by a quaternion

Calling Sequence

w = CL_rot_rotVect(q,v)

Description

Parameters

q :

Quaternion (that defines the rotation) (dim N or dim 1)

v :

Vector (3xN or 3x1)

w :

Rotated vector (3xN)

Authors

See also

Examples

q = CL_rot_axAng2quat([0;0;1], %pi/6) // rotation around Z
M = CL_rot_quat2matrix(q) // corresponding matrix
v = [1; 0; 0] // some vector
w = CL_rot_rotVect(q, v) // rotated vector
w = M' * v // same

// Same with 2 quaternions
q2 = [q, q]
M2 = CL_rot_quat2matrix(q2) // corresponding matrix
w = CL_rot_rotVect(q2, v) // rotated vector
w = M2' * v // same

// Same with 2 vectors
v2 = [v, v]
w = CL_rot_rotVect(q, v2) // rotated vector
w = M' * v2 // same

Report an issue
<< CL_rot_quatSlerp Coordinates and frames Geometry and events >>