image thumbnail

Rotation Matrix

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


Updated 10 Mar 2018

View License

RotMatrix - N-dimensional Rotation matrix
R = RotMatrix(alpha, u, v)
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.
R: Rotation matrix.

Cite As

Jan (2022). 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!