如何在地图上固定这两个有角度的边界

2024-06-16 11:44:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我在枫树上做了这个动画。我想把在某一点上相遇的双方固定下来。其他两条直边也是一样。在Maple中有可能吗?如果没有,在MatLab中有可能吗?你知道吗

with(plots):
animate(plot3d,[sin(Pi*(t-x))*sin(Pi*y)*Heaviside(t-x)-sin(Pi*(t+x))*sin(Pi*y)*Heaviside(t+x),x=0..4,y=piecewise(x>=0 and x<2,1/2-x/4,0)..piecewise(x>=0 and x<2,1/2+x/4,1)],t=-2*Pi..2*Pi, frames=90);

非常感谢。你知道吗

Image on what it look like at t=0 in Maple


Tags: andframeswithpi动画sinmaplematlab
1条回答
网友
1楼 · 发布于 2024-06-16 11:44:02

原版

with(plots):

animate(plot3d,
    [sin(Pi*(t-x))*sin(Pi*y)*Heaviside(t-x)
     -sin(Pi*(t+x))*sin(Pi*y)*Heaviside(t+x),
     x=0..4,
     y=piecewise(x>=0 and x<2,1/2-x/4,0)
       ..piecewise(x>=0 and x<2,1/2+x/4,1)],
    t=-2*Pi..2*Pi, frames=90);

enter image description here

这就是你要找的吗?你知道吗

with(plots):

adjustor:=sin(Pi*piecewise(x>=0 and x<2,(y-1/2)/(x/2)+1/2,y)):

animate(plot3d,
        [sin(Pi*(t-x))*adjustor*Heaviside(t-x)
         -sin(Pi*(t+x))*adjustor*Heaviside(t+x),
         x=0..4,
         y=piecewise(x>=0 and x<2,1/2-x/4,0)
           ..piecewise(x>=0 and x<2,1/2+x/4,1)],
         t=-2*Pi..2*Pi, frames=45);

enter image description here

相关问题 更多 >