Animation with Asymptote – fig0110

Category: Animation,AsymptotePh. Ivaldi @ 18 h 20 min

Figure 0011
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
import geometry;
import animate;
// settings.tex="pdflatex";
// settings.outformat="pdf";

animation anim;
size(12cm);

point F1=(0,0), F2=(0,-3);
dot("F",F1);

ellipse el1=ellipse(F1,F2,2), el2;
point Fp1=shift(0,2*el1.a)*F1;
dot("F'",Fp1);

line tgt, saxe=line(F1,false,-F2);

for (int i=0; i < 360; i += 5) {
  save();
  ellipse el=rotate(i,F1)*el1;
  point M=intersectionpoints(el,saxe)[0];
  tgt=tangents(el,M)[0];
  draw(tgt, 0.8*red);
  draw((reflect(tgt)*el)^^el, linewidth(bp));
  anim.add();
  restore();
}
erase();
anim.movie();

Étiquettes : , , ,


Animation with Asymptote – fig0120

Category: Animation,AsymptotePh. Ivaldi @ 19 h 20 min

Figure 0012
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
import geometry;
import animate;
settings.tex="pdflatex";
settings.outformat="pdf";

animation anim;
size(12cm);



point F1=(0,0), F2=(10,0);
dot("F",F2);
ellipse el1=ellipse(F1,F2,6), el2;
draw(el1, linewidth(bp));
point Fp2=shift(2*el1.a,0)*F2;
line tgt, saxe;
pen[] p=new pen[]{0.8*green,0.8*blue,0.8*yellow,cyan};
path[] locus=sequence(new path(int i){return nullpath;},p.length);
real t=1/(p.length-1);

bool initlocus=true;
for (int i=0; i < 360; i += 1) {
  save();
  point Fm=rotate(i,F2)*Fp2;
  dot("F'",Fm);
  draw(Fm--F2, linewidth(2bp));
  point M=intersectionpoints(el1, line(F2,false,Fm))[0];
  tgt=tangents(el1,M)[0];
  draw(tgt, 0.8*red);
  el2=reflect(tgt)*el1;
  draw(el2.F1--el2.F2);

  for (int j=0; j < p.length; ++j) {
    point P=point(segment(el2.F2,Fm),0.5+j*t/2);
    locus[j]=initlocus ? P : locus[j]--P;
    dot(P, p[j]);
    draw(locus[j], bp+p[j]);
  }

  dot(el2.F2);
  draw(el2, linewidth(bp));
  anim.add();
  restore();
  initlocus=false;
}
erase();
anim.movie();

Étiquettes : , , , ,


Animation with Asymptote – fig0130

Category: Animation,AsymptotePh. Ivaldi @ 20 h 20 min

Figure 0013
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
// From an idea posted by Fabrice Couvreur
import geometry;
import animate;
settings.tex="pdflatex";
settings.outformat="pdf";

point A=(0,0), B=(8,0), C=(8,10);
unitsize(5cm/B.x,5cm/C.y);
animation Anim,Anim1;
path locus;

triangle t=triangle(A,B,C);
transform proj=projection(t.BC);
draw(t,linewidth(bp));
label(t);
segment s=segment(t.AB);
line l1 =line(t.BC);

int n=50; // Points number of the locus
real a=0, step=1/(n-1);
for (int i=0; i < n; ++i) {
  save(); // Geometry part
  point M=point(s,a);
  line l2=parallel(M,l1);
  point Np=intersectionpoint(l2,t.AC);
  point P=proj*Np;
  dot("$M$",M,S,0.8*red);
  dot("$P$",P,E,0.8*red);
  dot("$N$",Np,W,0.8*red);
  fill(M--Np--P--B--cycle,0.8*red);
  perpendicularmark(t.BC,t.BA);
  Anim.add(); // Anim contain only the geometry part
  restore();
  // Graph part
  picture gph; // picture of the graph
  unitsize(gph,5cm/B.x,4cm/C.y); // units for the graph
  show(gph,currentcoordsys);
  point Sp=(a*abs(B-A),abs(M-B)*abs(M-Np));
  locus=locus..Sp;
  draw(gph,locus, bp+0.8*red);
  Anim1.add(gph); // Anim1 contain only the graph part
  a += step;
}

Anim1.export(); // make all Anim1 pictures to the same size.
Anim1.purge();

for (int i=0; i < Anim.pictures.length; ++i) {
  // draw axis on all pictures of Anim1
  draw(Anim1.pictures[i],Label("$x$",align=S,position=EndPoint),hline,Arrow);
  draw(Anim1.pictures[i],Label("$y$",align=W,position=EndPoint),vline,Arrow);
  // add each graph to the corresponding geometric picture
  add(Anim.pictures[i],Anim1.pictures[i].fit(),1.25*B);
}

Anim.movie();

Étiquettes : , ,


Animation with Asymptote – fig0140

Category: Animation,AsymptotePh. Ivaldi @ 21 h 20 min

Figure 0014
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
/*Inspiration*/
import Lsystem;
import animate;
animation A;
settings.tex="pdflatex";
settings.outformat="pdf";

size(10cm,0);

string[][] rules={{"A","[+BFA][-BFA][^BFA][&BFA]"}, {"B", "'(0.7071)"}};
Lsystem3 plant=Lsystem3("A", rules, La=45);
plant.iterate(5);
tree3 g=plant.tree3();

for (int angle=0; angle < 360; angle += 5) {
  currentprojection=orthographic(rotate(angle,Z)*(10,10,6));
  save();
  for (int i : g.keys)
    draw((path3)g[i], linewidth(bp)+(g[i].depth > 3 ? brown : 0.8*green));
  A.add();
  restore();
}

A.movie();

Étiquettes : ,


Animation with Asymptote – fig0150

Category: Animation,AsymptotePh. Ivaldi @ 22 h 20 min

Figure 0015
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
/*Inspiration*/
import Lsystem;
import animate;

settings.tex="pdflatex";
settings.outformat="pdf";

animation A;
size(10cm,0);

string[][] rules={{"X","^<XF^<XFX-F^>>XFX&F+>>XFX-F>X->"}};
Lsystem3 HilbertCurve3D=Lsystem3("X", rules, La=90, Lai=0);
HilbertCurve3D.iterate(3);

path3[] g=HilbertCurve3D.paths3();
triple M=(max(g)+min(g))/2;
currentprojection=currentprojection=orthographic((10,10,6));

for (int angle=0; angle < 360; angle += 2) {
  save();
  draw(rotate(angle,M,M+Z)*g[0], linewidth(bp)+0.9*yellow);
  A.add();
  restore();
}

A.movie(BBox(3mm, Fill(black)));

Étiquettes : , ,


Animation with Asymptote – fig0160

Category: Animation,AsymptotePh. Ivaldi @ 23 h 20 min

Figure 0016
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
import graph_settings;
import animate;
size(10cm);
settings.tex="pdflatex";
settings.outformat="pdf";

pair[] interp(pair[] a1, pair[] a2, real k)
{
  if(a1.length != a2.length) abort("interp: arrays have differents length.");
  pair[] g;
  int l=a1.length;
  g=sequence(new pair(int j){
      return interp(a1[j],a2[j],k);
    },l);
  return g;
}

path morphing(pair[] a1, pair[] a2, real k, interpolate join=operator --)
{
  if(a1.length != a2.length) abort("morphing: arrays have differents length.");
  return join(...interp(a1, a2, k));
}

pair[] nodes(path g, int n)
{
  int np=round(n/length(g));
  n=np == 0 ? n : np*length(g);
  return sequence(new pair(int i){return point(g, length(g)*i/n);}, n);
}

animation A;

int nbpt=4;
pair[] A1=nodes(unitsquare,nbpt);
path g=(0,0)--(1,0)--(0,1)--(1,1)--cycle;
pair[] A2=shift(2,1)*rotate(25)*nodes(g,nbpt);
interpolate join=operator ..;
// interpolate join=operator --;


int n=40;
real step=1/n;
pen p1=0.8*red, p2=0.8*blue;

filldraw(join(morphing(A1,A2,0,join),cycle), p1);
filldraw(join(morphing(A1,A2,1,join),cycle), p2);

for (int i=0; i <= n; ++i) {
  save();
  filldraw(join(morphing(A1,A2,i*step,join),cycle),opacity(0.5)+interp(p1,p2,i*step));
  A.add();
  restore();
}

A.movie();

Étiquettes : , , ,


Animation with Asymptote – fig0170

Category: Animation,AsymptotePh. Ivaldi @ 0 h 20 min

Figure 0017
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
import graph;
import animate;
size(15cm);
settings.outformat="pdf";

pair[] interp(pair[] a1, pair[] a2, real k)
{
  if(a1.length != a2.length) abort("interp: arrays have differents length.");
  pair[] g;
  int l=a1.length;
  g=sequence(new pair(int j){
      return interp(a1[j],a2[j],k);
    },l);
  return g;
}

path morphing(pair[] a1, pair[] a2, real k, interpolate join=operator --)
{
  if(a1.length != a2.length) abort("morphing: arrays have differents length.");
  return join(...interp(a1, a2, k));
}

pair[] nodes(path g, int n)
{
  int np=round(n/length(g));
  n=np == 0 ? n : np*length(g);
  return sequence(new pair(int i){return point(g, length(g)*i/n);}, n);
}

animation A;

real f(real t){ return exp(cos(t))-2*cos(4*t)+sin(t/12)^5;}
path gf=polargraph(f,0,12*pi,1000);

int nbpt=1000;
pair[] A1=nodes(scale(5.5)*unitcircle,nbpt);
pair[] A2=shift(0,0)*nodes(gf,nbpt);
interpolate join=operator --;


int n=50;
real step=1/n;
pen p1=0.8*red, p2=0.8*blue;

for (int i=0; i <= n; ++i) {
  save();
  filldraw(join(morphing(A1,A2,1,join),cycle),
           evenodd+p2);
  filldraw(join(morphing(A1,A2,i*step,join),cycle),
           evenodd+interp(p1,p2,i*step));
  A.add();
  restore();
}

A.movie(BBox(3mm, 3bp+miterjoin+black, FillDraw(lightyellow)));

Étiquettes : , , ,


Animation with Asymptote – fig0180

Category: Animation,AsymptotePh. Ivaldi @ 1 h 20 min

Figure 0018
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
// pdf version of this animation: fig0180.pdf
import labelpath;
import animate;
animation A;

texpreamble("\usepackage[dvips,pdfpagemode=FullScreen]{hyperref}");
settings.outformat="pdf";
settings.tex="pdflatex";
defaultpen(fontsize(12pt));

size(16cm,0);
usepackage("mathrsfs, amsfonts,amsmath,amssymb");
picture pic, pic1, pic2, pic3;
real u=1, Y=2*pi+0.5;
pair yM=(u,Y*u), ym=(u,-Y*u);
path cle=scale(u)*unitcircle;
path arcg=arc((0,0),1.5*u,115,155);

void addtick(picture pic=currentpicture, Label L, pair z, pair dir=E, pen p=currentpen)
{
  transform R=rotate(degrees(dir));
  real width=1.5mm;
  Label L=L.copy();
  L.position(z);
  L.align(NoAlign,E);
  L.align.dir=R*L.align.dir*1.3*width/mm;
  L.p(p);
  pic.add(new void(frame f, transform t) {
      path g=(-width,0)--(width,0);
      picture opic;
      draw(opic,shift(t*z)*R*g,p);
      add(f,opic.fit());
    });
  add(pic,L);
}

path roll(picture pic=currentpicture, real x, int nb=50)
{
  real stp=x/(nb-1);
  return operator --(...
                     sequence(new guide(int t){
                         real tt=t*stp;
                         return shift(expi(tt))*((x-tt)*(-sin(tt),cos(tt)));
                       },nb));
}

pair EW(int sign){return sign > 0 ? E : W;}

string pm(int sign){return sign > 0 ? "" : "-";}

pen p(int sign){return sign > 0 ? red : blue;}
pen pw(int sign){return p(sign)+(sign > 0 ? currentpen : white);}

// Define common picture
draw(scale(1.25)*"+", arcg, Arrow());
dot("$0$", point(cle,0));

draw((-u,0)--(u,0)^^(0,-u)--(0,u));
draw("$1$",(0,0)--point(cle,1.5),Arrows(FillDraw(white)));

pic.add(currentpicture);// Save the common picture in 'pic'.

// Starting picture 1
draw((u,0)--yM, linewidth(bp)+p(1), Arrow(TeXHead));
draw(ym--(u,0), linewidth(bp)+p(-1));
arrow("\underline{Axe des réels}",(u,-0.75*Y*u),W,1cm);

real x=2.2, y=-x, maxe=2*pi+0.2;
addtick(Label("$1$",align=E), (u,1), p(1));
addtick(Label("$\frac{\pi}{2}$",align=E), (u,pi/2), p(1));
addtick(Label("$\pi$",align=E), (u,pi), p(1));
addtick(Label("$\frac{3\pi}{2}$",align=E), (u,3pi/2), p(1));
addtick(Label("$2\pi$",align=E), (u,2pi), p(1));
addtick(Label("$-1$",align=W), (u,-1), p(-1));
addtick(Label("$-\frac{\pi}{2}$",align=W), (u,-pi/2), p(-1));
addtick(Label("$-\pi$",align=W), (u,-pi), p(-1));
addtick(Label("$-\frac{3\pi}{2}$",align=W), (u,-3pi/2), p(-1));
addtick(Label("$-2\pi$",align=W), (u,-2pi), p(-1));

draw(Label("$\mathscr{C}$",Relative(0.625)), cle,linewidth(bp));
A.add();
erase();

// Define the common picture for rolling part.
picture picanim(int sign)
{
  picture opic=pic.copy();
  pen pmoins=sign > 0 ? p(-1) : p(-1)+white;
  draw(opic, (u,0)--yM, bp+white+p(1), Arrow(TeXHead));
  draw(opic, ym--(u,0), linewidth(bp)+pmoins);
  arrow(opic,"\underline{Axe des réels}", (u,-0.75*Y*u), W, 1cm);
  addtick(opic, Label("$1$",align=E), (u,1), white+p(1));
  addtick(opic, Label("$\frac{\pi}{2}$",align=E), (u,pi/2), white+p(1));
  addtick(opic, Label("$\pi$",align=E), (u,pi), white+p(1));
  addtick(opic, Label("$\frac{3\pi}{2}$",align=E), (u,3pi/2), white+p(1));
  addtick(opic, Label("$2\pi$",align=E), (u,2*pi), white+p(1));
  addtick(opic, Label("$-1$",align=W), (u,-1), pmoins);
  addtick(opic, Label("$-\frac{\pi}{2}$",align=W), (u,-pi/2), pmoins);
  addtick(opic, Label("$-\pi$",align=W), (u,-pi), pmoins);
  addtick(opic, Label("$-\frac{3\pi}{2}$",align=W), (u,-3pi/2), pmoins);
  addtick(opic, Label("$-2\pi$",align=W), (u,-2*pi), pmoins);
  return opic;
}

erase();
pic2=picanim(1);

int nb=50; // Number of picture for rolling.
real step=maxe/nb;

for (int sign=1; sign > -2; sign -= 2) {// Rolling axis part (1 for positive values, -1 for ...);
  guide r1,rpis2, rpi, rpi32, rpi2;
  pair z;
  for (int i=0; i <= nb ; ++i) {
    real t=sign*i*step; // Where is the tangency.

    if(sign > 0) draw(Label("$\mathscr{C}$",Relative(0.625)), cle,linewidth(bp));
    path tg=i == nb ? cle : arc((0,0),u,0,degrees(t)); // The rolled part.
    path g=u*expi(t)--shift(u*expi(t))*((Y-abs(t))*u*expi(sign*pi/2+t)); // The straight part.
    draw(g,linewidth(bp)+p(sign), sign > 0 ? Arrow(TeXHead) : None);

    if(t > 0) {
      if(abs(t) <= 1) {
        z=arcpoint(g, (1-abs(t))*u);
        addtick(Label(pm(sign)+"$1$",align=EW(sign)), z, expi(sign), p(sign));
        r1=r1..z;
      } else addtick(Label(pm(sign)+"$1$",align=EW(sign), UnFill),
                     u*(cos(sign),sin(sign)), dir(degrees(sign*1.0)), p(sign));}

    draw(r1, dashed+p(sign));

    if(abs(t) <= pi/2) {
      z=arcpoint(g,(pi/2-abs(t))*u);
      addtick(Label("$"+pm(sign)+"\frac{\pi}{2}$",align=EW(sign)), z, expi(t), p(sign));
      rpis2=rpis2..z;
    } else addtick(Label("$"+pm(sign)+"\frac{\pi}{2}$",align=EW(sign), UnFill),
                   (0,sign*u), sign*N, p(sign));

    draw(rpis2, dashed+p(sign));

    if(abs(t) <= pi) {
      z=arcpoint(g,(pi-abs(t))*u);
      addtick(Label("$"+pm(sign)+"\pi$",align=EW(sign)), z, expi(t), p(sign));
      rpi=rpi..z;
    } else addtick(Label("$"+pm(sign)+"\pi$",align=EW(sign), UnFill),
                   (-u,0), W, p(sign));

    draw(rpi,dashed);

    if(abs(t) <= 3*pi/2) {
      z=arcpoint(g,(3pi/2-abs(t))*u);
      addtick(Label("$"+pm(sign)+"\frac{3\pi}{2}$",align=EW(sign)), z, expi(t), p(sign));
      rpi32=rpi32..z;
    } else addtick(Label("$"+pm(sign)+"\frac{3\pi}{2}$",align=EW(sign), UnFill),
                   (0,-sign*u), sign*S, p(sign));

    draw(rpi32, dashed+p(sign));

    if(abs(t)-2*pi < -1e-5) {
      z=arcpoint(g,(2*pi-abs(t))*u);
      addtick(Label("$"+pm(sign)+"2\pi$",align=EW(sign)), z, expi(t), p(sign));
      rpi2=rpi2..z;
    } else addtick(Label("$"+pm(sign)+"2\pi$",align=(sign > 0 ? 2 : 1)*EW(sign), UnFill),
                   (u,0), E, p(sign));

    draw(rpi2, dashed+p(sign));

    if(i == nb && sign == 1) {
      draw(tg,linewidth(2*bp)+p(sign));
      pic3.add(currentpicture);
      add(pic2);
      pic2=picanim(-1);
      pic2.add(pic3);
    } else add(pic2); // Add the common picture 'pic2'.

    draw(tg,linewidth(bp)+p(sign));
    A.add();
    if(sign > 0 || i != nb) erase();
  }
}

for (int i=0; i < 10; ++i) A.add();
clip(scale(1.6)*cle);
for (int i=0; i < 10; ++i) A.add();

eval(quote{
    addtick(Label("$-\pi$",align=EW(-1), UnFill), (-u,0), W, p(-1));
    addtick(Label("$-2\pi$",align=EW(-1), UnFill), (u,0), E, p(-1));
    defaultfilename='temp_';
    shipout(currentpicture.fit(scale(2cm)));},true);

pair center=(min(currentpicture)+max(currentpicture))/2;
int n=20;
for (int i=0; i <= n; ++i) {
  erase();
  label(scale(1+1.25*i/n)*graphic("temp_.pdf"),i/n*center);
  A.add();
}

for (int i=0; i < 20; ++i) A.add();
for (int i=0; i < 10; ++i) A.add(A.pictures[0]); // Add the first picture in the animation.

A.movie();

Étiquettes : , ,


Animation with Asymptote – fig0190

Category: Animation,AsymptotePh. Ivaldi @ 2 h 20 min

Figure 0019
(Compiled with Asymptote version 1.86svn-r4626)
Movie flash (swf)
This animation is available in the Syracuse web site.
    
size(12cm,0);
import hull_pi;
import animation;
animation A;
settings.outformat="pdf";

pair[] cloud;
int nbpt=200;

// Generate random points.
for (int i=0; i < nbpt; ++i)
  cloud.push((10*unitrand(),10*unitrand()));

for (int i=1; i < 8; ++i) { // Control the depth
  for (int j=0; j < 30; ++j) { // Point of view = cloud[i]
    real depthMax=i/2;
    // Nodes of the hull
    pair[] hull=hull(cloud,depthMin=0,depthMax=depthMax,angleMin=10,angleMax=360,pivot=j);

    save();// Add new picture to the animation
    filldraw(polygon(hull),lightgrey);
    dot(cloud[j],3mm+green);
    dot(cloud,red);
    label("depthMax="+(string)depthMax);
    A.add();
    restore();
  }
}

A.movie();

Étiquettes : ,


Animation with Asymptote – fig0200

Category: Animation,AsymptotePh. Ivaldi @ 3 h 20 min

Figure 0020
(Compiled with Asymptote version 1.86svn-r4626)
This animation is available in the Syracuse web site.
    
/* One may want to play with an interactive Java applet */
settings.render=0;
import three;
import animation;
animation A;

size(15cm);
currentprojection=orthographic(1,1,1.5);
currentlight=(1,0,1);

triple PXY=-X-Y;
triple P00=PXY+0.5*Z, P03=-X+Y, P33=X+Y, P30=X-Y;

triple[][] P0={
  {PXY,PXY+(0,0.5,0),P03+(0,-0.5,0),P03},
  {PXY+(0.5,0,0),(-0.5,-0.5,0),(-0.5,0.5,0),P03+(0.5,0,0)},
  {P30+(-0.5,0,0),(0.5,-0.5,0),(0.5,0.5,0),P33+(-0.5,0,0)},
  {P30,P30+(0,0.5,0),P33+(0,-0.5,0),P33}
};

triple[][][] P1={
  {
    {PXY,PXY+(0,0.5,0),P03+(0,-0.5,0),P03},
    {PXY+(0.5,0,0),(-0.5,-0.5,-2),(-0.5,0.5,-2),P03+(0.5,0,0)},
    {P30+(-0.5,0,0),(0.5,-0.5,-2),(0.5,0.5,-2),P33+(-0.5,0,0)},
    {P30,P30+(0,0.5,0),P33+(0,-0.5,0),P33}
  },
  {
    {P00,P00+(-0.5,0.5,-1),P03+(0,-0.5,1),P03},
    {P00+(0.5,-0.5,-1),(-0.5,-0.5,-2),(-0.5,0.5,-2),P03+(0.5,0,1)},
    {P30+(-0.5,0,1),(0.5,-0.5,-2),(0.5,0.5,-2),P33+(-0.5,0,1)},
    {P30,P30+(0,0.5,1),P33+(0,-0.5,1),P33}
  },
  {
    {P00,P00+(-0.5,0.5,-1),P03+(0,-0.5,1),P03},
    {P00+(0.5,-0.5,-1),(-0.5,-0.5,-2),(-0.5,0.5,2),P03+(0.5,0,1)},
    {P30+(-0.5,0,1),(0.5,-0.5,-2),(0.5,0.5,-2),P33+(-0.5,0,1)},
    {P30,P30+(0,0.5,1),P33+(0,-0.5,1),P33}
  },
  {
    {P00,P00+(-0.5,0.5,-1),P03+(0,-0.5,1),P03},
    {P00+(0.5,-0.5,-1),(-0.5,-0.5,-2),(-0.5,-0.5,2),P03+(0.5,0,1)},
    {P30+(-0.5,0,1),(0.5,-0.5,-2),(0.5,0.5,-2),P33+(-0.5,0,1)},
    {P30,P30+(0,0.5,1),P33+(0,-0.5,1),P33}
  }
};

triple[][] interp(triple[][] a, triple[][] b, real x)
{
  triple[][] c;
  for (int i=0; i < a.length; ++i) {
    triple [] t;
    for (int j=0; j < a[i].length; ++j) {
      t.push(interp(a[i][j],b[i][j],x));
    }
    c.push(t);
  }
  return c;
}

int n=20;
real step=1/n;

for (int i=0; i < P1.length; ++i) {
  for (int j=0; j <= n; ++j) {
    save();
    triple[][] P=interp(P0,P1[i],j*step);
    surface s=surface(P);
    draw(s,15,15,yellow,meshpen=grey);
    draw(sequence(new path3(int i){
          return s.s[i].external();},s.s.length), bp+red);

    dot("P[0][0]",P[0][0], align=N, black);
    dot("P[0][3]",P[0][3], black);
    dot("P[3][3]",P[3][3], align=S, black);
    dot("P[3][0]",P[3][0], align=W, black);

    draw(Label("P[0][1]",align=SW,EndPoint),P[0][0]--P[0][1], Arrow3);
    draw(Label("P[1][0]",align=SE,EndPoint),P[0][0]--P[1][0], Arrow3);

    draw(Label("P[0][2]",align=E,EndPoint),P[0][3]--P[0][2], Arrow3);
    draw(Label("P[1][3]",align=W,EndPoint),P[0][3]--P[1][3], Arrow3);

    draw(Label("P[2][3]",align=NE,EndPoint),P[3][3]--P[2][3], Arrow3);
    draw(Label("P[3][2]",align=NW,EndPoint),P[3][3]--P[3][2], Arrow3);

    draw(Label("P[3][1]",align=NE,EndPoint),P[3][0]--P[3][1], Arrow3);
    draw(Label("P[2][0]", align=W,EndPoint),P[3][0]--P[2][0], Arrow3);


    dot("P[1][1]",P[1][1], align=N);
    dot("P[1][2]",P[1][2], align=E);
    dot("P[2][2]",P[2][2], align=N);
    dot("P[2][1]",P[2][1], align=W);

    A.add();
    restore();
  }
  P0=copy(P1[i]);
}

for (int i=A.pictures.length-1; i >= 0 ; --i)
  A.add(A.pictures[i]);

A.movie(BBox(Fill(lightgrey)));

Étiquettes : , , , ,


  • Page 2 of 2
  • <
  • 1
  • 2