image thumbnail

Rotation Matrix

version 1.0.0.0 (3.55 KB) by Jan
Rotation matrix in 2D, 3D and N-D

484 Downloads

Updated 10 Mar 2018

View License

RotMatrix - N-dimensional Rotation matrix
R = RotMatrix(alpha, u, v)
INPUT:
alpha: Angle of rotation in radians, counter-clockwise direction.
u, v: Ignored for the 2D case.
For the 3D case, u is the vector to rotate around.
For the N-D case, there is no unique axis of rotation anymore, so 2
orthonormal vectors u and v are used to define the (N-1) dimensional
hyperplane to rotate in.
u and v are normalized automatically and in the N-D case it is cared
for u and v being orthogonal.
OUTPUT:
R: Rotation matrix.

Cite As

Jan (2021). Rotation Matrix (https://www.mathworks.com/matlabcentral/fileexchange/66446-rotation-matrix), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!