In[]:=
deploy
Tue 14 Sep 2021 23:51:40
In[]:=
cylinder[t_]:=With{x=Cos[t],y=Sin[t]},Graphics3D@Cylinder{{x,y,0},{x,y,+3}},1100;plot3da=Plot3D[{0,+3},{x,-1,1},{y,-1,1},RegionFunctionFunction[{x,y,z},x^2+y^2≤1],MeshFunctions{#3&},BoxedFalse,AxesNone,PlotStyleOpacity[0.5],PlotPoints50];plot3d[t_]:=Show[plot3da,cylinder[t]]blue=ColorData[97,"ColorList"][[1]];plot2da=Plot[Callout[+3,"",Above],Callout[+3,"",Below],Callout[2,"",Above],{t,0,2Pi},PlotStyle{blue,blue,Dashed},AxesOrigin{0,0}];point[t_]:=ListPlot[With[{x=Cos[t],y=Sin[t]},{{t,+3}}],PlotStylePointSize[Large],FillingAxis,FillingStyleDirective[Orange,Opacity[0.8]]]plot2d[t_]:=Show[plot2da,point[t],ImageSize400];plotCombined[t_]:=GraphicsRow[{Show[plot3d[t],ImageSize600],Show[plot2d[t],ImageSize500]}];
2
x
2
y
2
x
2
y
2
Cos[t]
2
Sin[t]
λ
1
2
Cos[t]
2
Sin[t]
λ
2
λ
ave
2
x
2
y
In[]:=
numFrames=10;frames=Table[plotCombined[t],{t,0,2Pi-2Pi/numFrames,2Pi/numFrames}];ListAnimate[frames]Export["test-rotation.gif",frames,"DisplayDurations"->1/50]
Out[]=
Out[]=
test-rotation.gif
Blend some frames together
Blend some frames together
In[]:=
genWeights[spread_,subsample_]:=Assert[OddQ[spread]];Assert[OddQ[subsample]];(*generatesinplotcenteredatoffset,withgivenwidth.offset-width/2..offset+width/2*)makePlot[offset_,width_]:=Cos+12;width=(spread*subsample-1)+2;middleFrame=(width-2)2;expr=makePlot[middleFrame,width];expr/.x->#&/@Range[0,spread*subsample-1]//N;spread=3;subsample=1;weights=genWeights[spread,subsample];(*padindicesforaveraging*)idx=Range@Length@frames~Join~Range[Length@weights-1];framesBlended=Blend[frames[[#]],weights]&/@Partition[idx,spread*subsample,subsample];Export["test-rotation2.gif",framesBlended,"DisplayDurations"->1/50]
2π(-offset+x)
width
Out[]=
$Aborted
Out[]=
test-rotation2.gif