Retour

Source : rotationcubearete.mp


rotationcubearete.mp
%%Choix
%verbatimtex
%&Latex
%\documentclass{article}
%\usepackage[frenchb]{babel}
%\usepackage[latin1]{inputenc}
%\begin{document}
%etex
%%%%%%%%%
prologues:=2;
input constantes;
input geometrie31;
pair p[],q[],r[],s[],t[];
p0=u*(10,10);%O
p1=u*(15,10);%y
p2=u*(10,15);%z
p3=u*(12,12);%x
path cadre;
cadre=(0,5u)--(20u,5u)--(20u,20u)--(0,20u)--cycle;
path cerclebase;
cerclebase=cercle(p0,abs(p0-p1));
for k=0 step 0.05 until 1:
  beginfig(k*100);
    draw cadre;
    q[100*k]=point(k*length cerclebase) of cerclebase;
    r[100*k]=q[100*k] rotatedabout(p0,90);
    q[100*k+1]=projet(q[100*k],p0,p1);
    r[100*k+1]=projet(r[100*k],p0,p1);
    s[100*k]=parallele(q[100*k+1],p0,p3,10) intersectionpoint parallele(q[100*k],p2,p3,10);
    t[100*k]=parallele(r[100*k+1],p0,p3,10) intersectionpoint parallele(r[100*k],p2,p3,10);
    draw p2--(s[100*k] shifted(p2-p0))--((t[100*k] shifted (s[100*k]-p0)) shifted(p2-p0))--(t[100*k] shifted(p2-p0))--cycle;%haut
    if (100*k<10) or ((100*k>80) and (100*k<100)):
      draw p0--p2 withcolor red;
      draw p0--s[100*k]--(t[100*k] shifted (s[100*k]-p0));
      draw (t[100*k] shifted (s[100*k]-p0))--t[100*k]--p0 dashed evenly;%bas
      draw t[100*k]--(t[100*k] shifted (p2-p0)) dashed evenly;%arête verticale1
      draw s[100*k]--(s[100*k] shifted (p2-p0));%arête verticale5
      draw (t[100*k] shifted (s[100*k]-p0))--((t[100*k] shifted (s[100*k]-p0)) shifted (p2-p0));%arête verticale4
    fi
    if ((100*k>5) and (100*k<35)):
      draw p0--p2 withcolor red;
      draw t[100*k]--p0--s[100*k];
      draw s[100*k]--(t[100*k] shifted (s[100*k]-p0))--t[100*k] dashed evenly;
      draw t[100*k]--(t[100*k] shifted (p2-p0));%arête verticale1
      draw s[100*k]--(s[100*k] shifted (p2-p0));%arête verticale5
      draw (t[100*k] shifted (s[100*k]-p0))--((t[100*k] shifted (s[100*k]-p0)) shifted (p2-p0)) dashed evenly;%arête verticale4
    fi
    if ((100*k>30) and (100*k<60)):
      draw p0--p2 withcolor red;
      draw p0--s[100*k]--(t[100*k] shifted (s[100*k]-p0)) dashed evenly;
      draw (t[100*k] shifted (s[100*k]-p0))--t[100*k]--p0;
      draw t[100*k]--(t[100*k] shifted (p2-p0));%arête verticale1
      draw s[100*k]--(s[100*k] shifted (p2-p0)) dashed evenly;%arête verticale5
      draw (t[100*k] shifted (s[100*k]-p0))--((t[100*k] shifted (s[100*k]-p0)) shifted (p2-p0));%arête verticale4
    fi
    if ((100*k>55) and (100*k<85)):
      draw p0--p2 dashed evenly withcolor red;
      draw t[100*k]--p0--s[100*k] dashed evenly;
      draw s[100*k]--(t[100*k] shifted (s[100*k]-p0))--t[100*k];      
      draw t[100*k]--(t[100*k] shifted (p2-p0));%arête verticale1
      draw s[100*k]--(s[100*k] shifted (p2-p0));%arête verticale5
      draw (t[100*k] shifted (s[100*k]-p0))--((t[100*k] shifted (s[100*k]-p0)) shifted (p2-p0));%arête verticale4
    fi
  endfig;
endfor;
end
%draw s[100*k]--t[100*k];
    %draw 5[p0,p1]--5[p2,p1];
    %dotlabel.top(btex $p_1$ etex,p1);
    %dotlabel.top(btex $p_2$ etex,p2);
    %dotlabel.top(btex $p_3$ etex,p3);
    %dotlabel.top(btex $p_0$ etex,p0);
    %dotlabel.top(btex $M$ etex,q[100*k]);
    %dotlabel.top(btex $P$ etex,r[100*k]);
    %dotlabel.top(btex $M'$ etex,q[100*k+1]);
    %dotlabel.top(btex $P'$ etex,r[100*k+1]);
    %dotlabel.top(btex $S$ etex,s[100*k]);
    %dotlabel.top(btex $R$ etex,t[100*k]);
    %draw cerclebase;
    %draw q[100*k]--p0--r[100*k];