plottools
transform
generate procedure to transform plots
Calling Sequence
Parameters
Description
Examples
transform(f)
f

procedure
The transform command generates a procedure that can be used to change plot data structures by applying the procedure f to all the points in the plot structure.
The procedure f represents a mapping
$f:{R}^{m}\to {R}^{n}$
where m and n can take values 2 or 3. The procedure must take as input m arguments and output a list of n components.
Examples of the use of this command include embedding 2D plots into 3D space, changing coordinate systems or transforming curves in the complex plane into the Riemann Sphere.
The result of a call to transform is a procedure that takes a 2D or 3D plot data structure as parameter. You can assign the procedure to a variable, and apply the procedure to various plots. For more information about plot data structures, see plot/structure.
The transform command is usually used with [m, n] equal to [2, 2], [2, 3], or [3, 3]. It returns a transformation procedure in the case where m is 3 and n is 2. However, this procedure works only on those 3D plot objects that have 2D counterparts.
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.
If the transform command is applied to a filled shape, such as an arrow or rectangle, the polygon that is generated might not resemble the result one would expect from a transformation of the entire shape. That is because the transform command works only on the points of the plot data structure, which are typically the vertices and not interior points.
$\mathrm{with}\left(\mathrm{plottools}\right)\:$
$\mathrm{with}\left(\mathrm{plots}\right)\:$
Draw contour plots onto axes of 3D plots.
$p\u2254\mathrm{plot3d}\left(\frac{5x}{{x}^{2}+{y}^{2}+1}\,x=3..3\,y=3..3\,\mathrm{style}=\mathrm{contour}\,\mathrm{contours}=8\right)\:$
$q\u2254\mathrm{contourplot}\left(\frac{5x}{{x}^{2}+{y}^{2}+1}\,x=3..3\,y=3..3\,\mathrm{filled}=\mathrm{true}\right)\:$
$f\u2254\mathrm{transform}\left(\left(x\,y\right)\mapsto \left[x\,y\,\mathrm{3}\right]\right)\:$
$\mathrm{display}\left(\left\{p\,f\left(q\right)\right\}\,\mathrm{orientation}=\left[50\,40\right]\right)$
Change coordinate systems.
$p\u2254\mathrm{plot3d}\left(\left[{1.3}^{x}\mathrm{sin}\left(y\right)\,x\,y\right]\,x=1..2\mathrm{\pi}\,y=0..\mathrm{\pi}\right)\:$
$f\u2254\mathrm{transform}\left(\left(r\,\mathrm{th}\,\mathrm{ph}\right)\mapsto \left[r\cdot \mathrm{sin}\left(\mathrm{ph}\right)\cdot \mathrm{cos}\left(\mathrm{th}\right)\,r\cdot \mathrm{sin}\left(\mathrm{ph}\right)\cdot \mathrm{sin}\left(\mathrm{th}\right)\,r\cdot \mathrm{cos}\left(\mathrm{ph}\right)\right]\right)\:$
$\mathrm{display}\left(\left\{p\,f\left(p\right)\right\}\,\mathrm{orientation}=\left[145\,20\right]\,\mathrm{scaling}=\mathrm{constrained}\right)$
See Also
plot/structure
plot3d
plots[changecoords]
plots[contourplot]
plots[display]
Download Help Document
What kind of issue would you like to report? (Optional)