(translator=anticat, ChineseSource=anticat-20020715-12\rotate.html, EnglishSource=c:\matlabr12\help\techdoc\ref\rotate.html)

MATLAB Function Reference

   

rotate

沿著指定的方向旋轉物件。

Syntax

rotate(h,direction,alpha)
rotate(...,origin)

Description

該指令依照右手定則的方向在三度空間中旋轉圖像物件。

rotate(h,direction,alpha) 旋轉物件 h  alpha 度。
direction is a two- or three-element vector that describes the axis of rotation in conjunction with the origin.

rotate(...,origin) s用一個三個元素的向量指定旋轉的圖軸原點。內定的原點為繪圖盒的中心。

Remarks

你想要旋轉的圖像物件必須為同一圖軸的兒子。物件的資料會被旋轉所改變。這跟 view rotate3d 相反,他們只會改變視角。

旋轉的圖軸由一個原點以及一個相對於原點的點P所定義。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 phi]. theta xy 平面上從x軸正向逆時針旋轉的角度。 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).

Examples

相對於x軸旋轉圖像物件180º

h = surf(peaks(20));
rotate(h,[1 0 0],180)

相對於其中心,把一個曲面圖像在z軸的方向上旋轉 45º

h = surf(peaks(20));
zdir = [0 0 1];
center = [10 10 0];
rotate(h,zdir,45,center)

Remarks

rotate 會改變對應的圖像物件的 Xdata, Ydata, 以及Zdata 值。

See Also

rotate3d, sph2cart, view

The axes CameraPosition, CameraTarget, CameraUpVector, CameraViewAngle

 

 

rot90

 

rotate3d