jeudi 28 avril 2016
Illustration de la loi de Mariotte (Boyle)
\documentclass{article}
\usepackage[paperwidth=15cm,paperheight=4cm,hmargin={0cm,0cm},vmargin={0cm,0cm},dvips]{geometry}
\usepackage{pstricks,multido}%
\input{random.tex} % From Donald Arseneau (on macros/generic on CTAN)
\def\syringe#1{% position piston -3.5<->-0.5
\psclip{\psframe(#1,-1)(0.8,1)}
\RandomMolecule{400}{#1}
\endpsclip
\psline[doubleline=true,doublesep=2mm](1,0)(3.1,0)
\rput(!#1 -2 sub 0){\pscircle[doubleline=true](-6.5,0){0.6}
\psframe[fillstyle=solid,fillcolor=yellow!10](-6,-0.5)(-2,0.5)
\psline[linewidth=2mm](-2,-1)(-2,1)}%
\psframe(-4,1)(0.8,-1)
\multido{\n=-3.5+0.5}{9}{%
\psline(\n,1)(\n,0.7)}
\pscircle[doubleline=true,fillstyle=solid](4,0){1}
\psarc(4,0){0.65}{-60}{240}
\multido{\i=-60+30}{11}{\rput(4,0){\psline(0.65;\i)(0.45;\i)}}
\rput{!337.5 #1 45 mul sub}(4,0){\psline[arrowscale=2,linewidth=2\pslinewidth]{->}(-0.5,0)(0.65,0)}
\psframe[fillstyle=solid](-4.1,-1.2)(-4,1.2)
\psline(0.8,1)(1,0.1)(1,-0.1)(0.8,-1)
}%
% idée empruntée à Denis Girou
\newdimen\X
\newdimen\Y
\def\RandomMolecule#1#2{%
\multido{\i=1+1}{#1}{%
\setrandim\X{#2 pt}{1pt}
\setrandim\Y{-1pt}{1pt}
\pscircle*[linecolor=blue](\pointless\X,\pointless\Y){1pt}}}
\pagestyle{empty}
\begin{document}
\begin{center}
\multido{\r=-3.5+0.1}{32}{%
\begin{pspicture}(-9,-2)(6,2)
\psframe(-9,-2)(6,2)
\syringe{\r}
\end{pspicture}\newpage}
\multido{\r=-0.3+-0.1}{32}{%
\begin{pspicture}(-9,-2)(6,2)
\psframe(-9,-2)(6,2)
\syringe{\r}
\end{pspicture}\newpage}
\end{center}
\end{document}
->
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire