Retour

pst-torusmagic-doc.tex

Télécharger le fichier Fichier PDF
 
\documentclass{article}
\usepackage{pst-torusmagic}
\usepackage{pst-eucl}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{multicol}
\usepackage{manfnt}
\usepackage[garamond]{mathdesign}
\renewcommand{\ttdefault}{lmtt}
\usepackage{url}
\usepackage[a4paper]{geometry}
\usepackage[colorlinks=true]{hyperref}
\usepackage{showexpl}
\usepackage[french]{babel}
\title{Le tore magique : \\
une extension de \texttt{pst-solides3d}}
\date{2 janvier 2\,008}
\begin{document}
\maketitle
%\begin{abstract}
\section{Présentation}
Le \textit{tore magique} est une invention, un \textit{jouet} qui est parfaitement décrit sur le site :
 
\centerline{\url{http://www1.ttcn.ne.jp/~a-nishi/torus/z_torus.html}}
 
 avec photos et applet java. D'après l'auteur, mathématiquement il peut être décrit comme un ensemble de cercles de Villarceau.
 D'un point de vue pratique on peut imaginer deux cercles de même diamètre, faisant entre eux un angle $\alpha$ que l'on pourra faire varier,
 et tournant autour d'un axe vertical passant un point situé sur le diamètre commun, ce point pourra être déplacé.
 
 Les figures obtenues en faisant varier ces deux paramètres sont belles et très étonnantes et sont une excellente application de \texttt{pst-solides3d}.
 
 Les deux paramètres essentiels sont donc la distance \texttt{[r]} de l'axe au centre commun des cercles et l'angle d'ouverture \texttt{[angularAperture]} des deux cercles, donné en degrés.
 Le rayon des cercles \texttt{[R]} peut être choisi en option ainsi que le nombre de couples d'anneaux \texttt{[numberRings]}.
 
 On peut projeter le tore magique sur les trois plans avec les options et les paramètres suivants :
 \begin{itemize}
   \item \texttt{[projectionXY]} : projection du tore sur un plan parallèle à $Oxy$ avec la cote fixée par \texttt{[planXY=-6]} $(z=-6)$ valeur par défaut.
   \item \texttt{[projectionXZ]} : projection du tore sur un plan parallèle à $Oxz$ avec l'ordonnée fixée par \texttt{[planXZ=-6]} $(y=-6)$ valeur par défaut.
   \item \texttt{[projectionYZ]} : projection du tore sur un plan parallèle à $Oyz$ avec l'abscisse fixée par \texttt{[planYZ=-6]} $(x=-6)$ valeur par défaut.
 \end{itemize}
 Le tore en fil de fer s'obtient par la commande :
 \begin{verbatim}
 \psTorusMagic[R=3,r=1.5,angularAperture=90]%
 \end{verbatim}
Les projections avec une commande du type :
 \begin{verbatim}
\psTorusMagic[R=3,r=1.5,angularAperture=90,torusMagic,projectionXY,projectionXZ,projectionYZ]%
 \end{verbatim}
qui construira les trois projections, mais désactivera (si on le souhaite) avec \texttt{[torusmagic]} le dessin du tore central.
 
Pour dessiner le tore solide on utilisera la commande :
 \begin{verbatim}
\psTorusMagicSolid[R=3,r=1.5,angularAperture=90]%
 \end{verbatim}
\section{Quelques explications mathématiques}
Les deux cercles et l'axe de rotation $\Delta$.
\begin{center}
\def\Radius{3}\def\radius{2}\def\RX{0.75}\def\RZ{0}
\psset[pst-solides3d]{viewpoint=40 30 15,SphericalCoor,Decran=40}
\begin{pspicture}(-6,-3.5)(6,4.5)
\psframe(-6,-3.5)(6,4.5)
\defFunction[algebraic]{cercle1}(t){\Radius*cos(t)-\radius}{\Radius*sin(t)*cos(\RX)}{\Radius*sin(t)*sin(\RX)}
\psSolid[object=courbe,
    range=0 2 pi mul,
    linecolor=red,linewidth=2\pslinewidth,
    resolution=360,
    function=cercle1]%
\defFunction[algebraic]{cercle1}(t){\Radius*cos(t)-\radius}{\Radius*sin(t)*cos(-\RX)}{\Radius*sin(t)*sin(-\RX)}
\psSolid[object=courbe,
    range=0 2 pi mul,
    linecolor=red,linewidth=2\pslinewidth,
    resolution=180,
    function=cercle1]%
\psPoint(-\radius,0,0){O'}\psdot[linecolor=red](O')
\psPoint(-\radius,\Radius\space \RX\space Cos mul,\Radius\space \RX\space Sin mul neg){C1}
\psPoint(-\radius,\Radius\space \RX\space Cos mul,\Radius\space \RX\space Sin mul){C2}
\psline(C1)(O')(C2)\psdots[linecolor=blue](C1)(C2)
\psPoint(\Radius\space \radius\space add neg,0,0){O2}
\psPoint(0,0,0){O}
\psPoint(0,0,-3){Oz1}
\psPoint(0,0,4){Oz2}
\psline[linestyle=dashed,dash=1 0.2 0.05 0.2](Oz1)(Oz2)
\uput[r](Oz2){$\Delta$}
\psPoint(\Radius\space \radius\space sub,0,0){O1}
\psline(O1)(O2)
\psdot(O)
\pcline[offset=0.25]{<->}(O)(O')
\aput{:U}{$r$}
\pstMarkAngle[arrows=<->,MarkAngleRadius=0.8]{C1}{O'}{C2}{$\alpha$}
\defFunction[algebraic]{arccercle}(t){0.5*cos(t)}{0.5*sin(t)}{3}
\psSolid[object=courbe,
    range=pi 2 div neg 1 pi mul,
    linecolor={[cmyk]{1,0,1,0.5}},
    resolution=180,
    function=arccercle]%
\end{pspicture}
\end{center}
%\newpage
\begin{multicols}{2}
Paramétriquement, un cercle de rayon $R$ situé dans le plan $z=0$ de centre $O$, est défini par les équations :
\[
\left\{
\begin{array}{rcl}
x&=&R\cos t\\
y&=&R\sin t\\
z&=&0
\end{array}
\right.
\]
 
\[
\textrm{avec}\ 0\leq t<2\pi
\]
 
\columnbreak
\begin{pspicture}(-3,-1)(3,3)
\psset[pst-solides3d]{viewpoint=40 30 15,SphericalCoor,Decran=30}
\psframe(-3,-1)(3,3)
\defFunction[algebraic]{cercle}(t){3*cos(t)}{3*sin(t)}{0}
\psSolid[object=courbe,
    range=0 2 pi mul,
    linecolor=red,
    resolution=180,
    function=cercle]%
\psPoint(0,0,0){O}\psdot(O)\uput[d](O){$O$}
\axesIIID(0,0,0)(3.5,3.5,3)
\end{pspicture}
\end{multicols}
\begin{multicols}{2}
Si le cercle de rayon $R$ situé dans le plan $z=0$ a pour centre le point $\Omega(-r,0,0)$, les équations deviennent:
\[
\left\{
\begin{array}{rcl}
x&=&R\cos t-r\\
y&=&R\sin t\\
z&=&0
\end{array}
\right.
\]
 
\columnbreak
\begin{pspicture}(-3,-1)(3,3)
\psset[pst-solides3d]{viewpoint=40 30 15,SphericalCoor,Decran=30}
\psframe(-3,-1)(3,3)
\defFunction[algebraic]{cercle}(t){3*cos(t)-2}{3*sin(t)}{0}
\psSolid[object=courbe,
    range=0 2 pi mul,
    linecolor=red,
    resolution=180,
    function=cercle]%
\psPoint(0,0,0){O}\psdot(O)\uput[d](O){$O$}
\psPoint(-2,0,0){O'}\psdot[linecolor=red](O')\uput[u](O'){$\Omega$}
\psPoint(-5,0,0){O2}
\psline(O)(O2)
\pcline[offset=0]{<->}(O)(O')
\aput{:U}{$r$}
\axesIIID(0,0,0)(3.5,3.5,3)
\end{pspicture}
\end{multicols}
\begin{multicols}{2}
Maintenant, envisageons une rotation du cercle autour de $Ox$ d'un angle $\alpha$.
Les nouvelles coordonnées s'écrivent :
 
\[
\left\{
\begin{array}{rcl}
x'&=&x\\
y'&=&y\cos\alpha-z\sin\alpha\\
z'&=&y\sin\alpha+z\cos\alpha
\end{array}
\right.
\]
 
Les équations paramétriques du cercle deviennent :
\[
\left\{
\begin{array}{rcl}
x'&=&R\cos t-r\\
y'&=&R\sin t\cos\alpha\\
z'&=&R\sin t\sin\alpha
\end{array}
\right.
\]
 
\columnbreak
\begin{pspicture}(-3,-2)(3,3)
\psset[pst-solides3d]{viewpoint=40 30 15,SphericalCoor,Decran=30}
\psframe(-3,-2)(3,3)
\defFunction[algebraic]{cercle}(t){3*cos(t)-2}{3*sin(t)}{0}
\psSolid[object=courbe,
    range=0 2 pi mul,
    linecolor=red!50,
    resolution=180,
    function=cercle]%
\defFunction[algebraic]{cercle}(t){3*cos(t)-2}{3*sin(t)*cos(-0.7)}{3*sin(t)*sin(-0.7)}
\psSolid[object=courbe,
    range=0 2 pi mul,
    linecolor=red,
    resolution=180,
    function=cercle]%
\psPoint(0,0,0){O}\psdot(O)\uput[d](O){$O$}
\psPoint(-2,0,0){O'}\psdot[linecolor=red](O')\uput[u](O'){$\Omega$}
\psPoint(-5,0,0){O2}
\psline(O)(O2)
\pcline[offset=0]{<->}(O)(O')
\aput{:U}{$r$}
\psPoint(-2,3,0){C1}
\psPoint(-2,3 -0.7 Cos mul,3 -0.7 Sin mul){C2}
\psline(C1)(O')(C2)\psdots[linecolor=blue](C1)(C2)
\pstMarkAngle[arrows=<-,MarkAngleRadius=0.8]{C2}{O'}{C1}{$\alpha$}
\axesIIID(0,0,0)(3.5,3.5,3)
\end{pspicture}
\end{multicols}
\begin{multicols}{2}
Il reste à faire tourner le cercle ainsi obtenu autour de $Oz$ d'un angle $\beta$. Les nouvelles
coordonnées se déduisent des précédentes par les formules :
 
\[
\left\{
\begin{array}{rcl}
x''&=&x'\cos\beta+y'\sin\beta\\\
y''&=&-x'\sin\beta+y'\cos\beta\\
z''&=&z'
\end{array}
\right.
\]
 
Les équations paramétriques du cercle deviennent :
\[
\left\{
\begin{array}{rcl}
x&=&(R\cos t-r)\cos\beta+(R\sin t\cos\alpha)\sin\beta \\
y&=&-(R\cos t-r)\sin\beta+(R\sin t\cos\alpha)\cos\beta \\
z&=&R\sin t\sin\alpha
\end{array}
\right.
\]
 
\columnbreak
\begin{pspicture}(-3,-2)(3,3)
\psset[pst-solides3d]{viewpoint=40 30 15,SphericalCoor,Decran=30}
\psframe(-3,-2)(3,3)
\defFunction[algebraic]{cercle}(t){3*cos(t)-2}{3*sin(t)}{0}
\psSolid[object=courbe,
    range=0 2 pi mul,
    linecolor=red!50,
    resolution=180,
    function=cercle]%
\defFunction[algebraic]{cercle}(t){3*cos(t)-2}{3*sin(t)*cos(-0.7)}{3*sin(t)*sin(-0.7)}
\psSolid[object=courbe,
    range=0 2 pi mul,
    linecolor=red!80,
    resolution=180,
    function=cercle]%
\defFunction[algebraic]{cercle1}(t){(3*cos(t)-2)*cos(3.14)+(3*sin(t)*cos(-0.7))*sin(3.14)} %
                                   {-(3*cos(t)-2)*sin(3.14)+(3*sin(t)*cos(-0.7))*cos(3.14)}%
                                   {3*sin(t)*sin(-0.7)}
\psSolid[object=courbe,
    range=0 2 pi mul,
    linecolor=red,linewidth=2\pslinewidth,
    resolution=180,
    function=cercle1]%
\psPoint(0,0,0){O}\psdot(O)\uput[d](O){$O$}
\psPoint(-2,0,0){O'}\psdot[linecolor=red](O')\uput[u](O'){$\Omega$}
\psPoint(-5,0,0){O2}
\psline(O)(O2)
\pcline[offset=0]{<->}(O)(O')
\aput{:U}{$r$}
\psPoint(-2,3,0){C1}
\psPoint(-2,3 -0.7 Cos mul,3 -0.7 Sin mul){C2}
\psline(C1)(O')(C2)\psdots[linecolor=blue](C1)(C2)
\pstMarkAngle[arrows=<-,MarkAngleRadius=0.8]{C2}{O'}{C1}{$\alpha$}
\axesIIID(0,0,0)(3.5,3.5,3)
\axesIIID(0,0,0)(3.5,3.5,3)
\end{pspicture}
\end{multicols}
 
\section{Le tore magique en fil de fer}
\begin{LTXexample}[pos=t]
\psset[pst-solides3d]{viewpoint=40 30 10,SphericalCoor,Decran=30}
\begin{pspicture}(-6,-3)(6,3)
\psframe*[linecolor=gray](-6,-3)(6,3)
\psTorusMagic[R=3,r=1.5,angularAperture=90,linecolor=white,linewidth=0.5\pslinewidth]%
\end{pspicture}
\end{LTXexample}
\section{Le tore magique solide}
\begin{LTXexample}[pos=t]
\psset[pst-solides3d]{viewpoint=40 30 30,SphericalCoor,Decran=30}
\begin{pspicture}(-6,-3)(6,3)
\psset{%
   incolor=yellow!50,fillcolor=green!25,
   linecolor={[cmyk]{1,0,1,0.5}}}
\psframe(-6,-3)(6,3)
\psTorusMagicSolid[R=3,r=1.5,angularAperture=90]%
\end{pspicture}
\end{LTXexample}
\section{Les projections du tore magique}
\begin{LTXexample}[pos=t]
\psset{unit=0.8}
\psset[pst-solides3d]{viewpoint=40 30 30,SphericalCoor,Decran=30}
\begin{pspicture}(-8,-9)(7,5)
\psset{%
   incolor=yellow!50,fillcolor=green!25,
   linecolor={[cmyk]{1,0,1,0.5}}}
\psframe*(-8,-9)(7,5)
\psSolid[object=grille,base=-6 6 -6 6,linecolor=red,linewidth=0.5\pslinewidth,ngrid=12](0,0,-6)
\psSolid[object=grille,base=-6 6 -6 3,RotX=-90,linecolor=red,linewidth=0.5\pslinewidth,ngrid=12 9](0,-6,-3)
\psSolid[object=grille,base=-6 3 -6 6,RotY=90,linecolor=red,linewidth=0.5\pslinewidth,ngrid=9 12](-6,0,-3)
\psTorusMagic[R=3,r=1.5,angularAperture=90,linecolor=red,linewidth=0.75\pslinewidth,torusMagic,projectionXY,projectionXZ,projectionYZ]%
\psTorusMagicSolid[R=3,r=1.5,angularAperture=90]%
\red\gridIIID[Zmin=-6,Zmax=3,QZ=-1.5,linecolor=red](-6,6)(-6,6)
\end{pspicture}
\end{LTXexample}
\section{Influence de l'angle d'ouverture sur la forme du tore}
\begin{LTXexample}[pos=t]
\psset{unit=0.8}
\psset[pst-solides3d]{viewpoint=40 30 30,SphericalCoor,Decran=30}
\psset{%
   incolor=yellow!50,fillcolor=green!25,
   linecolor={[cmyk]{1,0,1,0.5}}}
\begin{pspicture}(-8,-9)(7,5)
\psframe*[linecolor=gray](-8,-9)(7,5)
\psSolid[object=grille,base=-6 6 -6 6,linecolor=red,linewidth=0.5\pslinewidth,ngrid=12](0,0,-6)
%\psSolid[object=grille,base=-6 6 -6 3,RotX=-90,linecolor=red,linewidth=0.5\pslinewidth](0,-6,-3)%
%\psSolid[object=grille,base=-6 3 -6 6,RotY=90,linecolor=red,linewidth=0.5\pslinewidth](-6,0,-3)%
\psTorusMagic[R=3,r=1.5,angularAperture=180,torusMagic,projectionXY,projectionXZ,projectionYZ]%
\psTorusMagic[R=3,r=1.5,angularAperture=180,linecolor=red]%
\gridIIID[Zmin=-6,Zmax=3,QZ=-1.5,linecolor=black](-6,6)(-6,6)
\end{pspicture}
\end{LTXexample}
\begin{LTXexample}[pos=t]
\psset{unit=0.8}
\psset[pst-solides3d]{viewpoint=40 30 30,SphericalCoor,Decran=30}
\psset{%
   incolor=yellow!50,fillcolor=green!25,
   linecolor={[cmyk]{1,0,1,0.5}}}
\begin{pspicture}(-8,-9)(7,5)
\psframe*[linecolor=gray](-8,-9)(7,5)
\psSolid[object=grille,base=-6 6 -6 6,linecolor=red,linewidth=0.5\pslinewidth,ngrid=12](0,0,-6)
%\psSolid[object=grille,base=-6 6 -6 3,RotX=-90,linecolor=red,linewidth=0.5\pslinewidth](0,-6,-3)
%\psSolid[object=grille,base=-6 3 -6 6,RotY=90,linecolor=red,linewidth=0.5\pslinewidth](-6,0,-3)
\psTorusMagic[R=3,r=1.5,angularAperture=10,torusMagic,projectionXY,projectionXZ,projectionYZ]%
\psTorusMagic[R=3,r=1.5,angularAperture=10,linecolor=red]%
\gridIIID[Zmin=-6,Zmax=3,QZ=-1.5,linecolor=black](-6,6)(-6,6)
\end{pspicture}
\end{LTXexample}
\section{L'intérieur du tore solide}
\begin{LTXexample}[pos=t]
\psset{unit=0.8}
\psset[pst-solides3d]{viewpoint=40 10 20,SphericalCoor,Decran=40,lightsrc=10 10 30}
\begin{pspicture}(-8,-8)(8,8)
\psframe*[linecolor=gray!50](-8,-8)(8,8)
\psSolid[object=grille,base=-5 5 -5 5,linecolor=red,ngrid=10,linewidth=0.5\pslinewidth,ngrid=10](0,0,-3)
\psTorusMagicSolid[R=3,r=2,angularAperture=200,
   linecolor={[cmyk]{1,0,1,0.5}},
   hue=0 1 0.5 1,incolor=yellow!50,linewidth=0.5\pslinewidth,
   base=0 360 -150 120]%
\gridIIID[Zmin=-3,Zmax=3](-5,5)(-5,5)
\end{pspicture}
\end{LTXexample}
\begin{LTXexample}[pos=t]
\psset{unit=0.8}
\psset[pst-solides3d]{viewpoint=40 10 20,SphericalCoor,Decran=40,lightsrc=10 10 30}
\begin{pspicture}(-8,-8)(8,8)
\psframe*[linecolor=gray!50](-8,-8)(8,8)
\psSolid[object=grille,base=-6 6 -6 6,linecolor=red,ngrid=12,linewidth=0.5\pslinewidth](0,0,-3)
\psTorusMagicSolid[R=3,r=3,angularAperture=85,
   linecolor={[cmyk]{1,0,1,0.5}},
   incolor=yellow!50,linewidth=0.5\pslinewidth,
   base=0 360 -150 120]%
\gridIIID[Zmin=-3,Zmax=3](-6,6)(-6,6)
\end{pspicture}
\end{LTXexample}
\end{document}