Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Geometry
6.1
Maple:
with(plots):
pointplot3d(points,ops);
listplot(list,ops);
with(Statistics):
pointplot(points,ops);
matrixplot(matrix,ops);
listplot3d(list,ops);
ScatterPlot(seqX,seqY,ops);
Mathematica:
ListPlot[{{x1,y1},{x2,y2},...,{xn,yn}},
PlotRange->val,Filling->val,FillingStyle->val,DataRange->val,
MaxPlotPoints->val,Joined->True,PlotMarkers->val,
PlotStyle->Directive[PointSize[val],valColor]]
ListLinePlot[{{x1,y1},{x2,y2},...,{xn,yn}},ops]
ListPlot3D[{{x1,y1,z1},...},MeshShading->val,ops]
ListPointPlot3D[{{x1,y1,z1},...},ops]
Show[Graphics3D[{PointSize[s],Point[{x1,y1,z1}],...}]]
190
Geometry
Maple:
with(plots):
f:=x->x^3/9+3; g:=x->x^2/2+2; L:=[f(x),g(x)];
plot(L,x=-4..4,-1..11,color=[green,blue],thickness=[3,5]);
S:=[fsolve(f(x)=g(x),x)];
for i from 1 to nops(S) do
Y[i]:=eval(f(x),x=S[i]); eval(g(x),x=S[i]);
od;
P:=[seq([S[i],Y[i]],i=1..nops(S))];
G1:=plot(L,x=-4..4,-1..11,color=[green,blue],
thickness=[3,5]): G2:=pointplot(P,color=red,
symbol=circle,symbolsize=30):
display({G1,G2});
Mathematica:
f[x_]:=x^3/9+3; g[x_]:=x^2/2+2;
SetOptions[Plot,PlotRange->{{-4,4.1},{-1,11}},
PlotStyle->{{Green,Thickness[0.008]},{Blue,Thickness[0.015]}}]
Plot[{f[x],g[x]},{x,-4,4}]
{s=NSolve[f[x]==g[x],x],n=Length[s],y=f[x]/.s,z=g[x]/.s}
points=Table[{Flatten[s][[i,2]],y[[i]]},{i,1,n}]
g1=Plot[{f[x],g[x]},{x,-4,4}];
g2=ListPlot[points,PlotStyle->{Red,PointSize[0.04]}];
Show[{g1,g2}]
Problem 6.2 Graph the points (0, 1, 1), (0, 5, 0), (0, 1, 0), (0, 4, 2).
Maple:
plots[pointplot3d]({[0,-1,1],[0,-5,0],[0,-1,0],[0,4,2]},
axes=boxed,symbol=circle,symbolsize=20,color=blue);
Mathematica:
Show[Graphics3D[{PointSize[0.05],Hue[Random[]],
Point[{0,-1,1}],Point[{0,-5,0}],Point[{0,-1,0}],
Point[{0,4,2}]},BoxRatios->{2,2,1},
ViewPoint->{5.759,2.606,-1.580}],BoxRatios->1]
6.2
Parametric Curves
191
Mathematica:
n=100; list1=Table[{i,i^3},{i,1,n}];
SetOptions[ListPointPlot3D,PlotStyle->
Directive[Magenta,PointSize[0.02]],BoxRatios->{1,1,1},
ColorFunction->Function[{x,y,z},Hue[z]]];
ListPlot[list1,PlotStyle->Directive[PointSize[0.01],Red]]
ListPlot[list1,Joined->True,PlotStyle->Blue]
ListLinePlot[list1,PlotStyle->Blue]
ListPlot[Table[{i,Random[Real,{-5,5}]},{i,-5,5}],
Joined->True,Filling->Axis,FillingStyle->LightPurple]
ListPlot3D[Flatten[Table[{i,Sin[2*i]*Cos[3*j]},
{j,1,4},{i,1,4}],1],BoxRatios->{1,1,1},Mesh->False,
ColorFunction->Function[{x,y,z},Hue[z]]]
points1=Flatten[Table[{i,Sin[i]+Cos[j],Sin[i]+Cos[k]},
{k,1,3},{j,1,3},{i,1,3}],2];
points2=Table[{Cos[Pi*t/10],Sin[Pi*t/10],Pi*t/10},{t,0,40}];
ListPointPlot3D[points1]
ListPointPlot3D[points2]
6.2
Parametric Curves
192
Geometry
Maple:
plot([x(t),y(t),t=t1..t2],x1..x2,y1..y2,ops);
plot([t^2*sin(t),t^3*cos(t),t=-10*Pi..10*Pi],axes=boxed);
plot([(-t)^3*cos(t),(-t)^2*sin(t),t=-8*Pi..8*Pi]);
Mathematica:
ParametricPlot[{x[t],y[t]},{t,t1,t2},ops]
SetOptions[ParametricPlot,AspectRatio->1,PlotRange->All,
PlotStyle->{Red,Thickness[0.005]},Frame->True];
ParametricPlot[{t^2*Sin[t],t^3*Cos[t]},{t,-10*Pi,10*Pi}]
ParametricPlot[{(-t)^3*Cos[t],(-t)^2*Sin[t]},{t,-8*Pi,8*Pi}]
spacecurve([x(t),y(t),z(t)],t=t1..t2,ops);
with(plots):
x:=t->-1/2*cos(3*t); y:=t->-1/4*sin(3*t); z:=t->1/7*t;
spacecurve([x(t),y(t),z(t)],t=0..10*Pi,numpoints=400);
Mathematica:
ParametricPlot3D[{x[t],y[t],z[t]},{t,t1,t2},ops]
x[t_]:=-1/2*Cos[3*t]; y[t_]:=-1/4*Sin[3*t];
z[t_]:=1/7*t; Evaluate[ParametricPlot3D[{x[t],y[t],z[t]},
{t,0,10*Pi},PlotPoints->200,BoxRatios->{1,1,1},
ColorFunction->Function[{x,y,z},Hue[z]],Axes->None,
Boxed->False]]
Problem 6.4 Let g(x, y) = cos 2x sin(2y) . Graph the intersection of
g(x, y) with the planes x = 5, y = 0.5.
6.2
Parametric Curves
193
Maple:
with(plots): g:=(x,y)->cos(2*x-sin(2*y)):
plot3d(g(x,y),x=0..2*Pi,y=0..2*Pi,axes=boxed);
G1:=spacecurve([5,t,0],t=0..2*Pi):
G2:=spacecurve([5,t,g(5,t)],t=0..2*Pi):
G3:=spacecurve([t,0.5,0],t=0..2*Pi):
G4:=spacecurve([t,0.5,g(t,0.5)],t=0..2*Pi):
display3d({G1,G2},axes=boxed);
display3d({G3,G4},axes=boxed);
spacecurve({[5,t,0],[5,t,g(5,t)],[t,0.5,0],
[t,0.5,g(t,0.5)]},t=0..2*Pi,axes=boxed);
Mathematica:
g[x_,y_]:=Cos[2*x-Sin[2*y]];
SetOptions[ParametricPlot3D,BoxRatios->{1,1,1},
ColorFunction->Function[{x,y,z},Hue[z]],
PlotRange->{All,All,All}];
Plot3D[g[x,y],{x,0,2*Pi},{y,0,2*Pi},Mesh->False]
g1=ParametricPlot3D[{5,t,0},{t,0,2*Pi}];
g2=ParametricPlot3D[{5,t,g[5,t]},{t,0,2*Pi}];
g3=ParametricPlot3D[{t,0.5,0},{t,0,2*Pi}];
g4=ParametricPlot3D[{t,0.5,g[t,0.5]},{t,0,2*Pi}];
GraphicsColumn[{Show[{g1,g2}],Show[{g3,g4}]}]
Show[{g1,g2,g3,g4}]
x2 sin(4y)
y 2 cos(4x)
for (x, y) on the
Maple:
with(plots): f:=(x,y)->x^2*sin(4*y)-y^2*cos(4*x);
spacecurve({[cos(t),sin(t),0],[cos(t),sin(t),
f(cos(t),sin(t))]},t=0..2*Pi,axes=boxed,numpoints=200);
Mathematica:
SetOptions[ParametricPlot3D,BoxRatios->{1,1,1},
ColorFunction->Function[{x,y,z},Hue[z]],PlotPoints->200];
f[x_,y_]:=x^2*Sin[4*y]-y^2*Cos[4*x];
g1=ParametricPlot3D[{Cos[t],Sin[t],0},{t,0,2*Pi}];
g2=ParametricPlot3D[{Cos[t],Sin[t],f[Cos[t],Sin[t]]},
{t,0,2*Pi}]; Show[g1,g2]
194
6.3
Geometry
Maple:
implicitplot(f(x,y)=c,x=x1..x2,y=y1..y2,ops);
Mathematica:
ContourPlot[f[x,y]==c,{x,x1,x2},{y,y1,y2},ops]
ContourPlot[{f1[x,y]==c1,f2[x,y]==c2,...},{x,x1,x2},{y,y1,y2}]
f[x_,y_]:=x^2-x+y^2-y+2;
ContourPlot[f[x,y]==21,{x,-10,10},{y,-10,10},
Frame->True,PlotRange->Automatic]
ContourPlot[Sin[x+y]==x*Cos[x],{x,-10,10},{y,-10,10}]
6.4
Maple:
with(plots):
plot([r(t),theta(t),t=t1..t2],coords=polar,ops);
polarplot([r(t),theta(t),theta=theta1..theta2]);
Mathematica:
PolarPlot[f[t],{t,t1,t2},ops]
ParametricPLot[{r*Cos[t],r*Sin[t]},{t,t1,t2},ops]
6.4
195
Maple:
with(plots): for i from 1 to 3 do
n:=ithprime(i): m:=ithprime(i+1): x:=sin(n*t): y:=cos(m*t):
plot([x,y,t=0..2*Pi],scaling=constrained,colour=red); od;
G:=[seq(plot([sin(ithprime(i)*t),cos(ithprime(i+1)*t),
t=0..2*Pi],scaling=constrained,colour=blue),i=1..10)]:
display(G,insequence=true);
Mathematica:
SetOptions[ParametricPlot,PlotStyle->Blue,PlotRange->All,
Frame->True,FrameTicks->False,AspectRatio->1];
Do[n=Prime[i]; m=Prime[i+1]; x=Sin[n*t]; y=Cos[m*t];
Print[ParametricPlot[{x,y},{t,0,2*Pi},PlotStyle->Blue,
PlotRange->All,Frame->True,FrameTicks->False,
AspectRatio->1]],{i,1,3}];
{ps=Table[Prime[i],{i,1,10}],pN=Length[ps]}
g=Table[ParametricPlot[{Sin[ps[[k]]*t],Cos[ps[[k+1]]*t]},
{t,0,2*Pi}],{k,1,pN-1}]; ListAnimate[g,AnimationRate->1]
Problem 6.7 Plot the rose function, r = sin(n) (n = 1, . . . , 5), Fermats
spiral, r 2 = , Archimedes spiral, r = , the hyperbolic spiral, r = 1/,
the cardioid, r = a(1 + cos ) (a > 0), the lemniscate, r 2 = a2 cos(2)
(a > 0), the logarithmic spiral, r = aeb (a > 0, |b| < 1).
Maple:
with(plots): A:=array(1..5): a:=1; b:=0.1;
for i from 1 to 5 do
A[i]:=polarplot([sin(i*t),1],t=0..2*Pi,thickness=[2,1],
title=convert(n=i,string),color=[blue,red]) od:
display(A,axes=none,scaling=constrained);
plot([sqrt(t),t,t=0..17*Pi],coords=polar);
polarplot([t,t,t=0..17*Pi]);
polarplot([1/t,t,t=0..17*Pi],-0.4..0.4);
polarplot([a*(1+cos(t)),t,t=0..17*Pi]);
polarplot([a*sqrt(cos(2*t)),t,t=0..17*Pi],numpoints=1000);
polarplot([a*exp(b*t),t,t=0..17*Pi],numpoints=200);
196
Geometry
Mathematica:
a=1; b=0.1; SetOptions[PolarPlot,Frame->True,PlotRange->All,
ImageSize->150,AspectRatio->1];
GraphicsRow[Table[PolarPlot[{Sin[i*t],1},{t,0,2*Pi},PlotStyle->
{{Blue,Thickness[0.03]},{Red,Thickness[0.01]}},FrameTicks->
False,PlotLabel->Row[{"n=",i}]],{i,1,5}]]
GraphicsRow[{PolarPlot[Sqrt[t],{t,0,17*Pi},PlotRange->{-6,6}],
PolarPlot[t,{t,0,17*Pi}],PolarPlot[1/t,{t,0.0001,10*Pi},
PlotRange->{{-0.4,0.4},{-1,1}}],PolarPlot[a*(1+Cos[t]),
{t,0,17*Pi}],PolarPlot[a*Sqrt[Cos[2*t]],{t,0,17*Pi},
PlotPoints->200]}]
PolarPlot[a*Exp[b*t],{t,0,17*Pi},PlotPoints->200]
Problem 6.8 Find the area between the graphs, r1 = 1 and r2 = cos(3t).
Maple:
with(plots): r1:=t->1; r2:=t->cos(3*t); Rt:=0..2*Pi;
plot([r1(t),r2(t)],t=Rt,view=[Rt,-1..1]);
polarplot([r1(t),r2(t)],t=Rt,view=[-1..1,-1..1]);
Circ:=Pi; Rose:=3/2*int(r2(t)^2,t=-Pi/6..Pi/6);
AreaG:=evalf(Circ-Rose);
Mathematica:
r1[t_]:=1; r2[t_]:=Cos[3*t]; nD=10;
Plot[{r1[t],r2[t]},{t,0,2*Pi},
PlotRange->{{0,2*Pi},{-1,1}},PlotStyle->Blue]
PolarPlot[{r1[t],r2[t]},{t,0,2*Pi},
PlotRange->{{-1,1},{-1,1}},PlotStyle->Hue[0.9]]
{circ=Pi, rose=3/2*Integrate[r2[t]^2,{t,-Pi/6,Pi/6}],
areaG=N[circ-rose,nD]}
6.5
Problem 6.9 Let f (x) = x3 4x2 + 5x 2. Plot f (x), the secant line
passing through some two points, for instance, (b, f (b)), (b + t, f (b + t)),
for various values of t and b = 1; and the tangent line passing through
some point, for instance, (a, f (a)), for various values of a.
6.6
197
Maple:
with(plots): f:=x->x^3-4*x^2+5*x-2; b:=1;
SL:=(x,t)->((f(b+t)-f(b))/t)*(x-b)+f(b);
TL:=(x,t)->D(f)(t)*(x-t)+f(t);
G1:=animate(f(x),x=0..4,t=0.1..2,frames=100,
view=[0..3,-2..2],thickness=10,color=plum):
G2:=animate(SL(x,t),x=0..4,t=0.1..2,frames=100,
view=[0..3,-2..2],thickness=5,color=green):
G3:=animate(TL(x,a),x=0..4,a=0.1..2.9,frames=100,
view=[0..3,-2..2],thickness=5,color=blue):
display([G1,G2,G3]); with(Student[Calculus1]):
for a from 0.1 to 2.9 by 0.5 do Tangent(f(x),x=a); od;
Tangent(f(x),x=0.1,output=plot);
Tangent(f(x),x=0.1,output=plot,showpoint=false,
tangentoptions=[color=blue,thickness=5]);
Mathematica:
f[x_]:=x^3-4*x^2+5*x-2; b=1;
secL[x_,t_]:=((f[b+t]-f[b])/t)*(x-b)+f[b];
tanL[x_,t_]:=f[t]+f'[t]*(x-t);
SetOptions[Plot,PlotRange->{{0,3},{-2,2}}];
g=Plot[f[x],{x,0,4},PlotStyle->{Hue[0.85],Thickness[0.01]}];
Animate[Show[g,Plot[secL[x,t],{x,0,4},PlotStyle->
{Green,Thickness[0.01]}],Plot[tanL[x,t],{x,0,4},PlotStyle->
{Blue,Thickness[0.01]}]],{t,0.1,2},AnimationRate->0.1]
6.6
with(plots): tubeplot([2*sin(t),cos(t)-sin(2*t),cos(2*t)],
t=0..2*Pi,axes=boxed,radius=0.25,numpoints=100,
scaling=constrained);
198
Geometry
tubeplot([-2*cos(t)+2*cos(2*t)+2*sin(2*t),
-2*cos(2*t)+2*sin(t)-2*sin(2*t),-2*cos(2*t)],t=0..2*Pi,
axes=boxed,radius=0.25,numpoints=100,color=gold);
Mathematica:
ParametricPlot3D[{x[t],y[t],z[t}},{t,t1,t2},
PlotStyle->{Tube[r]},ops]
{curve1={2*Sin[t],Cos[t]-Sin[2*t],Cos[2*t]},
curve2={-2*Cos[t]+2*Cos[2*t]+2*Sin[2*t],-2*Cos[2*t]+
2*Sin[t]-2*Sin[2*t],-2*Cos[2*t]}}
ParametricPlot3D[curve1,{t,0,2*Pi},PlotStyle->{Tube[0.2],
Hue[Random[]]},PlotRange->All,BoxRatios->{1,1,1}]
ParametricPlot3D[curve2,{t,0,2*Pi},PlotStyle->{Tube[0.2],
Hue[Random[]]},PlotRange->All,BoxRatios->{1,1,1}]
6.7
Surfaces in Space
Parametrically dened surfaces, x = x(u, v), y = y(u, v), z = z(u, v), and
implicitly dened surfaces, f (x, y, z) = c.
Maple:
with(plots): plot3d([x(u,v),y(u,v),z(u,v)],u=u1..u2,v=v1..v2);
implicitplot3d(f(x,y,z)=c,x=x1..x2,y=y1..y2,z=z1..z2);
with(plots): F:=(x,y,z)->-x^2-2*y^2+z^2-4*y*z;
implicitplot3d({F(x,y,z)=-100,F(x,y,z)=0,
F(x,y,z)=100},x=-6..6,y=-6..6,z=-6..6);
6.7
Surfaces in Space
199
Mathematica:
ParametricPlot3D[{x[u,v],y[u,v],z[u,v]},{u,u1,u2},{v,v1,v2}]
ContourPlot3D[f[x,y,z],{x,x1,x2},{y,y1,y2},{z,z1,z2},
Contours->{c1,c2,...},ops]
F[x_,y_,z_]:=-x^2-2*y^2+z^2-4*y*z;
ContourPlot3D[F[x,y,z],{x,-6,6},{y,-6,6},{z,-6,6},
Contours->{-100,0,100}]
x2 y 2
+ +z 2 = 1, the hyperboloid of one
16 4
x2 y 2 z 2
x2 y 2
+ z 2 =1, and the hyperboloid of two sheets
=1.
sheet
16 4
9
4
4
Maple:
Problem 6.10 Plot the ellipsoid
with(plots): x:=(u,v)->3*cos(u)*cos(v);
y:=(u,v)->2*cos(u)*sin(v); z:=(u,v)->sin(u);
plot3d([x(u,v),y(u,v),z(u,v)],u=-Pi/2..Pi/2,v=-Pi..Pi,
axes=boxed, orientation=[58,60]);
x:=(u,v)->4*sec(u)*cos(v); y:=(u,v)->2*sec(u)*sin(v);
z:=(u,v)->tan(u);
plot3d([x(u,v),y(u,v),z(u,v)],u=-Pi/4..Pi/4,v=-Pi..Pi,
axes=boxed,orientation=[10,72],color=green);
implicitplot3d(x^2/9-y^2/4-z^2/4=1,x=-10..10,y=-8..8,
z=-5..5,axes=normal,numpoints=500,orientation=[63,43]);
Mathematica:
SetOptions[ParametricPlot3D,
BoxRatios->{1,1,1}]; x[u_,v_]:=3*Cos[u]*Cos[v];
y[u_,v_]:=2*Cos[u]*Sin[v]; z[u_,v_]:=Sin[u];
ParametricPlot3D[{x[u,v],y[u,v],z[u,v]},
{u,-Pi/2,Pi/2}, {v,-Pi,Pi}]
x[u_,v_]:=4*Sec[u]*Cos[v]; y[u_,v_]:=2*Sec[u]*Sin[v];
z[u_,v_]:=Tan[u]; ParametricPlot3D[
{x[u,v],y[u,v],z[u,v]},{u,-Pi/4,Pi/4},{v,-Pi,Pi}]
ContourPlot3D[x^2/9-y^2/4-z^2/4,{x,-10,10},{y,-8,8},
{z,-5,5},Contours->{1}]
200
6.8
Geometry
Maple:
with(plots):
contourplot(f(x,y),x=x1..x2,y=y1..y2,ops);
contourplot3d(f(x,y,z),x=x1..x2,y=y1..y2,ops);
Mathematica:
ContourPlot[f1[x,y],{x,x1,x2},{y,y1,y2},ops]
ContourPlot3D[f2[x,y,z], {x,x1,x2},{y,y1,y2},{z,z1,z2},ops]
list1=Table[f1[x,y],{x,x1,x2},{y,y1,y2}]
list2=Table[f2[x,y,z],{z,z1,z2},{y,y1,y2},{x,x1,x2}]
ListContourPlot[list1,ops]
ListContourPlot3D[list2,ops]
6.9
Surfaces of Revolution
201
xy
and some level curves,
x2 + y 2
Maple:
with(plots);
h:=(x,y)->(x-y)/(x^2+y^2); R:=-4..4; C:=[-0.5,-0.9,-1.5];
plot3d(h(x,y),x=R,y=R,grid=[50,50],orientation=[15,67]);
contourplot(h(x,y),x=R,y=R,grid=[150,150],
axes=boxed,contours=20); contourplot(h(x,y),x=R,y=R,
grid=[150,150],axes=boxed,contours=C);
Mathematica:
h[x_,y_]:=(x-y)/(x^2+y^2);
SetOptions[ContourPlot,AspectRatio->1,ImageSize->300];
Plot3D[h[x,y],{x,-4,4},{y,-4,4},PlotPoints->{20,20},
BoxRatios->{1,1,1},PlotRange->All]
GraphicsRow[{ContourPlot[Evaluate[h[x,y]],{x,-4,4},{y,-4,4},
Contours->20,ContourShading->False,PlotPoints->{80, 80}],
ContourPlot[h[x,y],{x,-4,4},{y,-4,4},Contours->
{-0.5,-0.9,-1.5},ContourShading->False,ContourStyle->Blue],
ContourPlot[h[x,y]==-0.5,{x,-4,4},{y,-4,4},ContourShading->
False,ContourStyle->Blue]}]
6.9
Surfaces of Revolution
202
Geometry
Mathematica:
RevolutionPlot3D[fz,{t,t1,t2},ops]
RevolutionPlot3D[{fz,t},{t,t1,t2},ops]
RevolutionPlot3D[{fx,fz},{t,t1,t2},ops]
RevolutionPlot3D[{fx,fy,fz},{t,t1,t2},ops]
Mathematica:
f[x_]:=x^2;
RevolutionPlot3D[f[x],{x,0,1},BoxRatios->{1,1,1}]
RevolutionPlot3D[{f[x],x},{x,0,1},BoxRatios->{1,1,1}]
RevolutionPlot3D[{t,t^2},{t,0,1},BoxRatios->{1,1,1}]
RevolutionPlot3D[{t,t^2},{t,0,1},
BoxRatios->{1,1,1},ViewVertical->{-1,0,0}]
6.10
Vector Fields
6.10
203
Vector Fields
gradplot(f(x,y),x=x1..x2,y=y1..y2,ops);
fieldplot([f(x,y),g(x,y)],x=x1..x2,y=y1..y2,ops);
fieldplot3d([f(x,y,z),g(x,y,z),h(x,y,z)],x=x1..x2,y=y1..y2,
z=z1..z2,ops);
gradplot3d(f(x,y,z),x=x1..x2,y=y1..y2,z=z1..z2,ops);
with(plots): Rx:=-5..5; Ry:=-4*Pi..4*Pi;
contourplot(x*cos(y)+4*x-sin(y),x=Rx,y=Ry,grid=[50,50]);
fieldplot([x*sin(y)+cos(y),cos(y)+4],x=Rx,y=Ry,
grid=[30,30],arrows=slim,color=x);
gradplot((1+2*x^2)*(y-1)/(1+2*y^2),x=-1..1,y=-1..1,
grid=[20,20],arrows=thick,color=x^2);
fieldplot3d([x-20*y+20*z,x-4*y+20*z,x-4*y+20*z],x=-4..4,
y=-8..8,z=-8..8,grid=[9,9,9],scaling=constrained,axes=boxed);
gradplot3d(10*x^2-5*y^2+2*z^2-10,x=-1..1,y=-1..1,z=-1..1,
axes=boxed,grid=[7,7,7]);
Mathematica:
<<VectorFieldPlots`
VectorFieldPlot[{fx,fy},{x,x1,x2},{y,y1,y2},ops]
VectorFieldPlot3D[{fx,fy,fz},{x,x1,x2},{y,y1,y2},{z,z1,z2},ops]
GradientFieldPlot[f[x,y],{x,x1,x2},{y,y1,y2},ops]
GradientFieldPlot3D[f[x,y,z],{x,x1,x2},{y,y1,y2},{z,z1,z2},ops]
ListVectorFieldPlot[{field1,field2,...},ops]
ListVectorFieldPlot3D[{field1,field2,...},ops]
HamiltonianFieldPlot[f[x,y],{x,x1,x2},{y,y1,y2},ops]
<<VectorFieldPlots`
ContourPlot[x*Cos[y]+4*x-Sin[y],{x,-5,5},{y,-4*Pi,4*Pi}]
VectorFieldPlot[{x*Sin[y]+Cos[y],Cos[y]+4},{x,-5,5},
{y,-4*Pi,4*Pi},BaseStyle->Blue,AspectRatio->1]
VectorFieldPlot3D[{x-20*y+20*z,x-4*y+20*z,x-4*y+20*z},
{x,-4,4},{y,-8,8},{z,-8,8},PlotPoints->9,VectorHeads->True]
204
Geometry
GradientFieldPlot[(1+2*x^2)*(y-1)/(1+2*y^2),
{x,-1,1},{y,-1,1},BaseStyle->Blue]
GradientFieldPlot3D[10*x^2-5*y^2+2*z^2-10,{x,-1,1},
{y,-1,1},{z,-1,1}]
6.11
Cylindrical Coordinates
Maple:
with(plots):
Rtheta:=theta1..theta2;
Rr:=r1..r2;
cylinderplot(f(r,theta),theta=Rtheta,r=Rr,ops);
cylinderplot([r(theta),theta,r],theta=Rtheta,r=Rr,ops);
with(plots): f:=(r,theta)->cos(r)-(2+sin(4*theta));
cylinderplot(f(r,theta),theta=0..2*Pi,r=0..4*Pi,grid=[50,50]);
Mathematica:
RevolutionPlot3D[fz,{r,r1,r2},{t,t1,t2},ops]
RevolutionPlot3D[{fz,r},{r,r1,r2},{t,t1,t2},ops]
RevolutionPlot3D[{fx,fz},{r,r1,r2},{t,t1,t2},ops]
f[r_,theta_]:=Cos[r]-(2+Sin[4*theta]);
RevolutionPlot3D[Evaluate[{f[r,theta],r}],{r,0,4*Pi},
{theta,0,2*Pi},BoxRatios->{1,1,1},PlotPoints->20]
6.12
Spherical Coordinates
6.12
205
Spherical Coordinates
Maple:
with(plots):
Rtheta:=theta1..theta2;
Rr:=r1..r2;
sphereplot(f(z,r),z=z1..z2,r=Rr,ops);
sphereplot([z(theta),theta,z],z=z1..z2,theta=Rtheta,ops);
with(plots):
sphereplot(2*sin(z)*cos(r)-r,r=0..2*Pi,z=0..Pi,
axes=boxed,grid=[40,40],orientation=[0,0]);
Mathematica:
SphericalPlot3D[f[z,r],{z,z1,z2},{r,r1,r2},ops]
SphericalPlot3D[Evaluate[2*Sin[z]*Cos[r]-r],{z,0,Pi},
{r,0,2*Pi},BoxRatios->{1,1,1},PlotStyle->
Directive[LightPurple,Opacity[0.9]],PlotPoints->5]
6.13
206
Geometry
display({sphere([0,0,0],1),cone([0,0,1],1,-2)},
style=wireframe,scaling=constrained,
orientation=[-60,60]);
display(rotate(G5,0,Pi,0),axes=boxed);
display([G5,translate(G5,1,2,3)],orientation=[-50,80]);
display([G5,translate(scale(G5,0.5,0.5,0.5),1,1,1)],
orientation=[-50,80]);
Mathematica:
Standard geometric shapes and their transformations can be constructed
with the functions Graphics[shape], Graphics3D[shape].
SetOptions[Graphics3D,BoxRatios->{1,1,1}];
g1=Graphics[{Blue,Circle[{1,1},1]}];
g2=Graphics[{Red,Dashing[0.01],Line[{{-1,-1},
{1,1},{1,0},{-1,-1}}]}]; Show[{g1,g2}]
Show[Graphics3D[{{Blue,Cuboid[{0,0,0},{1,2,3}]},
{Purple,Cylinder[{{0,0,-1},{0,0,3}},0.9]}}]]
g4=Sphere[]; Graphics3D[{g4,Translate[Rotate[
g4,Pi,{1,1,1}],{2,2,2}]}]
Graphics3D[{g4,Translate[g4,{1,2,3}]}]
Graphics3D[{g4,Translate[Scale[g4,{0.5,0.5,0.5},
{1,1,1}],{2,2,2}]}]
Graphics3D[GeometricTransformation[
GeometricTransformation[g4,ScalingMatrix[2,{1,1,1}]],
ReflectionMatrix[{1,1,1}]]]
SetOptions[Graphics3D,Lighting->"Neutral",
PlotRange->All,BoxRatios->{1,1,1}];
Graphics3D[{Opacity[0.6],Sphere[{1,1,1},3],
Cylinder[{{0,0,-1},{1,1,1}},3]}]
Note. Some functions (e.g. WireFrame, Helix, DoubleHelix, etc.) of the package
Graphics`Shapes` are available on the Wolfram website. The functions Torus,
MoebiusStrip are available in the kernel function ExampleData.