R = sw_rotmat(rotAxis,rotAngle)
R = sw_rotmat(rotAxis,rotAngle) produces the
R rotation matrix that
rotates any vector around the given
rotAxis rotation axis by
angle in radian. Positive rotation is the right-hand direction around the
rotation axis and using the following rotation formula:
VR = R*V
To rotate tensors ( matrices) use the following formula:
Mp = R * M * R';
- Axis of rotation, stored in a row vector with 3 elements.
- Angle of rotation in radian, can be also a row vector with number of elements.
- Rotation matrix with dimensions of if a single rotation
angle is given. If
rotAngleis a vector,
Rwill contain a rotation matrix for each angle, it’s dimensions are .