Rotate surf input matrices

Rotates the SURF input matrices in three-dimensional space


Updated 6 Aug 2017

View License

[X,Y,Z] = ROTATESURF(x,y,z,euleraxis,eulerangle) rotates the SURF input data xyz, where x,y and z are matrices of the same size, according to the rotation axis euleraxis (vector) and the angle eulerange (radians).

SURF(X,Y,Z) displays the rotated object.

Omitting output arguments causes the object to be displayed with a SURF command and no outputs to be returned.

ROTATESURF(AX,...) plots into AX instead of GCA.

eaxis = [1,1,1];
eangle = pi/4;
[x,y,z] = peaks(25);
[X,Y,Z] = rotatesurf(X,Y,Z,eaxis,eangle);

Álvaro Romero Calvo 09-05-17

Cite As

Álvaro Romero Calvo (2023). Rotate surf input matrices (, MATLAB Central File Exchange. Retrieved .

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

Inspired by: Generate cylinder with custom axis

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes