vendredi 2 août 2013

Voici le drapeau allemand flottant par grand vent : une idée de Gilg Jürgen.


Le code utilise la macro \psFrameNL(llx,lly)(urx,ury) qui a été intégrée dans le package pst-nltr mis à jour :

Il est constitué de pst-nltr.pro, pst-nltr.sty et pst-nltr.tex qui sont dans le répertoire :

applications-conformes

Le code permettant de créer les 288 images de l'animation de Gilg Jürgen :

\documentclass[fleqn]{article}
\usepackage[T1]{fontenc}
\usepackage{multido}
\usepackage{pst-nltr}

\pagestyle{empty}

\definecolor{germanRed}{HTML}{FF0000}
\definecolor{germanGold}{HTML}{FFCC00}

\begin{document}
\begin{center}
\multido{\i=0+1}{288}{
\begin{pspicture}[showgrid=false](-2,-2)(6,5)
\psframe*[linecolor=cyan!10!white](-2.1,-2.1)(6,5.1)
\psframe(-2.1,-2.1)(6,5.1)
\pstVerb{
/Frequence {1 144 div} bind def
/temps \i\space def % \`{a} incr\'{e}menter de 1 en 1 => 36
/FC {
/y exch def
/x exch def
/r x dup mul y dup mul add sqrt def
/Lambda 8 def            % longueur d'onde
  360 Frequence temps mul r Lambda div sub mul cos 0.5 mul
    x add
  360 Frequence temps mul r Lambda div sub mul cos 0.5 mul
    y add
} def}%
\psset{transform=FC}
\psFrameNL[fillstyle=solid,fillcolor=black,linecolor=black](0,3)(5,4)%
\psFrameNL[fillstyle=solid,fillcolor=germanRed,linecolor=germanRed](0,2)(5,3)%
\psFrameNL[fillstyle=solid,fillcolor=germanGold,linecolor=germanGold](0,1)(5,2)
\psFrameNL(0,1)(5,4)
\psCircleNL[fillstyle=solid,fillcolor=white](0.25,1.25){0.1}
\psCircleNL[fillstyle=solid,fillcolor=white](0.25,3.75){0.1}
\pnodeNL(0.25,3.75){A}
\pnodeNL(0.25,1.25){B}
\psline[linecolor=gray!50!orange,linewidth=0.1,linecap=1](-2,-2)(-2,5)
\psline(-1.9,1.25)(B)\psline(-1.9,3.75)(A)
\psellipse(-2,1.25)(0.1,0.05)
\psellipse(-2,3.75)(0.1,0.05)
\psline[linecolor=gray!50!orange,linewidth=0.1](-2,5)(-2,3.75)
\psline[linecolor=gray!50!orange,linewidth=0.1](-2,2)(-2,1.25)
\pscurve(-1.9,1.25)(-1.8,2.5)(-1.9,3.75)
\pstVerb{
/FC {
/y exch cm_1 def
/x exch cm_1 def
/r x dup mul y dup mul add sqrt def
/Lambda 8 def            % longueur d'onde
  360 Frequence temps mul r Lambda div sub mul cos 0.5 mul
    x add cm
  360 Frequence temps mul r Lambda div sub mul cos 0.5 mul
    y add cm
} def}%
\psset{transform=FC}
\psTransformText[fillstyle=solid,fillcolor=black,linewidth=0.01,fontscale=0.35,pos=bc,PSfont=Helvetica](2.5,1.25){German flag}%
\end{pspicture}\newpage}
\end{center}
\end{document}

Aucun commentaire:

Enregistrer un commentaire