\documentclass{article}
\usepackage{pstricks,pst-key,pst-eps,multido}
\usepackage[a4paper]{geometry}
\makeatletter
\define@key{psset}{radius}{\edef\psk@disquetournant@R{#1}} \define@key{psset}{vitesse}{\edef\psk@disquetournant@vitesse{#1}} \define@key{psset}{scale}{\edef\psk@disquetournant@scale{#1}} \define@key{psset}{date}{\edef\psk@disquetournant@date{#1}} \define@key{psset}{tmax}{\edef\psk@disquetournant@tmax{#1}} \setkeys{psset}{radius=.35,vitesse=7,scale=0.025,date=0.5,tmax=0.6}
\newif\ifPst@Volant@Circles
\define@key{psset}{circles}{\@nameuse{Pst@Volant@Circles#1}}\newif\ifPst@Volant@Construction
\define@key{psset}{construction}{\@nameuse{Pst@Volant@Construction#1}}\newif\ifPst@Volant@trajectoires
\define@key{psset}{trajectoires}{\@nameuse{Pst@Volant@trajectoires#1}}\newif\ifPst@Volant@disque
\define@key{psset}{disque}{\@nameuse{Pst@Volant@disque#1}}\setkeys{psset}{circles=true,construction=false,trajectoires=false,disque=true}
\def\variables{ -100 0 translate
/V \psk@disquetournant@vitesse\space def
/R \psk@disquetournant@R\space def
/reduction {\psk@disquetournant@scale\space mul} def
/date \psk@disquetournant@date\space def
/g 9.81 def /VitesseAngulaire V R div 180 mul 3.1459 div def
/tmax \psk@disquetournant@tmax\space def
/NumberTimes tmax 0.1 div cvi def
}
\def\PSTvolant{\pst@object{PSTvolant}}
\def\PSTvolant@i{\@ifnextchar[{\PSTvolant@do}{\PSTvolant@do[]}}
\def\PSTvolant@do[#1]{{\pst@killglue
\setkeys{psset}{#1}\begin@OpenObj
\addto@pscode{\variables
\ifPst@Volant@trajectoires
0 30 330 { /Theta exch def
/color Theta 360 div def
/cosT Theta cos def
/sinT Theta sin def
/Xi R sinT mul neg 2845 mul reduction def
/Yi R cosT mul neg 2845 mul reduction def
Xi Yi moveto
0 0.01 tmax { /time exch def /Xc R sinT mul neg V 1 cosT sub mul time mul add def
/Yc R cosT mul neg
V sinT mul time mul add
g time dup mul mul 2 div sub
def
/Xpt Xc 2845 mul reduction def
/Ypt Yc 2845 mul reduction def
Xpt Ypt
lineto
} for
0.5 setlinewidth
1 0 1 setrgbcolor
stroke
} for
\fi
1 setlinewidth
-30 30 330 { /Theta exch def
/color Theta 360 div def
/cosT Theta cos def
/sinT Theta sin def
/Xinitial R sinT mul neg 2845 mul reduction def /Yinitial R cosT mul neg 2845 mul reduction def /Xc R sinT mul neg V 1 cosT sub mul date mul add def
/Yc R cosT mul neg
V sinT mul date mul add
g date dup mul mul 2 div sub
def
/Xpt Xc 2845 mul reduction def
/Ypt Yc 2845 mul reduction def
gsave
newpath
Xpt Ypt 2 0 360 arc
color 1 1 sethsbcolor
fill closepath
grestore
\ifPst@Volant@Construction
/Yv Yc g date dup mul mul 2 div add def
/Yvpt Yv 2845 mul reduction def
0 setgray
0.5 setlinewidth
Xinitial
Yinitial
moveto
Xpt Yvpt lineto
Xpt Ypt lineto
stroke
\fi
/velo{ /LaRoue {
0 setgray
2 setlinewidth
V date mul 2845 mul reduction 0 R 2845 mul reduction 0 360 arc
stroke
newpath
1 setgray
V date mul 2845 mul reduction 0 4 0 360 arc
closepath
fill
0 setgray
V date mul 2845 mul reduction 0 4 0 360 arc
stroke }
def
/HUE 0 def
0 30 330 {
/Angle exch def
/AnglePt Angle
VitesseAngulaire date mul add
def
/abscissePtDisque
AnglePt sin R mul neg
V date mul add 2845 mul reduction
def
/ordonneeePtDisque
AnglePt cos R mul neg
2845 mul reduction def
1 setlinewidth
V date mul 2845 mul reduction 0 moveto
abscissePtDisque ordonneeePtDisque lineto
/HUE Angle 360 div def
HUE 1 1 sethsbcolor
stroke
LaRoue
} for
}
def
} for
\ifPst@Volant@disque
/unit R 2845 mul reduction def
gsave
velo
unit 3 mul 0 translate
velo
stroke
grestore
gsave
2 setlinewidth
1 setlinejoin
V date mul 2845 mul reduction 0 translate
gsave
0 0 moveto
1.5 unit mul 0 lineto
2 3 div unit mul 4 3 div unit mul lineto
closepath
stroke
grestore
gsave
1.5 unit mul 0 5 0 360 arc
1.5 unit mul 0 moveto
2 unit mul 4 3 div unit mul lineto
3 unit mul 0 lineto
stroke
grestore
gsave
2 unit mul 4 3 div unit mul moveto
2 3 div unit mul 4 3 div unit mul lineto
2 unit mul 4 3 div unit mul moveto
2 unit mul 5 3 div unit mul lineto
2 unit mul 2 unit mul 1 3 div unit mul -90 90 arc
2 unit mul 2 unit mul 1 3 div unit mul add moveto
1.6 unit mul 2 unit mul 1 3 div unit mul add lineto
stroke
grestore
2 3 div unit mul 4 3 div unit mul moveto
unit 5 3 div unit mul lineto
0.3 unit mul 5 3 div unit mul lineto
0.3 unit mul 4 3 div unit mul lineto
closepath
fill
\fi
-100 R 2845 mul reduction neg moveto
300 R 2845 mul reduction neg lineto
300 R 2845 mul reduction neg -20 add lineto
-100 R 2845 mul reduction neg -20 add lineto
closepath
1 setgray
fill
-100 R 2845 mul reduction neg moveto
300 R 2845 mul reduction neg lineto
2 setlinewidth
0 setgray
stroke
} \end@OpenObj
}}\def\PSTvolantEnveloppe{\pst@object{PSTvolantEnveloppe}}
\def\PSTvolantEnveloppe@i{\@ifnextchar[{\PSTvolantEnveloppe@do}{\PSTvolantEnveloppe@do[]}}
\def\PSTvolantEnveloppe@do[#1]{{\pst@killglue
\setkeys{psset}{#1}\begin@OpenObj
\addto@pscode{\variables
/Helvetica
findfont 8 scalefont setfont
/Chaine 7 string def
/Affiche
{ Chaine cvs show } def
\ifPst@Volant@Circles
0 .1 tmax { /temps exch def
/Ycentre g temps dup mul 2 div mul neg def
/rayon R dup mul V dup mul temps dup mul mul add sqrt def
0 Ycentre 2845 mul reduction rayon 2845 mul reduction 0 360 arc
stroke
gsave
0 Ycentre 2845 mul reduction rayon 2845 mul reduction sub moveto
(t = ) show
temps Affiche
grestore
} for
\else
/Ycentre g date dup mul 2 div mul neg def
/rayon R dup mul V dup mul date dup mul mul add sqrt def
gsave
0 0 1 setrgbcolor
0.5 setlinewidth
0 Ycentre 2845 mul reduction rayon 2845 mul reduction 0 360 arc
stroke
0 1 1 setrgbcolor
0 0 rayon 2845 mul reduction 0 360 arc
stroke
grestore
gsave
0 Ycentre 2845 mul reduction rayon 2845 mul reduction sub moveto
(t = ) show
date Affiche
grestore
\fi
}\end@OpenObj
}}
\makeatother
\newcommand{\pssave}[2]{\PSTtoEPS[headers=all,bburx=10cm,bbury=6cm,bbllx=-7cm,bblly=-1cm]{#1.eps}{#2}}
\pagestyle{empty}
\begin{document}
\psset{disque=false}
\multido{\i=1+1}{30}{\pssave{volant\the\multidocount}{\multido{\rdate=0.00+0.025}{\i}{\ifnum\multidocount=\i\psset{disque=true}\fi
\PSTvolant[vitesse=5,date=\rdate]}}}
\end{document}

—
Syracuse — Dernière modification : 20 juin 2002 (0.07s - 3788638 - 23 novembre 2008)