Kapitel 20
> restart:
> with(plots):
Warning, the name changecoords has been redefined
> plot3d( x^2-y^2, x=-1..1, y=-1..1);
> plot3d( Im(sin(x+I*y)), x=0..2*Pi,y=-Pi/2..Pi/2, axes=boxed );
> plot3d( sin(x*y), x=0..7, y=0..7, axes=framed, scaling=constrained);
>
plot3d( sin(x*y), x=0..7, y=0..7, axes=framed,
grid=[50,50], scaling=constrained, orientation=[-45,60]);
>
plot3d( sin(6*sqrt(x^2+y^2)), y=-2..2, x=-2..2,
grid=[40,40], scaling=constrained,
orientation=[7,45], projection=1);
>
plot3d( sin(6*sqrt(x^2+y^2)),
y=-2..2, x=-2..2, grid=[40,40],
scaling=constrained, orientation=[7,45], projection=0);
>
plot3d( Re(tan(x+I*y)),
x=0.05-Pi/2..0.05+Pi, y=-Pi/2..Pi/2,
orientation=[-126,55],scaling=unconstrained,
axes=boxed,grid=[40,40]);
>
plot3d( Re(tan(x+I*y)),
x=0.05-Pi/2..0.05+Pi, y=-Pi/2..Pi/2,
orientation=[-126,55], scaling=unconstrained,
axes=boxed, grid=[40,40], view=-5..4.5 );
>
plot3d( [sin(s)*cos(t), cos(s)*cos(t), sin(t)],
s=0..Pi, t=0..2*Pi, scaling=constrained );
>
with(plots):
spacecurve( [ t/10, (1+t/10)*sin(t), (1+t/10)*cos(t) ], t=0..30*Pi,
numpoints=500, axes=framed, shading=none, orientation=[25,62] );
>
tubeplot( [2*sin(t), 2*cos(t), t/3], t=-1.5*Pi..2*Pi,
orientation=[45,68]);
>
tubeplot( [ -t^1.5/5, 3*cos(t), 3*sin(t) ],
t=0..8*Pi, radius=t/8, scaling=constrained,
orientation=[107,56], grid=[60,15] );
Flächen durch Listen definieren
> restart: with(plots):
Warning, the name changecoords has been redefined
>
listplot3d( [[0,0,0,0,0],
[0,0,1,2,2],
[0,1,2,1,0],
[0,2,3,2,0]],
axes=frame, style=hidden,
color=black, orientation=[45,11]);
> setoptions3d(style=hidden,color=black):
>
data := [ seq( [ seq( [ i,j,evalf(cos(sqrt(i^2+j^2)/2)) ],
i=-5..5) ], j=-5..5) ]:
> surfdata( data, axes=frame, labels=[x,y,z] );
> #data;
Liste variabler Länge und Schrittweite, die sich auch schachteln lässt.
> varlf:=(term,var,a,b,n) -> seq(eval(term),var=seq(a+i*(b-a)/n,i=0..n));
>
> data:=varlf([varlf([r*sin(phi), r*cos(phi), 1.5*phi+3*sin(r)],r,Pi,2*Pi,14)],phi,0,4*Pi,41):
>
>
surfdata(evalf([ data ]),orientation=[6,60]);
>
> restart: with(plots):
Warning, the name changecoords has been redefined
>
plot3d( [sin(s)*cos(t), cos(s)*cos(t), t],
s=0..2*Pi, t=0..Pi, grid=[80,20],
shading=none, scaling=constrained, style=point);
> data:= [seq( evalf( [t/100, sin(t/30), cos(t/30)] ),t=0..1000) ]:
>
pointplot3d(data, shading=none, axes=boxed);
>
> restart:
>
with(plots):
p:=plot3d( -5*cos(sqrt(x^2+y^2))*exp(-0.1 *sqrt(x^2+y^2)),
x=-2*Pi..7*Pi, y=-2*Pi..4*Pi,grid=[45,35], axes=framed,
scaling=constrained,orientation=[-157,62]):
Warning, the name changecoords has been redefined
> p;
Darstellungsart
> ######### shading=none funktioniert nicht zusammen mit hidden und wireframe
>
display(p, style=hidden,shading=Z);
>
> display(p, color=black,style=wireframe);
>
display(p, style=patchnogrid);
>
display(p, style=patchcontour);
>
display(p, style=patchcontour, contours=[-2,-1,0,1,2]);
Farben
> display(p, style=patchnogrid, shading=zhue);
> p1:=plot3d( 1.5*cos(x^2+y^2), x=-2..2, y=-2..2, style=hidden, color=red):
>
p2:=plot3d( 2*sin(sqrt(x^2+y^2)),x=-2..2, y=-2..2, style=hidden, color=blue):
display( [p1, p2] );
>
greyscale:=x->COLOR(RGB,x,x,x):
plot3d( Re(sin(x+I*y)),
x=0..2*Pi, y=-1..1, axes=framed, style=patch,
orientation=[-103,26], color=greyscale(Im(sin(x+I*y))) );
>
greyscale:=x->COLOR(RGB,x,x,x):
plot3d( abs(sin(x+I*y)), x=0..2*Pi, y=-1..1, axes=framed, style=patch,
orientation=[-103,26], color=greyscale( Pi+argument(sin(x+I*y)) ) );
Beleuchtung
>
p:=plot3d( [sin(s)*cos(t), cos(s)*cos(t), sin(t)],
s=0..Pi, t=0..2*Pi, style=patch, scaling=constrained,
color=white, orientation=[38,75]):
>
with(plots): display(p);
> display( p, light=[60,45,1,1,1]);
> display( p, light=[60,45,1,1,1],ambientlight=[0.3,0.3,0.3]);
> display( p, light=[60,45,1,0,0], light=[60,-45,0,1,0],light=[135,0,0,0,1]);