第12章主题动画典例分析Word文档格式.docx
- 文档编号:17373971
- 上传时间:2022-12-01
- 格式:DOCX
- 页数:38
- 大小:551.37KB
第12章主题动画典例分析Word文档格式.docx
《第12章主题动画典例分析Word文档格式.docx》由会员分享,可在线阅读,更多相关《第12章主题动画典例分析Word文档格式.docx(38页珍藏版)》请在冰豆网上搜索。
g:
-r*sin(u(i)):
h:
(v(j)):
F:
=k->
[MESH([seq([seq(evalf([f(i,j),g(i,j),h(i,j)]),j=0..M)],i=0..R-w*k)],COLOR(RGB,1,0,1))]:
PLOT3D(ANIMATE(seq(F(k),k=0..R)),AXES(BOX)):
;
display(ANIMATE(seq(F(k),k=0..R)),insequence=true,axes=frame,labels=[x,y,z]):
W1:
=%:
Q:
[polygon([[r*cos(u(i)),r*sin(u(i)),c],[r*cos(u(i))+r*sin(u(i))*(u(i)),r*sin(u(i))-r*cos(u(i))*(u(i)),c],[r*cos(u(i))+r*sin(u(i))*(u(i)),r*sin(u(i))-r*cos(u(i))*(u(i)),d],[r*cos(u(i)),r*sin(u(i)),d]],color=blue)]:
Q(i):
display(ANIMATE(seq(Q(i),i=0..N)),insequence=true,axes=frame):
PLOT3D(ANIMATE(seq(Q(i),i=0..N)),AXES(BOX)):
WW:
v(j):
FF:
=PLOT3D(MESH([seq([seq(evalf([f(i,j),g(i,j),h(i,j)]),j=0..M)],i=0..R)],STYLE(LINE),COLOR(RGB,0,1,0))):
display(W1,WW,FF,view=[-25..8,-32..16,c..d],orientation=[20,72],scaling=constrained,axesfont=[TIMES,ROMAN,5],scaling=constrained);
本主题动画,如果采用新版animate函数,可以使用如下实现方案。
cylinderplot(r,u=0..2*Pi,v=-c..c,style=line,grid=[13,3]):
B:
=proc(t)
display(polygonplot3d([[r*cos(t),r*sin(t),c],[r*cos(t)+r*sin(t)*(t),r*sin(t)-r*cos(t)*(t),c],[r*cos(t)+r*sin(t)*(t),r*sin(t)-r*cos(t)*(t),d],[r*cos(t),r*sin(t),d]])
cylinderplot(r,u=t..2*Pi,v=-c..c,color=red,grid=[13,3],thickness=0,style=PATCHNOGRID)):
end:
animate(FF,[t],t=0..2*Pi,frames=9,background=B,scaling=constrained,orientation=[40,70],axes=box);
图2新方案动画的一帧
图12-03~05圆柱面的截口曲线*
图3截平面位置变动时圆柱面的截口曲线
with(plottools):
=-12:
=12:
=48:
=36:
=18:
t:
a+(b-a)/N*i:
s:
2*Pi*j/M:
x:
r*cos(s(j)):
y:
r*sin(s(j)):
z:
t(i):
plot3d([x(i,j),y(i,j),z(i,j)],i=0..N,j=0..M,style=wireframe,color=green):
ZM:
k:
=n->
tan(-0.0001+Pi*n/2/R):
PM:
polygonplot3d([[-1,-1,-k(n)],[1,-1,-k(n)],[1,1,k(n)],[-1,1,k(n)]],style=LINE,color=red):
x1:
y1:
z1:
k(n)*sin(s(j)):
JKQX:
spacecurve([x1(j),y1(j),z1(j)],j=0..M,color=blue,thickness=3):
HI:
display(PM(n),JKQX(n)):
display(seq(HI(n),n=0..R),insequence=true):
display(%,ZM,orientation=[-29,58],view=[-1..1,-1..1,-12..12],orientation=[-48,84]);
图4假如把各帧的截口曲线保留为踪迹的情形
如果使用新版animate函数,可以采取如下方案。
=-r*52:
=r*52:
cylinderplot(r,u=0..2*Pi,v=a..b,style=line,grid=[24,6]):
DH:
display(
polygonplot3d([[-r,-r,-tan(t)*r],[r,-r,-tan(t)*r],[r,r,tan(t)*r],[-r,r,tan(t)*r]],color=yellow),
spacecurve([r*cos(s),r*sin(s),tan(t)*r*sin(s)],s=0..2*Pi,color=blue,thickness=3)):
animate(DH,[t],t=0..Pi/12*5.9,orientation=[-45,80],background=ZM);
图5新方案动画的一帧
图12-06~09展开圆柱截口曲线成为一条正弦曲线*
图6展开圆柱截口曲线成为一条正弦曲线
第一部分。
c:
=-(r+.5):
=-c:
u:
v:
[MESH([seq([seq(evalf([f(i,j),g(i,j),h(i,j)]),j=0..M)],i=0..R-w*k)],COLOR(RGB,0,1,0))]:
[polygon([[r*cos(u(i)),r*sin(u(i)),c],[r*cos(u(i))+r*sin(u(i))*(u(i)),r*sin(u(i))-r*cos(u(i))*(u(i)),c],[r*cos(u(i))+r*sin(u(i))*(u(i)),r*sin(u(i))-r*cos(u(i))*(u(i)),d],[r*cos(u(i)),r*sin(u(i)),d]],color=cyan,thickness=2)]:
g:
h:
=PLOT3D(MESH([seq([seq(evalf([f(i,j),g(i,j),h(i,j)]),j=0..M)],i=0..R)],STYLE(LINE),COLOR(RGB,.8,.9,0))):
display(W1,WW,FF,view=[-25..8,-32..16,c..d],orientation=[20,72],scaling=constrained,axesfont=[TIMES,ROMAN,5]);
第二部分
以下才是本主题动画“展开圆柱截口曲线成为一条正弦曲线”设计的核心部分。
首先设计一条逐渐伸长并逐渐向左移动的正弦曲线。
=17:
plot([x-k*2*Pi/N,r*sin(x),x=0..k*2*Pi/N],color=black,thickness=2);
图7逐渐伸长并逐渐向左移动的正弦曲线
再把上面的正弦曲线动画逐帧映射到渐开切平面上去。
G:
=transform((u,v)->
[-u*r*sin(i*2*Pi/N)+r*cos(i*2*Pi/N),u*r*cos(i*2*Pi/N)+r*sin(i*2*Pi/N),v]):
[G(plot([x-i*2*Pi/N,r*sin(x),x=0.001..i*2*Pi/N],color=black,thickness=2))]:
display(seq(F(i),i=0..N),insequence=true,axes=frame):
tuxd:
display(W1,WW,FF,tuxd,scaling=unconstrained,orientation=[34,64],axesfont=[TIMES,ROMAN,5]);
最后添加一条被逐渐“解掉”的圆柱面截口曲线。
GG:
[r*cos(u),r*sin(u),v]):
FG:
[GG(plot([x,r*sin(x),x=i*2*Pi/N..2*Pi],color=red,thickness=2))]:
display(seq(FG(i),i=0.001..N),insequence=true):
JK:
display(W1,WW,JK,tuxd,FF,scaling=unconstrained,orientation=[31,73],axesfont=[TIMES,ROMAN,5]);
图8最后组合成的动画
首先取来2-6.1.3的结果,并赋名为QQ。
然后再添加上两条曲线的动画。
WQWQ:
G:
[-u*r*sin(t)+r*cos(t),u*r*cos(t)+r*sin(t),v]):
display(G(plot([x-t,r*sin(x),x=0..t],color=black,thickness=2)),
GG(plot([x,r*sin(x),x=t..2*Pi],color=blue,thickness=2)));
animate(WQWQ,[t],t=0.001..2*Pi+0.001,frames=W):
QQQ:
经过适当调整之后使两者组合。
display(QQ,QQQ);
图9新版animate的实现方案
图12-10~13地球公转与自转的示意*
图10地球公转与自转的示意(连环画)
=3:
=2:
l:
n:
=cos(66.5*Pi/180):
m:
=sin(66.5*Pi/180):
L:
=line([-l*n,0,-l*m],[l*n,0,l*m],color=blue,thickness=2):
=k*N:
L1:
[translate(L,a*cos(2*Pi*i/M),b*sin(2*Pi*i/M),0)]:
display(seq(L1(i),i=0..M),axes=normal,labels=[x,y,z],insequence=true,orientation=[-80,65]);
LL:
spacecurve([a*cos(t),b*sin(t),0],t=0..2*Pi,color=red,thickness=3):
TY:
display(LL,TY);
图11地轴和黄道面
=tetrahedron([0,0,0],1,style=LINE,thickness=2):
W0:
=rotate(Q,0,-Pi*23.5/180,0):
rotate(W0,2*Pi*i/N,[[-n,0,-m],[n,0,m]]):
W2:
translate(W1(i),a*cos(2*Pi*i/M),b*sin(2*Pi*i/M),0):
display(seq(W2(i),i=0..M),insequence=true,axes=box,scaling=constrained,orientation=[-80,65]);
display(LL,TY,WW,axes=normal,tickmarks=[0,0,0]);
QQ:
图12自转动画与组合动画
本例中为减少参与运算的数据量,用四面体代替了地球。
n:
=tetrahedron([0,0,0],1,style=LINE,thickness=2,color=black):
CX:
=proc(u)
display(translate(L,a*cos(u),b*sin(u),0),
translate(rotate(rotate(Q,0,-Pi*23.5/180,0),4*u,[[-n,0,-m],[n,0,m]]),a*cos(u),b*sin(u),0));
animate(CX,[u],u=0..2*Pi,frames=72,background=TY,axes=normal,labels=[x,y,z],orientation=[-93,77],axesfont=[TIMES,ROMAN,6]);
图13新版animate的实现方案
图12-14~16球面数字地球仪*
图14球面数字地球仪
with(plots):
=readdata("
e:
\\MathCAD2k\\qsheet\\World.prn"
2):
PLOT(CURVES(Q),STYLE(POINT),COLOR(RGB,1,1,1)):
Q1:
=(%):
[u*Pi/180,(90-v)*Pi/180]):
g(Q1):
Q2:
=g(Q1):
[sin(v)*cos(u),sin(v)*sin(u),cos(v)]):
display(f(Q2)):
Q3:
=plot3d([sin(s)*cos(t),sin(s)*sin(t),cos(s)],s=0..Pi,t=0..2*Pi,color=cyan):
display(Q3,f(Q2));
DQY:
F:
rotate(DQY,0,0,-2*Pi*i/M):
display(seq(F(i),i=0..M),insequence=true);
图15动画之一帧:
旋转中的地球仪
如果放弃对北极地区的观察,可以做出更为简洁的动画。
办法是:
作出带有地图的球面静止图形DQY。
然后使用如下一条带有新版animate函数的语句,就可得到一个“走马灯”式的地球仪。
这个算法,会比原来的方案节省一些计算时间。
animate(display,[Q3,f(Q2),orientation=[94+t,90]],t=0..-360,frames=9);
图16“走马灯”地球仪
图12-17~18二元变量在任意点处的“全方位”极限
图17二元变量在任意点处的“全方位”极限(连环画)
=(x,y)->
8-sqrt(x^2+y^2):
=[x,y,f(x,y)]:
a:
=m-h:
=m+h:
=n-h:
=n+h:
plot3d(G,x=a..b,y=c..d,style=LINE,color=green,grid=[9,8]);
SS:
#SS是二元函数曲面。
G0:
=evalf(subs(x=m,y=n,G)):
LA:
=[[m,n,0],G0]:
PLOT3D(CURVES(LA),COLOR(RGB,1,0,0),THICKNESS(4));
#LA是极限值线段。
=72:
e:
(R-(-0.001+R)*i/N):
H:
=POLYGONS([[a,c,evalf(f(m,n))],[a,d,evalf(f(m,n))],[b,d,evalf(f(m,n))],[b,c,evalf(f(m,n))]],STYLE(LINE),COLOR(RGB,0,0,0),THICKNESS
(2)):
plots[display](H,orientation=[67,69],axes=FRAME);
#H是极限值高度平面。
H1:
POLYGONS([[a,c,evalf(f(m,n))-e(i)],[a,d,evalf(f(m,n))-e(i)],[b,d,evalf(f(m,n))-e(i)],[b,c,evalf(f(m,n))-e(i)]],STYLE(LINE),COLOR(RGB,0,0,1),THICKNESS
(2)):
plots[display](seq(H1(i),i=1..N),insequence=true);
HH1:
H2:
POLYGONS([[a,c,evalf(f(m,n))+e(i)],[a,d,evalf(f(m,n))+e(i)],[b,d,evalf(f(m,n))+e(i)],[b,c,evalf(f(m,n))+e(i)]],STYLE(LINE),COLOR(RGB,0,0,1),THICKNESS
(2)):
plots[display](seq(H2(i),i=1..N),insequence=true);
HH2:
#HH1,HH2构成带状薄层。
plots[display](H,HH1,HH2,orientation=[67,69],axes=FRAME);
#组合成薄层逐渐变薄的动画。
delta:
e(i):
forifrom1toNdo
=evalf(1/2+rand(7*(i+1))/(15*(i+1))):
u1:
=u():
u2:
u3:
u4:
L0:
=[[x,y,0],[x,y,f(x,y)]];
:
evalf(delta(i)/sqrt
(2)):
=subs(x=m+k(i)*u1,y=n+k(i)*u2,L0):
L2:
=subs(x=m-k(i)*u1,y=n-k(i)*u2,L0):
L3:
=subs(x=m-k(i)*u1,y=n+k(i)*u2,L0):
L4:
=subs(x=m+k(i)*u1,y=n-k(i)*u2,L0):
L12:
=subs(x=m+k(i)*u2,y=n+k(i)*u1,L0):
L22:
=subs(x=m-k(i)*u2,y=n-k(i)*u1,L0):
L32:
=subs(x=m-k(i)*u2,y=n+k(i)*u1,L0):
L42:
=subs(x=m+k(i)*u2,y=n-k(i)*u1,L0):
L5:
=subs(x=m+k(i)*u3,y=n+k(i)*u4,L0):
L6:
=subs(x=m-k(i)*u3,y=n-k(i)*u4,L0):
L7:
=subs(x=m-k(i)*u3,y=n+k(i)*u4,L0):
L8:
=subs(x=m+k(i)*u3,y=n-k(i)*u4,L0):
L52:
=subs(x=m+k(i)*u4,y=n+k(i)*u3,L0):
L62:
=subs(x=m-k(i)*u4,y=n-k(i)*u3,L0):
L72:
=subs(x=m-k(i)*u4,y=n+k(i)*u3,L0):
L82:
=subs(x=m+k(i)*u4,y=n-k(i)*u3,L0):
F[i]:
=[CURVES(L1,L2,L3,L4,L5,L6,L7,L8,L12,L22,L32,L42,L52,L62,L72,L82,COLOR(RGB,1,.4,.8),THICKNESS(0))]:
od:
plots[display](seq(F[i],i=1..N),insequence=true,axes=NORMAL);
WW1:
#在半径不断缩小的圆域中随机找出16个点,并求得其上函数值。
S:
plots[spacecurve](([delta(i)*cos(t)+m,delta(i)*sin(t)+n,0],t=0..2*Pi,color=blue,thickness=2)):
S
(1):
plots[display](seq(S(i),i=1..N),insequence=true);
WW2:
#半径不断缩小的圆域边界。
plots[display](WW1,WW2,W1,H,HH1,HH2,SS,orientation=[16,77],axes=FRAME);
#最后合成为动画。
图18二元变量在任意点处的“全方位”极限(一帧)
图12-19~20二元变量在原点处按指定路线的极限
图19二元变量在原点处按指定路线的极限(连环画)
做一个“指定路径
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 12 主题 动画 分析
![提示](https://static.bdocx.com/images/bang_tan.gif)