|MATLAB Function Reference|
Rotate object about a specified direction
rotate function rotates a graphics object in three-dimensional space, according to the right-hand rule.
rotates the graphics object
direction is a two- or three-element vector that describes the axis of rotation in conjunction with the origin.
specifies the origin of the axis of rotation as a three-element vector. The default origin is the center of the plot box.
The graphics object you want rotated must be a child of the same axes. The object's data is modified by the rotation transformation. This is in contrast to
rotate3d, which only modify the viewpoint.
The axis of rotation is defined by an origin and a point P relative to the origin. P is expressed as the spherical coordinates
[theta phi], or as Cartesian coordinates.
The two-element form for
direction specifies the axis direction using the spherical coordinates
theta is the angle in the xy plane counterclockwise from the positive x-axis.
phi is the elevation of the direction vector from the xy plane.
The three-element form for
direction specifies the axis direction using Cartesian coordinates. The direction vector is the vector from the origin to (X,Y,Z).
Rotate a graphics object 180º about the x-axis.
Rotate a surface graphics object 45º about its center in the z direction.
rotate changes the
Zdata properties of the appropriate graphics object.
Object Manipulation for related functions