================ BEZIER5.1 ================ ハートのアニメーションを作るファイルです。 ******* Needs["Graphics`Colors`"] Cn[s_]:=n!/(s!*(n-s)!) Bn[s_,u_]:=Cn[s]*(u^s)*((1-u)^(n-s)) SS[n_]:=Sum[b[j]*Bn[j,t],{j,0,n}] L[n_]:=Table[(1-t)*b[i]+t*b[i+1],{i,0,n-1}] B2Poly:=ParametricPlot[Evaluate[L[n]],{t,0,1},AspectRatio\[Rule]Automatic, Axes\[Rule]True] BlueBezier:= ParametricPlot[Evaluate[SS[n]],{t,0,1},AspectRatio\[Rule]Automatic, Axes\[Rule]False,PlotRange\[Rule]All, PlotStyle\[Rule]{Thickness[0.005],Blue}] RedBezier:= ParametricPlot[Evaluate[SS[n]],{t,0,1},AspectRatio\[Rule]Automatic, Axes\[Rule]False,PlotRange\[Rule]{{0,12},{-6,6}}, PlotStyle\[Rule]{Thickness[0.03],Red}] GreenBezier:= ParametricPlot[Evaluate[SS[n]],{t,0,1},AspectRatio\[Rule]Automatic, Axes\[Rule]False,PlotRange\[Rule]All, PlotStyle\[Rule]{Thickness[0.03],Green}] OrangeBezier:= ParametricPlot[Evaluate[SS[n]],{t,0,1},AspectRatio\[Rule]Automatic, Axes\[Rule]False,PlotRange\[Rule]All, PlotStyle\[Rule]{Thickness[0.03],Orange}] BlackBezier:= ParametricPlot[Evaluate[SS[n]],{t,0,1},AspectRatio\[Rule]Automatic, Axes\[Rule]False,PlotRange\[Rule]All, PlotStyle\[Rule]{Thickness[0.03],Black}] mm[w_]={{Cos[6*Pi*w],-Sin[6*Pi*w]}, {Sin[6*Pi*w], Cos[6*Pi*w]}} zzz[w_]={6*Cos[6*Pi*w], 6*Sin[4*Pi*w]} n=8 b[0]={0,1/2}; b[1]={0,0.7}; b[2]={2.5,3.5}; b[3]={2.5,4}; b[4]={2.5,4.7}; b[5]={2,5.5}; b[6]={1/2,5.5}; b[7]={0,5}; b[8]={0,4}; c1=RedBezier b1=B2Poly Clear[m] Clear[vvv] m=mm[vvv] ll=zzz[vvv] n=8 b[0]=m.b[0]+ll b[1]=m.b[1]+ll b[2]=m.b[2]+ll b[3]=m.b[3]+ll b[4]=m.b[4]+ll b[5]=m.b[5]+ll b[6]=m.b[6]+ll b[7]=m.b[7]+ll b[8]=m.b[8]+ll For[i=0;0,i<120,i++, vvv=i/120; dd1[i]=SS[n]] SS[n] b[0]={0,1/2}; b[1]={0,.7}; b[2]={-2.5,3.5}; b[3]={-2.5,4}; b[4]={-2.5,4.7}; b[5]={-2,5.5}; b[6]={-1/2,5.5}; b[7]={0,5}; b[8]={0,4}; c2=RedBezier b2=B2Poly Clear[m] Clear[vvv] m=mm[vvv] n=8 b[0]=m.b[0]+ll b[1]=m.b[1]+ll b[2]=m.b[2]+ll b[3]=m.b[3]+ll b[4]=m.b[4]+ll b[5]=m.b[5]+ll b[6]=m.b[6]+ll b[7]=m.b[7]+ll b[8]=m.b[8]+ll For[i=0;0,i<120,i++, vvv=i/120; dd2[i]=SS[n]] filledcurve[curve_,{u_,u0_,u1_},Color_]:= Module[{plottmp,grtmp}, plottmp=ParametricPlot[curve//Evaluate,{u,u0,u1}, AspectRatio\[Rule]Automatic,DisplayFunction\[Rule]Identity]; grtmp=plottmp/.(Line[pts_]\[RuleDelayed]Polygon[pts]); Show[grtmp,DisplayFunction\[Rule]$DisplayFunction,Axes\[Rule]True, PlotRange\[Rule]{{-12,12},{-12,12}},DefaultColor\[Rule]Color]] AAA=For[i=0;0,i<120,i++, vvv=i/120; filledcurve[{dd1[i],dd2[i]},{t,-0,1},Red]] ******