rotate PLOT and PLOT3D data structures - Maple Help

Home : Support : Online Help : Graphics : Packages : Plot Tools : plottools/rotate

plottools[rotate] - rotate PLOT and PLOT3D data structures

 Calling Sequence rotate(p, ang, pt_2d) rotate(q,alpha,beta,gamma) rotate(q,alpha,[pt_3d_1,pt_3d_2])

Parameters

 p - PLOT data structure or a 2-D object ang - counter-clockwise rotation angle in radians pt_2d - (optional) list of 2 real numbers specifying the center of the rotation (for the 2-D case) q - PLOT3D data structure or a 3-D object alpha - rotation angle around x-axis in radians beta - rotation angle around y-axis in radians gamma - rotation angle around z-axis in radians pt_3d_1, pt_3d_2 - (optional) lists of 3 real numbers

Description

 • The rotate command takes a plot structure or object and produces a new plot structure or object rotated by the specified angle(s).
 • The inputs p and q must be PLOT and PLOT3D data structures or objects.  For 2-D plots and objects, ang represents the counter-clockwise rotation angle.
 • For 3-D plots and objects, the original rectangular coordinate system with x, y, and z-axes is brought into coincidence with a second rectangular coordinate system with the same origin and x1, y1, and z1-axes. This is done by rotating about the x-axis through an angle alpha, then about the y-axis through an angle beta, and finally about the z-axis through an angle gamma. All rotations follow the left-hand rule, that is, if you point your left thumb in the positive direction of the axis, then your fingers curl in the direction of the rotation.
 • If the calling sequence is of the form rotate(q, alpha, [pt_3d_1, pt_3d_2]), then pt_3d_1 and pt_3d_2 define the axis of rotation.
 • The result of a call to rotate is a 2-D or 3-D plot structure or object that can be displayed with the plots[display] command. You can assign the data structure to a variable, save it in a file, then read it for redisplay.  For more information about plot data structures, see plot/structure and plot3d/structure.
 • Several commands in the plottools package can transform plots. For a list, see the plottools help page.  The plots[changecoords] and plots[display] commands can also be used to transform plots.

Examples

 > $\mathrm{with}\left(\mathrm{plottools}\right):$
 > $\mathrm{with}\left(\mathrm{plots}\right):$
 > $p:=\mathrm{plot}\left(\left[\mathrm{sin}\left(x\right),x,x=0..2\mathrm{π}\right]\right):$
 > $r:=\mathrm{rotate}\left(p,\frac{\mathrm{π}}{3}\right):$
 > $\mathrm{display}\left(p,r\right)$
 > $p:=\mathrm{plot3d}\left(\left[{1.3}^{x}\mathrm{sin}\left(y\right),x,y\right],x=-1..2\mathrm{π},y=0..\mathrm{π}\right):$
 > $r:=\mathrm{rotate}\left(p,\mathrm{π},\frac{\mathrm{π}}{2},\mathrm{π}\right):$
 > $\mathrm{display}\left(p,r,\mathrm{axes}=\mathrm{frame},\mathrm{orientation}=\left[120,50\right],\mathrm{style}=\mathrm{patchnogrid}\right)$
 > $\mathrm{display}\left(\mathrm{rotate}\left(\mathrm{hyperbola}\left(\left[0,0\right],0.5,0.5,-1..1\right),\frac{\mathrm{π}}{4}\right),\mathrm{color}=\mathrm{red}\right)$
 > ${r}_{0}:=\mathrm{sphere}\left(\left[3,0,0\right],1,\mathrm{grid}=\left[25,25\right]\right):$
 > $a:=\frac{\mathrm{π}}{4}:$$c:=1:$
 > $\mathbf{while}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{evalf}\left(a-2\mathrm{π}\right)<0\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{r}_{c}:=\mathrm{rotate}\left({r}_{0},a,\left[\left[0,0,0\right],\left[0,0,1\right]\right]\right);\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}a:=a+\frac{\mathrm{π}}{4};\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}c:=c+1\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end do}:$$\mathrm{display}\left(\left[\mathrm{seq}\left({r}_{i},i=0..c-1\right)\right],\mathrm{scaling}=\mathrm{constrained},\mathrm{style}=\mathrm{hidden},\mathrm{lightmodel}=\mathrm{light4},\mathrm{orientation}=\left[10,-125\right],\mathrm{shading}=\mathrm{zhue}\right)$