When autoloading a Maxima script, avoid clobbering global state.
[maxima.git] / interfaces / xmaxima / plotmaxima.html
blobf575aa1e9fea8691b076d82640d7553dc8197b19
1 <html>
3 <title>Maxima Plotting</title>
4 <body BGCOLOR=#ffffff TEXT=#000000 LINK=#244C21>
6 <br>
7 <h4>Maxima 3d Plotting</h4>
8 <br>
11 <pre>
12 - Function:<b> plot3d (expr, xrange, yrange,..., options,...)</b>
13 - Function:<b> plot3d ([expr1,expr2,expr3], xrange, yrange,..., options,...)</b>
14 </pre>
15 When viewed with the netmath plotting routines, you can rotate the object
16 by dragging with the right mouse button depressed.
17 <ul>
18 <li> <eval program=maxima> plot3d(2^(-u^2+v^2),[u,-2,2],[v,-2,2]);</eval>
19 would plot z = 2^(-u^2+v^2) with u and v varying in [-2,2] and
20 [-2,2] respectively, and with u on the x axis, and v on the y axis.
22 <li> a <b>moebius band uses the second pattern of arguments</b>
24 <eval program=maxima>
25 plot3d([cos(x)*(3+y*cos(x/2)), sin(x)*(3+y*cos(x/2)), y*sin(x/2)],
26 [x,-%pi,%pi],[y,-1,1],['grid,40,15]);</eval>
27 <br>
28 parametrized by the 3 expressions given as the first
29 argument to plot3d. An additional optional argument [grid,50,15]
30 gives the grid number of rectangles in the x direction and y
31 direction.
33 <li>A <b>Riemann surface</b>: Real part of z^1/3
34 <eval program=maxima>
35 plot3d(r^.33*cos(th/3),[r,0,1],[th,0,6*%pi],
36 ['grid,12,80],
37 ['transform_xy,polar_to_xy]);</eval>
39 <li> a <b>Klein bottle</b>:
40 <eval program=maxima>
41 plot3d([5*cos(x)*(cos(x/2)*cos(y)+sin(x/2)*sin(2*y)+3.0) - 10.0,
42 -5*sin(x)*(cos(x/2)*cos(y)+sin(x/2)*sin(2*y)+3.0),
43 5*(-sin(x/2)*cos(y)+cos(x/2)*sin(2*y))],
44 [x,-%pi,%pi],[y,-%pi,%pi],['grid,40,40]);</eval>
46 <li>a <b>torus</b>
47 <eval program=maxima>
48 plot3d([cos(y)*(10.0+6*cos(x)),
49 sin(y)*(10.0+6*cos(x)),
50 -6*sin(x)],
51 [x,0,2*%pi],[y,0,2*%pi], ['grid,20,20]);</eval>