diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pas-cours')
-rw-r--r-- | Master/texmf-dist/doc/latex/pas-cours/README | 38 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/pas-cours/README.TEXLIVE | 7 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/pas-cours/attention.png | bin | 0 -> 3259 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/pas-cours/coeur.png | bin | 0 -> 7596 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/pas-cours/macro-patrons.tex | 318 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/pas-cours/macro-solides.tex | 717 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex | 444 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/pas-cours/prerequis.png | bin | 0 -> 79314 bytes |
8 files changed, 1524 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/pas-cours/README b/Master/texmf-dist/doc/latex/pas-cours/README new file mode 100644 index 00000000000..1f912286af4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pas-cours/README @@ -0,0 +1,38 @@ +************* README file for pas-cv ********************** +********************* ENGLISH ***************************** + +This package uses TikZ to built mathematics lessons. + +Licence +------- + +This program can be redistributed and/or modified under the terms +of the LaTeX Project Public License Distributed from CTAN +archives in directory macros/latex/base/lppl.txt. + +Documentation +------------- + +The documentation of the package is in the ZIP file or under the +directory /doc/ in french language. + +Thanks to use pas-cours.sty. + +************* Fichier README pour pas-cv ********************** +********************** FRANCAIS ******************************* + +Cette extension utilise TikZ pour écrire des cours de mathématiques. + +Licence +------- + +L'extension peut être redistribuée et/ou modifiée sous les termes +de la licence LaTeX Project Public (voir macros/latex/base/lppl.txt). + +Documentation +------------- + +La documentation de l'extension se trouve dans le fichier ZIP ou +dans dans le répertoire /doc/. + +Merci d'utiliser pas-cours.sty. diff --git a/Master/texmf-dist/doc/latex/pas-cours/README.TEXLIVE b/Master/texmf-dist/doc/latex/pas-cours/README.TEXLIVE new file mode 100644 index 00000000000..42894e1d574 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pas-cours/README.TEXLIVE @@ -0,0 +1,7 @@ +The following files have been removed in the TeX Live installation of +the current package, typically due to duplication, lack of space, or +missing source code. You can find these files on CTAN at + http://mirror.ctan.org/macros/latex/contrib/pas-cours +If questions or concerns, email tex-live@tug.org. + + pas-cours.pdf diff --git a/Master/texmf-dist/doc/latex/pas-cours/attention.png b/Master/texmf-dist/doc/latex/pas-cours/attention.png Binary files differnew file mode 100644 index 00000000000..b11a7b6a4f1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pas-cours/attention.png diff --git a/Master/texmf-dist/doc/latex/pas-cours/coeur.png b/Master/texmf-dist/doc/latex/pas-cours/coeur.png Binary files differnew file mode 100644 index 00000000000..4e87936a794 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pas-cours/coeur.png diff --git a/Master/texmf-dist/doc/latex/pas-cours/macro-patrons.tex b/Master/texmf-dist/doc/latex/pas-cours/macro-patrons.tex new file mode 100644 index 00000000000..a682bb6f7d6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pas-cours/macro-patrons.tex @@ -0,0 +1,318 @@ +% Fichiers comprenant les macros de construction des patrons de solides + +% \patronprismereg[ n = nombre de côtés de la base, +% h = hauteur du prisme, +% r = rayon du cercle circonscrit à la base, +% pos = 1 ou 2 ou ... ou n (position de la face du haut) +% legende (booléen)] + +\define@cmdkey [PAS] {patronprismereg} {r}{} +\define@cmdkey [PAS] {patronprismereg} {h}{} +\define@cmdkey [PAS] {patronprismereg} {n}{} +\define@cmdkey [PAS] {patronprismereg} {pos}{} +\define@boolkey[PAS] {patronprismereg} {legende}[true]{} + +\presetkeys [PAS] {patronprismereg} { + n = 3, + r = 3, + h = 5, + pos = 1, + legende = false}{} + +\newcommand*{\patronprismereg}[1][]{\pasPatronprismereg[#1]} + +\def\pasPatronprismereg[#1]{ + \setkeys[PAS]{patronprismereg}{#1} + \pgfmathparse{360/\cmdPAS@patronprismereg@n}\let\angle\pgfmathresult + \foreach \i in {1,...,\cmdPAS@patronprismereg@n} + { + \pgfmathparse{\cmdPAS@patronprismereg@r*cos(\angle*(\i-1))}\let\x\pgfmathresult + \pgfmathparse{\cmdPAS@patronprismereg@r*sin(\angle*(\i-1))}\let\y\pgfmathresult + \coordinate (A\i) at (\x,\y); + + \pgfmathparse{\cmdPAS@patronprismereg@r*cos(\angle*\i)}\let\x\pgfmathresult + \pgfmathparse{\cmdPAS@patronprismereg@r*sin(\angle*\i)}\let\y\pgfmathresult + \coordinate (D\i) at (\x,\y); + + \pgfmathparse{\cmdPAS@patronprismereg@h*cos(\angle/2+(\i-1)*\angle)}\let\x\pgfmathresult + \pgfmathparse{\cmdPAS@patronprismereg@h*sin(\angle/2+(\i-1)*\angle)}\let\y\pgfmathresult + \coordinate (B\i) at ($(A\i)+(\x,\y)$); + \coordinate (C\i) at ($(D\i)+(\x,\y)$); + + \draw (A\i) -- (D\i) -- (C\i) -- (B\i) -- cycle; + } + + \ifPAS@patronprismereg@legende + \draw[dotted] (D1) -- (0,0) -- (A1); + \pgfmathparse{.5*cos(\angle/2)}\let\x\pgfmathresult + \pgfmathparse{.5*sin(\angle/2)}\let\y\pgfmathresult + \draw[dotted,<->,>=stealth'] (.5,0) arc (0:\angle:.5cm); + \node[right,scale=.5] at (\x,\y) {\angle $^{\circ}$}; + \node[below,scale=.5] at (\cmdPAS@patronprismereg@r/2,0) {\cmdPAS@patronprismereg@r}; + \coordinate (M) at (barycentric cs:A1=1,D1=1); + \coordinate (N) at (barycentric cs:B1=1,C1=1); + \draw[<->,>=stealth',dotted] (M) -- (N) node[midway,above,scale=.5,rotate=\angle/2] {\cmdPAS@patronprismereg@h}; + \fi + + % Face du haut + \pgfmathparse{2*\cmdPAS@patronprismereg@r*cos(\angle/2)+\cmdPAS@patronprismereg@h}\let\d\pgfmathresult + \pgfmathparse{\d*cos(\angle/2+(\cmdPAS@patronprismereg@pos-1)*\angle)}\let\tx\pgfmathresult + \pgfmathparse{\d*sin(\angle/2+(\cmdPAS@patronprismereg@pos-1)*\angle)}\let\ty\pgfmathresult + \coordinate (O) at (\tx,\ty); + \foreach \i in {1,...,\cmdPAS@patronprismereg@n} + { + \coordinate (C\i) at ($(A\i)+(\tx,\ty)$); + \coordinate (B\i) at (barycentric cs:C\i=1,O=-2); + } + + \draw (B1) \foreach \i in {2,...,\cmdPAS@patronprismereg@n}{-- (B\i)} -- cycle; +} + +% \patronpyramreg[ n = nombre de côtés de la base, +% h = hauteur de la pyramide, +% r = rayon du cercle circonscrit à la base, +% legende (booléen)] + +\define@cmdkey [PAS] {patronpyramreg} {r}{} +\define@cmdkey [PAS] {patronpyramreg} {h}{} +\define@cmdkey [PAS] {patronpyramreg} {n}{} +\define@boolkey[PAS] {patronpyramreg} {legende}[true]{} + +\presetkeys [PAS] {patronpyramreg} { + n = 3, + r = 3, + h = 5, + legende = false}{} + +\newcommand*{\patronpyramreg}[1][]{\pasPatronpyramreg[#1]} + +\def\pasPatronpyramreg[#1]{ + \setkeys[PAS]{patronpyramreg}{#1} + \foreach \i in {1,...,\cmdPAS@patronpyramreg@n} + { + \pgfmathparse{\cmdPAS@patronpyramreg@r*cos((360/\cmdPAS@patronpyramreg@n)*(\i-1))}\let\x\pgfmathresult + \pgfmathparse{\cmdPAS@patronpyramreg@r*sin((360/\cmdPAS@patronpyramreg@n)*(\i-1))}\let\y\pgfmathresult + \coordinate (A\i) at (\x,\y); + \pgfmathparse{(\cmdPAS@patronpyramreg@h+\cmdPAS@patronpyramreg@r*cos(180/\cmdPAS@patronpyramreg@n))*cos((360/\cmdPAS@patronpyramreg@n)*(\i-1)+(180/\cmdPAS@patronpyramreg@n))}\let\x\pgfmathresult + \pgfmathparse{(\cmdPAS@patronpyramreg@h+\cmdPAS@patronpyramreg@r*cos(180/\cmdPAS@patronpyramreg@n))*sin((360/\cmdPAS@patronpyramreg@n)*(\i-1)+(180/\cmdPAS@patronpyramreg@n))}\let\y\pgfmathresult + \coordinate (S\i) at (\x,\y); + } + \draw (A1) -- (S1) \foreach \i in {2,...,\cmdPAS@patronpyramreg@n} {-- (A\i) -- (S\i)} -- cycle; + \draw (A1) \foreach \i in {2,...,\cmdPAS@patronpyramreg@n} {-- (A\i)} -- cycle; + \ifPAS@patronpyramreg@legende + \draw[dotted] (A1) -- (0,0) -- (A2); + \pgfmathparse{360/\cmdPAS@patronpyramreg@n}\let\angle\pgfmathresult + \pgfmathparse{.5*cos(180/\cmdPAS@patronpyramreg@n)}\let\x\pgfmathresult + \pgfmathparse{.5*sin(180/\cmdPAS@patronpyramreg@n)}\let\y\pgfmathresult + \draw[dotted,<->,>=stealth'] (.5,0) arc (0:\angle:.5cm); + \node[right,scale=.5] at (\x,\y) {\angle $^{\circ}$}; + \node[below,scale=.5] at (\cmdPAS@patronpyramreg@r/2,0) {\cmdPAS@patronpyramreg@r}; + \coordinate (M) at (barycentric cs:A1=1,A2=1); + \draw[<->,>=stealth',dotted] (M) -- (S1) node[midway,above,scale=.5,rotate=\angle/2] {\cmdPAS@patronpyramreg@h}; + \fi +} + +% \patroncone +% Synthaxe : \patroncone[ r = rayon de la base, +% h = hauteur du cône, +% legende (booléen)] + +\define@cmdkey [PAS] {patroncone} {r}{} +\define@cmdkey [PAS] {patroncone} {h}{} +\define@boolkey[PAS] {patroncone} {legende}[true]{} + +\presetkeys [PAS] {patroncone} { + r = 3, + h = 5, + legende = false}{} + +\newcommand*{\patroncone}[1][]{\pasPatroncone[#1]} + +\def\pasPatroncone[#1]{ + \setkeys[PAS]{patroncone}{#1} + \pgfmathparse{360*\cmdPAS@patroncone@r/\cmdPAS@patroncone@h}\let\angle\pgfmathresult + \draw (0,-\cmdPAS@patroncone@h-\cmdPAS@patroncone@r) circle (\cmdPAS@patroncone@r cm); + \pgfmathparse{\cmdPAS@patroncone@h*cos(270-\angle/2)}\let\x\pgfmathresult + \pgfmathparse{\cmdPAS@patroncone@h*sin(270-\angle/2)}\let\y\pgfmathresult + \draw (0,0) -- (\x,\y) arc (270-\angle/2:270+\angle/2:\cmdPAS@patroncone@h cm) -- cycle; + \ifPAS@patroncone@legende + \node[below] at (\x/2,\y/2) {\cmdPAS@patroncone@h}; + \node[below] at (-\x/2,\y/2) {\cmdPAS@patroncone@h}; + \pgfmathparse{cos(270-\angle/2)}\let\x\pgfmathresult + \pgfmathparse{sin(270-\angle/2)}\let\y\pgfmathresult + \draw[<->,>=stealth'] (\x,\y) arc (270-\angle/2:270+\angle/2:1cm); + \node[above,scale=.5] at (0,-1.3) {\angle $^{\circ}$}; + \pgfmathparse{\cmdPAS@patroncone@r*cos(-30)}\let\x\pgfmathresult + \pgfmathparse{\cmdPAS@patroncone@r*sin(-30)-\cmdPAS@patroncone@h-\cmdPAS@patroncone@r}\let\y\pgfmathresult + \draw[<->,>=stealth'] (0,-\cmdPAS@patroncone@h-\cmdPAS@patroncone@r) -- (\x,\y) node[midway,above] {\cmdPAS@patroncone@r}; + \fi +} + +% \patroncylindre +% Synthaxe : \patroncylindre[ r = rayon de la base, +% h = hauteur du cône, +% legende (booléen)] + +\define@cmdkey [PAS] {patroncylindre} {r}{} +\define@cmdkey [PAS] {patroncylindre} {h}{} +\define@boolkey[PAS] {patroncylindre} {legende}[true]{} + +\presetkeys [PAS] {patroncylindre} { + r = 2, + h = 5, + legende = false}{} + +\newcommand*{\patroncylindre}[1][]{\pasPatroncylindre[#1]} + +\def\pasPatroncylindre[#1]{ + \setkeys[PAS]{patroncylindre}{#1} + \draw (0,\cmdPAS@patroncylindre@h+\cmdPAS@patroncylindre@r) circle (\cmdPAS@patroncylindre@r cm); + \draw (0,-\cmdPAS@patroncylindre@r) circle (\cmdPAS@patroncylindre@r cm); + \pgfmathparse{\cmdPAS@patroncylindre@r*3.19159}\let\demilongueur\pgfmathresult + \draw (-\demilongueur,0) rectangle +(2*\demilongueur,\cmdPAS@patroncylindre@h); + \ifPAS@patroncylindre@legende + \draw[<->,>=stealth'] (-\demilongueur,-2*\cmdPAS@patroncylindre@r-1) -- (\demilongueur,-2*\cmdPAS@patroncylindre@r-1) node[midway,fill=white] {$2\pi \times \cmdPAS@patroncylindre@r$}; + \draw[dotted] (-\demilongueur,0) -- (-\demilongueur,-2*\cmdPAS@patroncylindre@r-1); + \draw[dotted] (\demilongueur,0) -- (\demilongueur,-2*\cmdPAS@patroncylindre@r-1); + \draw[<->,>=stealth'] (\demilongueur+1,0) -- (\demilongueur+1,\cmdPAS@patroncylindre@h) node[midway,right] {\cmdPAS@patroncylindre@h}; + \draw[dotted] (\demilongueur,0) -- (\demilongueur+1,0); + \draw[dotted] (\demilongueur,\cmdPAS@patroncylindre@h) -- (\demilongueur+1,\cmdPAS@patroncylindre@h); + \draw[<->,>=stealth'] (0,\cmdPAS@patroncylindre@h+\cmdPAS@patroncylindre@r) -- (\cmdPAS@patroncylindre@r,\cmdPAS@patroncylindre@h+\cmdPAS@patroncylindre@r) node[midway,fill=white] {\cmdPAS@patroncylindre@r}; + \draw[<->,>=stealth'] (0,-\cmdPAS@patroncylindre@r) -- (\cmdPAS@patroncylindre@r,-\cmdPAS@patroncylindre@r) node[midway,fill=white] {\cmdPAS@patroncylindre@r}; + \fi +} + + +% \patronpave : dessine un patron de pavé droit +% Synthaxe : \patronpave[ a = dimension 1, +% b = dimension 2, +% c = dimension 3, +% pos = position des rabats (1, 2, 3 ou 4), +% codages (booléen), +% legende (booléen)] + +\define@cmdkey [PAS] {patronpave} {a}{} +\define@cmdkey [PAS] {patronpave} {b}{} +\define@cmdkey [PAS] {patronpave} {c}{} +\define@cmdkey [PAS] {patronpave} {pos}{} +\define@boolkey[PAS] {patronpave} {codages}[true]{} +\define@boolkey[PAS] {patronpave} {legende}[true]{} + +\presetkeys [PAS] {patronpave} { + a = 3, + b = 3, + c = 3, + pos = 2, + codages = false, + legende = false}{} + +\newcommand*{\patronpave}[1][]{\pasPatronpave[#1]} + +\def\pasPatronpave[#1]{ + \setkeys[PAS]{patronpave}{#1} + \draw (0,0) rectangle +(2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b); + \draw (\cmdPAS@patronpave@c,0) -- (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b); + \draw (\cmdPAS@patronpave@a+\cmdPAS@patronpave@c,0) -- (\cmdPAS@patronpave@a+\cmdPAS@patronpave@c,\cmdPAS@patronpave@b); + \draw (\cmdPAS@patronpave@a+2*\cmdPAS@patronpave@c,0) -- (\cmdPAS@patronpave@a+2*\cmdPAS@patronpave@c,\cmdPAS@patronpave@b); + \ifPAS@patronpave@codages + \node[scale=.5] at (\cmdPAS@patronpave@c/2,\cmdPAS@patronpave@b) {///}; + \node[scale=.5] at (\cmdPAS@patronpave@c/2,0) {///}; + \node[scale=.5] at (3*\cmdPAS@patronpave@c/2+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b) {///}; + \node[scale=.5] at (3*\cmdPAS@patronpave@c/2+\cmdPAS@patronpave@a,0) {///}; + \node[scale=.5] at (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a/2,0) {/}; + \node[scale=.5] at (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a/2,\cmdPAS@patronpave@b) {/}; + \node[scale=.5] at (2*\cmdPAS@patronpave@c+3*\cmdPAS@patronpave@a/2,0) {/}; + \node[scale=.5] at (2*\cmdPAS@patronpave@c+3*\cmdPAS@patronpave@a/2,\cmdPAS@patronpave@b) {/}; + \node[rotate=90,scale=.5] at (0,\cmdPAS@patronpave@b/2) {//}; + \node[rotate=90,scale=.5] at (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b/2) {//}; + \node[rotate=90,scale=.5] at (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b/2) {//}; + \node[rotate=90,scale=.5] at (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b/2) {//}; + \node[rotate=90,scale=.5] at (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b/2) {//}; + \fi + \IfStrEq{\cmdPAS@patronpave@pos}{1} + { + \draw (0,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) rectangle +(\cmdPAS@patronpave@c,-2*\cmdPAS@patronpave@a-\cmdPAS@patronpave@b); + \ifPAS@patronpave@codages + \node[scale=.5,rotate=90] at (0,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a/2) {/}; + \node[scale=.5] at (\cmdPAS@patronpave@c/2,\cmdPAS@patronpave@a+\cmdPAS@patronpave@b) {///}; + \node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a/2) {/}; + \node[scale=.5,rotate=90] at (0,-\cmdPAS@patronpave@a/2) {/}; + \node[scale=.5] at (\cmdPAS@patronpave@c/2,-\cmdPAS@patronpave@a) {///}; + \node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c,-\cmdPAS@patronpave@a/2) {/}; + \fi + \ifPAS@patronpave@legende + \draw[gray,dotted] (0,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) -- (0,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1); + \draw[gray,dotted] (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) -- (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1); + \draw[<->,>=stealth'] (0,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1) -- (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1) node[midway,above] {\cmdPAS@patronpave@c}; + \draw[gray,dotted] (\cmdPAS@patronpave@a+2*\cmdPAS@patronpave@c,0) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,-1); + \draw[gray,dotted] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,0) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,-1); + \draw[<->,>=stealth'] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,-1) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,-1) node[midway,below] {\cmdPAS@patronpave@a}; + \fi + } + { + \IfStrEq{\cmdPAS@patronpave@pos}{2} + { + \draw (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) rectangle +(\cmdPAS@patronpave@a,-2*\cmdPAS@patronpave@c-\cmdPAS@patronpave@b); + \ifPAS@patronpave@codages + \node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c/2) {///}; + \node[scale=.5] at (\cmdPAS@patronpave@a/2+\cmdPAS@patronpave@c,\cmdPAS@patronpave@c+\cmdPAS@patronpave@b) {/}; + \node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c/2) {///}; + \node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c,-\cmdPAS@patronpave@c/2) {///}; + \node[scale=.5] at (\cmdPAS@patronpave@a/2+\cmdPAS@patronpave@c,-\cmdPAS@patronpave@c) {/}; + \node[scale=.5,rotate=90] at (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,-\cmdPAS@patronpave@c/2) {///}; + \fi + \ifPAS@patronpave@legende + \draw[gray,dotted] (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) -- (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1); + \draw[gray,dotted] (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) -- (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1); + \draw[<->,>=stealth'] (\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1) -- (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1) node[midway,above] {\cmdPAS@patronpave@a}; + \draw[gray,dotted] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1); + \draw[<->,>=stealth'] (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1) node[midway,above] {\cmdPAS@patronpave@c}; + \fi + } + { + \IfStrEq{\cmdPAS@patronpave@pos}{3} + { + \draw (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) rectangle +(\cmdPAS@patronpave@c,-2*\cmdPAS@patronpave@a-\cmdPAS@patronpave@b); + \ifPAS@patronpave@codages + \node[scale=.5,rotate=90] at (\cmdPAS@patronpave@a+\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a/2) {/}; + \node[scale=.5] at (\cmdPAS@patronpave@a+\cmdPAS@patronpave@c+\cmdPAS@patronpave@c/2,\cmdPAS@patronpave@a+\cmdPAS@patronpave@b) {///}; + \node[scale=.5,rotate=90] at (\cmdPAS@patronpave@a+2*\cmdPAS@patronpave@c,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a/2) {/}; + \node[scale=.5,rotate=90] at (\cmdPAS@patronpave@a+\cmdPAS@patronpave@c,-\cmdPAS@patronpave@a/2) {/}; + \node[scale=.5] at (\cmdPAS@patronpave@a+3*\cmdPAS@patronpave@c/2,-\cmdPAS@patronpave@a) {///}; + \node[scale=.5,rotate=90] at (\cmdPAS@patronpave@a+2*\cmdPAS@patronpave@c,-\cmdPAS@patronpave@a/2) {/}; + \fi + \ifPAS@patronpave@legende + \draw[gray,dotted] (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) -- (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1); + \draw[gray,dotted] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1); + \draw[<->,>=stealth'] (\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@a+1) node[midway,above] {\cmdPAS@patronpave@c}; + \draw[gray,dotted] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1); + \draw[<->,>=stealth'] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+1) node[midway,above] {\cmdPAS@patronpave@a}; + \fi + } + { + \draw (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) rectangle +(\cmdPAS@patronpave@a,-2*\cmdPAS@patronpave@c-\cmdPAS@patronpave@b); + \ifPAS@patronpave@codages + \node[scale=.5,rotate=90] at (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c/2) {///}; + \node[scale=.5] at (2*\cmdPAS@patronpave@c+3*\cmdPAS@patronpave@a/2,\cmdPAS@patronpave@c+\cmdPAS@patronpave@b) {/}; + \node[scale=.5,rotate=90] at (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c/2) {///}; + \node[scale=.5,rotate=90] at (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,-\cmdPAS@patronpave@c/2) {///}; + \node[scale=.5] at (2*\cmdPAS@patronpave@c+3*\cmdPAS@patronpave@a/2,-\cmdPAS@patronpave@c) {/}; + \node[scale=.5,rotate=90] at (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,-\cmdPAS@patronpave@c/2) {///}; + \fi + \ifPAS@patronpave@legende + \draw[gray,dotted] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) -- (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1); + \draw[gray,dotted] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1); + \draw[<->,>=stealth'] (2*\cmdPAS@patronpave@c+\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b+\cmdPAS@patronpave@c+1) node[midway,above] {\cmdPAS@patronpave@a}; + \draw[gray,dotted] (0,0) -- (0,-1); + \draw[gray,dotted] (\cmdPAS@patronpave@c,0) -- (\cmdPAS@patronpave@c,-1); + \draw[<->,>=stealth'] (0,-1) -- (\cmdPAS@patronpave@c,-1) node[midway,below] {\cmdPAS@patronpave@c}; + \fi + } + } + } + \ifPAS@patronpave@legende + \draw[gray,dotted] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,\cmdPAS@patronpave@b) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a+1,\cmdPAS@patronpave@b); + \draw[gray,dotted] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a,0) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a+1,0); + \draw[<->,>=stealth'] (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a+1,\cmdPAS@patronpave@b) -- (2*\cmdPAS@patronpave@c+2*\cmdPAS@patronpave@a+1,0) node[midway,right] {\cmdPAS@patronpave@b}; + \fi +} diff --git a/Master/texmf-dist/doc/latex/pas-cours/macro-solides.tex b/Master/texmf-dist/doc/latex/pas-cours/macro-solides.tex new file mode 100644 index 00000000000..7a33a05a89d --- /dev/null +++ b/Master/texmf-dist/doc/latex/pas-cours/macro-solides.tex @@ -0,0 +1,717 @@ +% Fichier comprenant les macros construisant les solides + +% \prismereg : dessine un prisme à base régulière +% Synthaxe : \prismreg[ n = nombre de côtés de la base (>2) - par défaut : 3, +% bordercolor = ... (par défaut : noir), +% incolor = ... (par défaut : blanc), +% coefopaq = ... (par défaut : 0.5), +% axe (booléen : si oui, axe tracé), +% axecolor = couleur de l'axe (par défaut : rouge), +% name (booléen : si oui, nom du sommet et du centre de la base mentionnés), +% sommet = nom du sommet (par défaut : S), +% posommet = ..., +% centre = nom du centre de la base (par défaut : O), +% scalecentre = coef. d'agrandissement du point du centre de la base, +% poscentre = position du nom du centre de la base (par défaut : below), +% hauteur = ... (par défaut, 5 cm), +% rayon = ... (par défaut, 2 cm), +% legende : booléen, +% incl = coefficient d'inclinaison de la base (par défaut : 1), +% rotat = angle de rotation (par défaut : 0°)] + +\define@cmdkey [PAS] {prismereg} {n}{} +\define@cmdkey [PAS] {prismereg} {bordercolor}{} +\define@cmdkey [PAS] {prismereg} {incolor}{} +\define@cmdkey [PAS] {prismereg} {coefopaq}{} +\define@boolkey[PAS] {prismereg} {axe}[true]{} +\define@cmdkey [PAS] {prismereg} {axecolor}{} +\define@boolkey[PAS] {prismereg} {name}[true]{} +\define@boolkey[PAS] {prismereg} {legende}[true]{} +\define@cmdkey [PAS] {prismereg} {hauteur}{} +\define@cmdkey [PAS] {prismereg} {rayon}{} +\define@cmdkey [PAS] {prismereg} {incl}{} +\define@cmdkey [PAS] {prismereg} {rotat}{} + +\presetkeys [PAS] {prismereg} { + n = 3, + bordercolor = black, + incolor = white, + coefopaq = 0.5, + axe = false, + axecolor = red, + legende = false, + name = false, + hauteur = 5, + rayon = 2, + rotat = 0.1, + incl = 1}{} + +\newcommand*{\prismereg}[1][]{\pasPrismereg[#1]} + +\def\pasPrismereg[#1]{ + \setkeys[PAS]{prismereg}{#1} + \pgfmathparse{\cmdPAS@prismereg@n==3} + \IfStrEq{\pgfmathresult}{1.0}{\def\rotat{10}}{\def\rotat{\cmdPAS@prismereg@rotat}} + \def\cotes{\cmdPAS@prismereg@n} + \pgfmathparse{\cotes-1}\let\cote\pgfmathresult + \ifPAS@prismereg@name + \foreach \i in {1,2,...,\cotes} + { + \pgfmathparse{(360/\cotes)*(\i-1)+\cmdPAS@prismereg@rotat}\let\angle\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@rayon*cos(\angle)}\let\Mx\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@incl*sin(\angle)}\let\My\pgfmathresult + \IfStrEq{\angle}{0.1} + { + \def\posname{right} + } + { + \IfStrEq{\angle}{180.0} + { + \def\posname{left} + } + { + \IfStrEq{\angle}{90.0} + { + \def\posname{above} + } + { + \IfStrEq{\angle}{270.0} + { + \def\posname{below} + } + { + \pgfmathparse{\angle<180} + \IfStrEq{\pgfmathresult}{1.0} + { + \pgfmathparse{\angle<90} + \IfStrEq{\pgfmathresult}{1.0} + { + \def\posname{above right} + } + { + \def\posname{above left} + } + } + { + \pgfmathparse{\angle<270} + \IfStrEq{\pgfmathresult}{1.0} + { + \def\posname{below left} + } + { + \def\posname{below right} + } + } + } + } + } + } + \node[\posname,\cmdPAS@prismereg@bordercolor] at (\Mx,\My) {$A_{\i}$}; + } + \fi + \pgfmathparse{\cmdPAS@prismereg@rayon*cos((360/\cotes)*\cote+\rotat)}\let\Mx\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@incl*sin((360/\cotes)*\cote+\rotat)}\let\My\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@rayon*cos(\rotat)}\let\Nx\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@incl*sin(\rotat)}\let\Ny\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@rayon*cos((360/\cotes)+\rotat)}\let\Px\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@incl*sin((360/\cotes)+\rotat)}\let\Py\pgfmathresult + \shade[draw=\cmdPAS@prismereg@bordercolor,shading=ball, ball color=\cmdPAS@prismereg@incolor,opacity=\cmdPAS@prismereg@coefopaq] (\Nx,\Ny) -- (\Px,\Py) -- (\Px,\Py+\cmdPAS@prismereg@hauteur) -- (\Nx,\Ny+\cmdPAS@prismereg@hauteur) -- cycle; + \draw[\cmdPAS@prismereg@bordercolor] (\Mx,\My) -- (\Nx,\Ny) -- (\Nx,\Ny+\cmdPAS@prismereg@hauteur); + \foreach \i in {1,...,\cote} + { + \pgfmathparse{\cmdPAS@prismereg@rayon*cos((360/\cotes)*\i+\rotat)}\let\Mx\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@incl*sin((360/\cotes)*\i+\rotat)}\let\My\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@hauteur+\cmdPAS@prismereg@incl*sin((360/\cotes)*\i+\rotat)}\let\MMy\pgfmathresult + \path[coordinate] (\Mx,\MMy) coordinate (T\i); + \IfStrEq{\i}{1}{\global\def\xi{\Mx}\global\def\yi{\My}}{} + \pgfmathparse{\cmdPAS@prismereg@rayon*cos((360/\cotes)*(\i-1)+\rotat)}\let\Nx\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@incl*sin((360/\cotes)*(\i-1)+\rotat)}\let\Ny\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@rayon*cos((360/\cotes)*(\i+1)+\rotat)}\let\Px\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@incl*sin((360/\cotes)*(\i+1)+\rotat)}\let\Py\pgfmathresult + \IfStrEq{\cotes}{3}{\def\ang{120}}{\def\ang{140}} + \pgfmathparse{(360/\cotes)*\i<181} + \IfStrEq{\pgfmathresult}{1.0} + { + \draw[dotted,\cmdPAS@prismereg@bordercolor] (\Nx,\Ny) -- (\Mx,\My); + } + { + \draw[\cmdPAS@prismereg@bordercolor] (\Nx,\Ny) -- (\Mx,\My); + } + \pgfmathparse{(360/\cotes)*\i<\ang} + \IfStrEq{\pgfmathresult}{1.0} + { + \shade[shading=ball, ball color=\cmdPAS@prismereg@incolor,opacity=\cmdPAS@prismereg@coefopaq] (\Mx,\My+\cmdPAS@prismereg@hauteur) -- (\Mx,\My) -- (\Px,\Py) -- (\Px,\Py+\cmdPAS@prismereg@hauteur) -- cycle; + \draw[dotted,\cmdPAS@prismereg@bordercolor] (\Mx,\My) -- (\Mx,\My+\cmdPAS@prismereg@hauteur); + } + { + \shade[shading=ball, ball color=\cmdPAS@prismereg@incolor,opacity=\cmdPAS@prismereg@coefopaq] (\Mx,\My+\cmdPAS@prismereg@hauteur) -- (\Mx,\My) -- (\Px,\Py) -- (\Px,\Py+\cmdPAS@prismereg@hauteur) -- cycle; + \draw[\cmdPAS@prismereg@bordercolor] (\Mx,\My+\cmdPAS@prismereg@hauteur) -- (\Mx,\My) -- (\Px,\Py) -- (\Px,\Py+\cmdPAS@prismereg@hauteur); + } + } + \pgfmathparse{\cmdPAS@prismereg@rayon*cos(\rotat)}\let\Mx\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@hauteur+\cmdPAS@prismereg@incl*sin(\rotat)}\let\MMy\pgfmathresult + \path[coordinate] (\Mx,\MMy) coordinate (T\cotes); + \shade[shading=ball, ball color=\cmdPAS@prismereg@incolor,opacity=\cmdPAS@prismereg@coefopaq] (T1) + \foreach \i in {2,...,\cotes}{--(T\i)}--cycle; + \draw[\cmdPAS@prismereg@bordercolor] (T1) + \foreach \i in {2,...,\cotes}{--(T\i)}--cycle; + \ifPAS@prismereg@legende + \IfStrEq{\cmdPAS@prismereg@incolor}{white}{\def\couleur{black}}{\def\couleur{\cmdPAS@prismereg@incolor}} + % Bases + \pgfmathparse{\cmdPAS@prismereg@rayon*cos(-85)+.5}\let\x\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@incl*sin(-85)-1}\let\y\pgfmathresult + \draw[<-,>=stealth,dotted,\couleur] (.5,-.5) to [bend right=30] (\x,\y) node[right,\couleur] {\texttt{base (polygonale)}}; + \draw[<-,>=stealth,dotted,\couleur] (.5,.5+\cmdPAS@prismereg@hauteur) to [bend left=30] (\x,\y+\cmdPAS@prismereg@hauteur+4) node[right,\couleur] {\texttt{base (polygonale)}}; + % Faces latérales + \pgfmathparse{\cmdPAS@prismereg@rayon*cos(\rotat)}\let\Mx\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@incl*sin(\rotat)}\let\My\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@rayon*cos(\rotat-360/\cotes)}\let\Nx\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@incl*sin(\rotat-360/\cotes)}\let\Ny\pgfmathresult + \coordinate (M) at (\Mx,\My); + \coordinate (N) at (\Nx,\Ny); + \coordinate (T) at (\Nx,\Ny+\cmdPAS@prismereg@hauteur); + \coordinate (G) at (barycentric cs:M=1,N=1,T=1,T\cotes=1); + \draw[<-,>=stealth,\couleur] (G) to [bend left=30] ($(G)+(1.5,.5)$) node[right,\couleur] {\begin{minipage}{3cm}\texttt{face lat\'erale (rectangulaire)}\end{minipage}}; + % Hauteur + \draw[\cmdPAS@prismereg@axecolor,dotted] (T\cotes) -- ($(T\cotes)+(5,0)$); + \draw[\cmdPAS@prismereg@axecolor,dotted] (M) -- ($(M)+(5,0)$); + \draw[<->,\cmdPAS@prismereg@axecolor,>=stealth'] ($(T\cotes)+(5,0)$) -- ($(M)+(5,0)$) node[midway,right,\cmdPAS@prismereg@axecolor] {\texttt{hauteur}}; + \fi + \ifPAS@prismereg@axe + \draw[dotted,\cmdPAS@prismereg@axecolor] (0,\cmdPAS@prismereg@hauteur) -- (0,-\cmdPAS@prismereg@incl); + \draw[\cmdPAS@prismereg@axecolor] (0,\cmdPAS@prismereg@hauteur) -- (0,\cmdPAS@prismereg@hauteur+1); + \draw[\cmdPAS@prismereg@axecolor] (0,-\cmdPAS@prismereg@incl) -- (0,-\cmdPAS@prismereg@incl-1); + \ifPAS@prismereg@legende + \draw[<-,>=stealth',\cmdPAS@prismereg@axecolor] (0,\cmdPAS@prismereg@hauteur+.5) to [bend right=20] (-\cmdPAS@prismereg@rayon/2,\cmdPAS@prismereg@hauteur+1) node[left,\cmdPAS@prismereg@axecolor] {\texttt{axe de rotation}}; + \fi + \fi + \ifPAS@prismereg@name + \foreach \i in {1,2,...,\cotes} + { + \pgfmathparse{(360/\cotes)*(\i-1)+\cmdPAS@prismereg@rotat}\let\angle\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@rayon*cos(\angle)}\let\Mx\pgfmathresult + \pgfmathparse{\cmdPAS@prismereg@incl*sin(\angle)}\let\My\pgfmathresult + \IfStrEq{\angle}{0.1} + { + \def\posname{right} + } + { + \IfStrEq{\angle}{180.0} + { + \def\posname{left} + } + { + \IfStrEq{\angle}{90.0} + { + \def\posname{above} + } + { + \IfStrEq{\angle}{270.0} + { + \def\posname{below} + } + { + \pgfmathparse{\angle<180} + \IfStrEq{\pgfmathresult}{1.0} + { + \pgfmathparse{\angle<90} + \IfStrEq{\pgfmathresult}{1.0} + { + \def\posname{above right} + } + { + \def\posname{above left} + } + } + { + \pgfmathparse{\angle<270} + \IfStrEq{\pgfmathresult}{1.0} + { + \def\posname{below left} + } + { + \def\posname{below right} + } + } + } + } + } + } + \node[\posname,\cmdPAS@prismereg@bordercolor] at (\Mx,\My+\cmdPAS@prismereg@hauteur) {$B_{\i}$}; + } + \fi +} + + +% \pyramreg : dessine une pyramide à base régulière +% Synthaxe : \pyramreg[ n = nombre de côtés de la base (>2) - par défaut : 3, +% bordercolor = ... (par défaut : noir), +% incolor = ... (par défaut : blanc), +% coefopaq = ... (par défaut : 0.5), +% axe (booléen : si oui, axe tracé), +% axecolor = couleur de l'axe (par défaut : rouge), +% name (booléen : si oui, nom du sommet et du centre de la base mentionnés), +% sommet = nom du sommet (par défaut : S), +% posommet = ..., +% centre = nom du centre de la base (par défaut : O), +% scalecentre = coef. d'agrandissement du point du centre de la base, +% poscentre = position du nom du centre de la base (par défaut : below), +% hauteur = ... (par défaut, 5 cm), +% rayon = ... (par défaut, 2 cm), +% legende : booléen, +% incl = coefficient d'inclinaison de la base (par défaut : 1), +% rotat = angle de rotation] + +\define@cmdkey [PAS] {pyramreg} {n}{} +\define@cmdkey [PAS] {pyramreg} {bordercolor}{} +\define@cmdkey [PAS] {pyramreg} {incolor}{} +\define@cmdkey [PAS] {pyramreg} {coefopaq}{} +\define@boolkey[PAS] {pyramreg} {axe}[true]{} +\define@cmdkey [PAS] {pyramreg} {axecolor}{} +\define@boolkey[PAS] {pyramreg} {name}[true]{} +\define@boolkey[PAS] {pyramreg} {legende}[true]{} +\define@cmdkey [PAS] {pyramreg} {sommet}{} +\define@cmdkey [PAS] {pyramreg} {posommet}{} +\define@cmdkey [PAS] {pyramreg} {centre}{} +\define@cmdkey [PAS] {pyramreg} {poscentre}{} +\define@cmdkey [PAS] {pyramreg} {scalecentre}{} +\define@cmdkey [PAS] {pyramreg} {hauteur}{} +\define@cmdkey [PAS] {pyramreg} {rayon}{} +\define@cmdkey [PAS] {pyramreg} {rotat}{} +\define@cmdkey [PAS] {pyramreg} {incl}{} + +\presetkeys [PAS] {pyramreg} { + n = 3, + bordercolor = black, + incolor = white, + coefopaq = 0.5, + axe = false, + axecolor = red, + name = false, + legende = false, + sommet = S, + posommet = above, + centre = O, + poscentre = below, + scalecentre = 1, + hauteur = 5, + rayon = 2, + rotat = 0.1, + incl = 1}{} + +\newcommand*{\pyramreg}[1][]{\pasPyramreg[#1]} + +\def\pasPyramreg[#1]{ + \setkeys[PAS]{pyramreg}{#1} + \def\cotes{\cmdPAS@pyramreg@n} + \pgfmathparse{\cotes-1}\let\cote\pgfmathresult + \ifPAS@pyramreg@legende + \pgfmathparse{\cmdPAS@pyramreg@rayon*cos(-85)+.5}\let\x\pgfmathresult + \pgfmathparse{\cmdPAS@pyramreg@incl*sin(-85)-1}\let\y\pgfmathresult + \draw[<-,>=stealth,dotted,\cmdPAS@pyramreg@incolor] (.5,-.5) to [bend right=30] (\x,\y) node[right,\cmdPAS@pyramreg@incolor] {\texttt{base (polygonale)}}; + \fi + \ifPAS@pyramreg@name + \fill[\cmdPAS@pyramreg@bordercolor] (0,0) circle (\cmdPAS@pyramreg@scalecentre*0.01cm) node[\cmdPAS@pyramreg@bordercolor,\cmdPAS@pyramreg@poscentre] {\cmdPAS@pyramreg@centre}; + \node[\cmdPAS@pyramreg@posommet,\cmdPAS@pyramreg@bordercolor] at (0,\cmdPAS@pyramreg@hauteur) {\cmdPAS@pyramreg@sommet}; + \foreach \i in {1,2,...,\cotes} + { + \pgfmathparse{(360/\cotes)*(\i-1)+\cmdPAS@pyramreg@rotat}\let\angle\pgfmathresult + \pgfmathparse{\cmdPAS@pyramreg@rayon*cos(\angle)}\let\Mx\pgfmathresult + \pgfmathparse{\cmdPAS@pyramreg@incl*sin(\angle)}\let\My\pgfmathresult + \IfStrEq{\angle}{0.1} + { + \def\posname{right} + } + { + \IfStrEq{\angle}{180.0} + { + \def\posname{left} + } + { + \IfStrEq{\angle}{90.0} + { + \def\posname{above} + } + { + \IfStrEq{\angle}{270.0} + { + \def\posname{below} + } + { + \pgfmathparse{\angle<180} + \IfStrEq{\pgfmathresult}{1.0} + { + \pgfmathparse{\angle<90} + \IfStrEq{\pgfmathresult}{1.0} + { + \def\posname{above right} + } + { + \def\posname{above left} + } + } + { + \pgfmathparse{\angle<270} + \IfStrEq{\pgfmathresult}{1.0} + { + \def\posname{below left} + } + { + \def\posname{below right} + } + } + } + } + } + } + \node[\posname,\cmdPAS@pyramreg@bordercolor] at (\Mx,\My) {$A_{\i}$}; + } + \fi + \foreach \i in {1,...,\cote} + { + \pgfmathparse{\cmdPAS@pyramreg@rayon*cos((360/\cotes)*\i+\cmdPAS@pyramreg@rotat)}\let\Mx\pgfmathresult + \pgfmathparse{\cmdPAS@pyramreg@incl*sin((360/\cotes)*\i+\cmdPAS@pyramreg@rotat)}\let\My\pgfmathresult + \pgfmathparse{\cmdPAS@pyramreg@rayon*cos((360/\cotes)*(\i-1)+\cmdPAS@pyramreg@rotat)}\let\Nx\pgfmathresult + \pgfmathparse{\cmdPAS@pyramreg@incl*sin((360/\cotes)*(\i-1)+\cmdPAS@pyramreg@rotat)}\let\Ny\pgfmathresult + \pgfmathparse{\cmdPAS@pyramreg@rayon*cos((360/\cotes)*(\i+1)+\cmdPAS@pyramreg@rotat)}\let\Px\pgfmathresult + \pgfmathparse{\cmdPAS@pyramreg@incl*sin((360/\cotes)*(\i+1)+\cmdPAS@pyramreg@rotat)}\let\Py\pgfmathresult + \IfStrEq{\cotes}{3}{\def\ang{120}}{\def\ang{140}} + \pgfmathparse{(360/\cotes)*\i<181} + \IfStrEq{\pgfmathresult}{1.0}{\draw[dotted,\cmdPAS@pyramreg@bordercolor] (\Nx,\Ny) -- (\Mx,\My);}{\draw[\cmdPAS@pyramreg@bordercolor] (\Nx,\Ny) -- (\Mx,\My);} + \pgfmathparse{(360/\cotes)*\i+\cmdPAS@pyramreg@rotat<\ang} + \IfStrEq{\pgfmathresult}{1.0}{\draw[dotted,\cmdPAS@pyramreg@bordercolor] (\Mx,\My) -- (0,\cmdPAS@pyramreg@hauteur);} + { + \shade[draw=\cmdPAS@pyramreg@bordercolor,shading=ball, ball color=\cmdPAS@pyramreg@incolor,opacity=\cmdPAS@pyramreg@coefopaq] (0,\cmdPAS@pyramreg@hauteur) -- (\Mx,\My) -- (\Px,\Py) -- cycle; + \draw[\cmdPAS@pyramreg@bordercolor] (0,\cmdPAS@pyramreg@hauteur) -- (\Mx,\My) -- (\Px,\Py); + } + } + \pgfmathparse{\cmdPAS@pyramreg@rayon*cos((360/\cotes)*\cote+\cmdPAS@pyramreg@rotat)}\let\Mx\pgfmathresult + \pgfmathparse{\cmdPAS@pyramreg@incl*sin((360/\cotes)*\cote+\cmdPAS@pyramreg@rotat)}\let\My\pgfmathresult + \pgfmathparse{\cmdPAS@pyramreg@rayon*cos(\cmdPAS@pyramreg@rotat)}\let\Nx\pgfmathresult + \pgfmathparse{+\cmdPAS@pyramreg@incl*sin(\cmdPAS@pyramreg@rotat)}\let\Ny\pgfmathresult + \draw[\cmdPAS@pyramreg@bordercolor] (\Mx,\My) -- (\Nx,\Ny) -- (0,\cmdPAS@pyramreg@hauteur); + \ifPAS@pyramreg@axe + \draw[dotted,\cmdPAS@pyramreg@axecolor] (0,\cmdPAS@pyramreg@hauteur) -- (0,-\cmdPAS@pyramreg@incl); + \draw[\cmdPAS@pyramreg@axecolor] (0,\cmdPAS@pyramreg@hauteur) -- (0,\cmdPAS@pyramreg@hauteur+1); + \draw[\cmdPAS@pyramreg@axecolor] (0,-\cmdPAS@pyramreg@incl) -- (0,-\cmdPAS@pyramreg@incl-1); + \ifPAS@pyramreg@legende + \draw[<-,>=stealth',\cmdPAS@pyramreg@axecolor] (0,\cmdPAS@pyramreg@hauteur+.5) to [bend left=20] (-\cmdPAS@pyramreg@rayon/2,\cmdPAS@pyramreg@hauteur) node[left,\cmdPAS@pyramreg@axecolor] {\texttt{axe de rotation}}; + \fi + \fi + \ifPAS@pyramreg@legende + \pgfmathparse{(\cmdPAS@pyramreg@hauteur-\Ny)/2}\let\y\pgfmathresult + \pgfmathparse{1-\cmdPAS@pyramreg@coefopaq}\let\op\pgfmathresult + \draw[<-,>=stealth,\cmdPAS@pyramreg@bordercolor] (\Nx/2,\y) to [bend left=30] (\cmdPAS@pyramreg@rayon+.5,\y+1) node[right,\cmdPAS@pyramreg@bordercolor] {\texttt{arête lat\'erale}}; + \draw[<-,>=stealth,\cmdPAS@pyramreg@bordercolor] (0,\cmdPAS@pyramreg@hauteur) to [bend left=10] (\cmdPAS@pyramreg@rayon+.5,\cmdPAS@pyramreg@hauteur+0.5) node[right,\cmdPAS@pyramreg@bordercolor] {\texttt{sommet}}; + \draw[gray,dotted] (0,\cmdPAS@pyramreg@hauteur) -- (\cmdPAS@pyramreg@rayon+4,\cmdPAS@pyramreg@hauteur); + \draw[gray,dotted] (\cmdPAS@pyramreg@rayon,0) -- (\cmdPAS@pyramreg@rayon+4,0); + \draw[gray,dotted,opacity=\op] (0,0) -- (\cmdPAS@pyramreg@rayon,0); + \draw[<->,>=stealth',\cmdPAS@pyramreg@bordercolor] (\cmdPAS@pyramreg@rayon+4,\cmdPAS@pyramreg@hauteur) -- (\cmdPAS@pyramreg@rayon+4,0) node[midway,right,\cmdPAS@pyramreg@bordercolor] {\texttt{hauteur}}; + \draw[<-,>=stealth,\cmdPAS@pyramreg@incolor] (\Nx/2,.5) to [bend right=30] (\cmdPAS@pyramreg@rayon+.5,-1) node[right,\cmdPAS@pyramreg@incolor] {\texttt{face lat\'erale (triangulaire)}}; + \fi +} + + +% \boule : dessine une boule +% Synthaxe : \boule[border, (booléen : si oui, un bord est dessiné +% bordercolor = ... (par défaut : noir), +% name, (booléen : si oui, le centre est dessiné), +% centre = nom du centre, +% poscentre = position du nom du centre, +% incolor = couleur de remplissage (par défaut : blanc), +% coefopaq = coefficient d'opacité, +% grandcercle (booléen : si oui, le grand cercle est dessiné), +% legende (booléen), +% scale = coefficient d'agrandissement] + +\define@boolkey[PAS] {boule} {border}[true]{} +\define@cmdkey [PAS] {boule} {bordercolor}{} +\define@boolkey[PAS] {boule} {name}[true]{} +\define@cmdkey [PAS] {boule} {centre}{} +\define@cmdkey [PAS] {boule} {poscentre}{} +\define@cmdkey [PAS] {boule} {incolor}{} +\define@cmdkey [PAS] {boule} {coefopaq}{} +\define@boolkey[PAS] {boule} {grandcercle}[true]{} +\define@boolkey[PAS] {boule} {legende}[true]{} +\define@cmdkey [PAS] {boule} {scale}{} + +\presetkeys [PAS] {boule} { border = false, + bordercolor = black, + incolor = white, + coefopaq = 0.5, + centre = O, + poscentre = below, + scale = 1, + grandcercle = false, + legende = false, + name = false}{} + +\newcommand*{\boule}[1][]{\pasBoule[#1]} + +\def\pasBoule[#1]{ + \setkeys[PAS]{boule}{#1} + \begin{scope}[scale=\cmdPAS@boule@scale] + \ifPAS@boule@grandcercle + \draw[\cmdPAS@boule@bordercolor,dotted] (2,0) arc (0:180:2cm and .5cm); + \fi + \ifPAS@boule@name + \fill[\cmdPAS@boule@bordercolor] (0,0) circle (0.01cm) node[\cmdPAS@boule@poscentre,scale=\cmdPAS@boule@scale] {\cmdPAS@boule@centre}; + \fi + \shade[shading=ball, ball color=\cmdPAS@boule@incolor,opacity=\cmdPAS@boule@coefopaq] (0,0) circle (2cm); + \ifPAS@boule@grandcercle + \draw[\cmdPAS@boule@bordercolor] (2,0) arc (0:-180:2cm and .5cm); + \fi + \ifPAS@boule@border + \draw[\cmdPAS@boule@bordercolor] (0,0) circle (2cm); + \fi + \ifPAS@boule@legende + \pgfmathparse{2*cos(-60)}\let\x\pgfmathresult + \pgfmathparse{.5*sin(-60)}\let\y\pgfmathresult + \draw[<-,>=stealth',\cmdPAS@boule@bordercolor] (\x,\y) to [bend right=30] (3,-0.4) node[right,\cmdPAS@boule@bordercolor] {\texttt{un grand cercle}}; + \begin{scope}[rotate=50] + \draw[\cmdPAS@boule@bordercolor!50!black,dotted] (2,0) arc (0:180:2cm and .5cm); + \draw[\cmdPAS@boule@bordercolor!50!black] (2,0) arc (0:-180:2cm and .5cm); + \end{scope} + \pgfmathparse{1.5*cos(38)}\let\x\pgfmathresult + \pgfmathparse{1.5*sin(38)}\let\y\pgfmathresult + \draw[<-,>=stealth',\cmdPAS@boule@bordercolor!50!black] (\x,\y) to [bend right=30] (3,\y) node[right,\cmdPAS@boule@bordercolor!50!black] {\texttt{un autre grand cercle}}; + + \fi + \end{scope} +} + +% \cone : dessine un cône de révolution +% Synthaxe : \cone[bordercolor=couleur des bords, (black par défaut) +% incolor = couleur de la face, (white par défaut) +% coefopaq = coefficient d'opacité (0.5 par défaut), +% rayon = rayon du disque de base, (1 cm par défaut), +% hauteur = hauteur du sommet (3 cm par défaut), +% sommet = nom du sommet, (par défaut : S) +% posommet = position du nom du sommet (par défaut : above), +% centre = nom du centre du disque de base, (par défaut : O), +% incl = coefficient d'inclinaison du disque de base, +% poscentre = position du centre du disque de base (par défaut : below), +% scalecentre = coefficient d'agrendissement du point du centre du disque de base, +% axe : booléen, +% axecolor = couleur de l'axe de révolution, +% legende : booléen, +% name : booléen] + +\define@cmdkey [PAS] {cone} {bordercolor}{} +\define@cmdkey [PAS] {cone} {incolor}{} +\define@cmdkey [PAS] {cone} {hauteur}{} +\define@cmdkey [PAS] {cone} {coefopaq}{} +\define@cmdkey [PAS] {cone} {rayon}{} +\define@cmdkey [PAS] {cone} {sommet}{} +\define@cmdkey [PAS] {cone} {posommet}{} +\define@cmdkey [PAS] {cone} {centre}{} +\define@cmdkey [PAS] {cone} {poscentre}{} +\define@cmdkey [PAS] {cone} {scalecentre}{} +\define@cmdkey [PAS] {cone} {incl}{} +\define@boolkey[PAS] {cone} {name}[true]{} +\define@boolkey[PAS] {cone} {axe}[true]{} +\define@boolkey[PAS] {cone} {legende}[true]{} +\define@cmdkey [PAS] {cone} {axecolor}{} +\presetkeys [PAS] {cone} {bordercolor = black, + incolor = white, + coefopaq = 0.5, + rayon = 1, + hauteur = 3, + sommet = S, + posommet = above, + centre = O, + poscentre = below, + scalecentre = 1, + incl = 0.33, + name = false, + axe = false, + legende = false, + axecolor = red}{} + +\newcommand*{\cone}[1][]{\pasCone[#1]} + +\def\pasCone[#1]{ + \setkeys[PAS]{cone}{#1} + \pgfmathparse{\cmdPAS@cone@incl*\cmdPAS@cone@rayon}\let\petitaxe\pgfmathresult + \pgfmathparse{2*\cmdPAS@cone@rayon}\let\grandaxe\pgfmathresult + \pgfmathparse{0.01*\cmdPAS@cone@scalecentre}\let\centre\pgfmathresult + \draw[dashed,\cmdPAS@cone@bordercolor] (0,0) arc (180:0:\cmdPAS@cone@rayon cm and \petitaxe cm); + \ifPAS@cone@axe + \draw[dotted,\cmdPAS@cone@axecolor] (\cmdPAS@cone@rayon,\cmdPAS@cone@hauteur) -- (\cmdPAS@cone@rayon,-\petitaxe); + \draw[\cmdPAS@cone@axecolor] (\cmdPAS@cone@rayon,\cmdPAS@cone@hauteur) -- (\cmdPAS@cone@rayon,\cmdPAS@cone@hauteur+1); + \draw[\cmdPAS@cone@axecolor] (\cmdPAS@cone@rayon,-\petitaxe) -- (\cmdPAS@cone@rayon,-\petitaxe-1); + \ifPAS@cone@legende + \draw[\cmdPAS@cone@axecolor,<-,>=stealth'] (\cmdPAS@cone@rayon,\cmdPAS@cone@hauteur+.5) to [bend left=30] (\cmdPAS@cone@rayon+1,\cmdPAS@cone@hauteur+1) node[right,\cmdPAS@cone@axecolor] {\texttt{axe de r\'evolution}}; + \fi + \fi + \shade[draw=\cmdPAS@cone@bordercolor,shading=ball, ball color=\cmdPAS@cone@incolor,opacity=\cmdPAS@cone@coefopaq] (0,0) -- (\cmdPAS@cone@rayon,\cmdPAS@cone@hauteur) -- (\grandaxe,0) arc (0:-180:\cmdPAS@cone@rayon cm and \petitaxe cm); + \ifPAS@cone@name + \node[\cmdPAS@cone@posommet,\cmdPAS@cone@bordercolor] at (\cmdPAS@cone@rayon,\cmdPAS@cone@hauteur) {\cmdPAS@cone@sommet}; + \node[\cmdPAS@cone@poscentre,\cmdPAS@cone@bordercolor] at (\cmdPAS@cone@rayon,0) {\cmdPAS@cone@centre}; + \fill[\cmdPAS@cone@bordercolor] (\cmdPAS@cone@rayon,0) circle (\centre cm); + \fi + \ifPAS@cone@legende + \pgfmathparse{\petitaxe*sin(-40)}\let\y\pgfmathresult + \pgfmathparse{\cmdPAS@cone@rayon*(1+cos(-40))}\let\x\pgfmathresult + \draw[\cmdPAS@cone@bordercolor,thick] (\cmdPAS@cone@rayon,\cmdPAS@cone@hauteur) -- (\x,\y); + \draw[<-,>=stealth',\cmdPAS@cone@bordercolor] (\x,\y) to [bend right=30] (2*\cmdPAS@cone@rayon+1,0) node[\cmdPAS@cone@bordercolor,right] {\texttt{g\'en\'eratrice}}; + \draw[black,<-,>=stealth'] (\cmdPAS@cone@rayon,\cmdPAS@cone@hauteur) to [bend right=45] (\cmdPAS@cone@rayon/2,\cmdPAS@cone@hauteur) node[black,below left] {\texttt{sommet}}; + \draw[black,<-,>=stealth'] (\cmdPAS@cone@rayon,0) to [bend right=30] (\cmdPAS@cone@rayon/2,-\petitaxe-.5) node[black,below] {\texttt{centre du disque de base}}; + \fi +} + + +% \cylindre : dessine un cône de révolution +% Synthaxe : \cylindre[bordercolor=couleur des bords, (black par défaut) +% incolor = couleur de la face, (white par défaut) +% coefopaq = coefficient d'opacité (0.5 par défaut), +% rayon = rayon du disque de base, (1 cm par défaut), +% hauteur = hauteur du sommet (3 cm par défaut), +% incl = coefficient d'inclinaison du disque de base, +% centrebas = nom du centre du disque de base, (par défaut : B), +% centrehaut = nom du centre du disque de base, (par défaut : H), +% poscentrebas = position du centre du disque de base (par défaut : below), +% poscentrehaut = position du centre du disque du haut (par défaut : below), +% scalecentre = coefficient d'agrendissement du point du centre du disque de base, +% axe : booléen, +% axecolor = couleur de l'axe de révolution, +% legende : booléen, +% name : booléen] + +\define@cmdkey [PAS] {cylindre} {bordercolor}{} +\define@cmdkey [PAS] {cylindre} {incolor}{} +\define@cmdkey [PAS] {cylindre} {hauteur}{} +\define@cmdkey [PAS] {cylindre} {coefopaq}{} +\define@cmdkey [PAS] {cylindre} {rayon}{} +\define@cmdkey [PAS] {cylindre} {centrebas}{} +\define@cmdkey [PAS] {cylindre} {poscentrebas}{} +\define@cmdkey [PAS] {cylindre} {centrehaut}{} +\define@cmdkey [PAS] {cylindre} {poscentrehaut}{} +\define@cmdkey [PAS] {cylindre} {scalecentre}{} +\define@cmdkey [PAS] {cylindre} {incl}{} +\define@boolkey[PAS] {cylindre} {name}[true]{} +\define@boolkey[PAS] {cylindre} {axe}[true]{} +\define@boolkey[PAS] {cylindre} {legende}[true]{} +\define@boolkey[PAS] {cylindre} {rectgener}[true]{} +\define@cmdkey [PAS] {cylindre} {axecolor}{} +\presetkeys [PAS] {cylindre} {bordercolor = black, + incolor = white, + coefopaq = 0.5, + rayon = 1, + hauteur = 3, + centrebas = B, + poscentrebas = above, + centrehaut = H, + poscentrehaut = below, + scalecentre = 1, + incl = 0.33, + name = false, + axe = false, + legende = false, + rectgener = false, + axecolor = red}{} + +\newcommand*{\cylindre}[1][]{\pasCylindre[#1]} + +\def\pasCylindre[#1]{ + \setkeys[PAS]{cylindre}{#1} + \pgfmathparse{\cmdPAS@cylindre@incl*\cmdPAS@cylindre@rayon}\let\petitaxe\pgfmathresult + \pgfmathparse{2*\cmdPAS@cylindre@rayon}\let\grandaxe\pgfmathresult + \pgfmathparse{0.01*\cmdPAS@cylindre@scalecentre}\let\centre\pgfmathresult + \ifPAS@cylindre@rectgener + \pgfmathparse{\petitaxe*sin(-40)}\let\y\pgfmathresult + \pgfmathparse{\cmdPAS@cylindre@rayon*(cos(-40))}\let\x\pgfmathresult + \filldraw[opacity=2*\cmdPAS@cylindre@coefopaq,fill=\cmdPAS@cylindre@incolor,draw=\cmdPAS@cylindre@bordercolor] (0,0) -- (\x,\y) -- (\x,\y+\cmdPAS@cylindre@hauteur) -- (0,\cmdPAS@cylindre@hauteur); + \ifPAS@cylindre@legende + \draw[\cmdPAS@cylindre@bordercolor,<-,>=stealth'] (.75*\x,.75*\y+.3) to [bend right=45] (1.3*\x,2*\y) node[right,\cmdPAS@cylindre@bordercolor] {\texttt{rectangle g\'en\'erateur}}; + \fi + \fi + \draw[dashed,\cmdPAS@cylindre@bordercolor] (\cmdPAS@cylindre@rayon,0) arc (0:180:\cmdPAS@cylindre@rayon cm and \petitaxe cm); + \ifPAS@cylindre@axe + \draw[dotted,\cmdPAS@cylindre@axecolor] (0,\cmdPAS@cylindre@hauteur) -- (0,-\petitaxe); + \draw[\cmdPAS@cylindre@axecolor] (0,\cmdPAS@cylindre@hauteur) -- (0,\cmdPAS@cylindre@hauteur+1); + \draw[\cmdPAS@cylindre@axecolor] (0,-\petitaxe) -- (0,-\petitaxe-1); + \ifPAS@cylindre@legende + \draw[\cmdPAS@cylindre@axecolor,<-,>=stealth'] (0,\cmdPAS@cylindre@hauteur+.5) to [bend left=30] (1,\cmdPAS@cylindre@hauteur+1) node[right,\cmdPAS@cylindre@axecolor] {\texttt{axe de r\'evolution}}; + \fi + \fi + \shade[draw=\cmdPAS@cylindre@bordercolor,shading=ball, ball color=\cmdPAS@cylindre@incolor,opacity=\cmdPAS@cylindre@coefopaq] (-\cmdPAS@cylindre@rayon,0) arc (180:360:\cmdPAS@cylindre@rayon cm and \petitaxe cm) -- (\cmdPAS@cylindre@rayon,\cmdPAS@cylindre@hauteur) arc (0:180:\cmdPAS@cylindre@rayon cm and \petitaxe cm) -- cycle; + \draw[draw=\cmdPAS@cylindre@bordercolor] (-\cmdPAS@cylindre@rayon,0) arc (180:360:\cmdPAS@cylindre@rayon cm and \petitaxe cm) -- (\cmdPAS@cylindre@rayon,\cmdPAS@cylindre@hauteur) arc (0:180:\cmdPAS@cylindre@rayon cm and \petitaxe cm) -- cycle; + \draw[draw=\cmdPAS@cylindre@bordercolor] (-\cmdPAS@cylindre@rayon,\cmdPAS@cylindre@hauteur) arc (180:360:\cmdPAS@cylindre@rayon cm and \petitaxe cm); + \ifPAS@cylindre@name + \node[\cmdPAS@cylindre@poscentrehaut,\cmdPAS@cylindre@bordercolor] at (0,\cmdPAS@cylindre@hauteur) {\cmdPAS@cylindre@centrehaut}; + \node[\cmdPAS@cylindre@poscentrebas,\cmdPAS@cylindre@bordercolor] at (0,0) {\cmdPAS@cylindre@centrebas}; + \fill[\cmdPAS@cylindre@bordercolor] (0,0) circle (\centre cm); + \fill[\cmdPAS@cylindre@bordercolor] (0,\cmdPAS@cylindre@hauteur) circle (\centre cm); + \fi + \ifPAS@cylindre@legende + \draw[dotted,\cmdPAS@cylindre@bordercolor] (\cmdPAS@cylindre@rayon,0) -- (\cmdPAS@cylindre@rayon+1,0); + \draw[dotted,\cmdPAS@cylindre@bordercolor] (\cmdPAS@cylindre@rayon,\cmdPAS@cylindre@hauteur) -- (\cmdPAS@cylindre@rayon+1,\cmdPAS@cylindre@hauteur); + \draw[<->,>=stealth',\cmdPAS@cylindre@bordercolor] (\cmdPAS@cylindre@rayon+1,0) -- (\cmdPAS@cylindre@rayon+1,\cmdPAS@cylindre@hauteur) node[midway,right,\cmdPAS@cylindre@bordercolor] {\texttt{hauteur}}; + \draw[black,<-,>=stealth',\cmdPAS@cylindre@bordercolor] (-0.5*\cmdPAS@cylindre@rayon,0.5*\cmdPAS@cylindre@hauteur) to [bend right=45] (-1.2*\cmdPAS@cylindre@rayon,0.5*\cmdPAS@cylindre@hauteur+.3) node[\cmdPAS@cylindre@bordercolor,left] {\texttt{face lat\'erale}}; + \fi +} + + +% \cube : dessine un cube +% Synthaxe : \cube[bordercolor=couleur voulue pour les bords, - par défaut : black (noir) +% incolor = couleur d'intérieur, - par défaut : white (blanc) +% angle = angle de la perspective, - par défaut : 45° +% coefopaq = coefficient d'opacité - par défaut : 0.5, +% name (booléen : si mentionné, noms des sommets apparents, +% prof = profondeur pour un parallélépipède rectangle, +% scale = agrandissement, +% legende : booléen pour mettre les légendes ou pas] + +\define@cmdkey [PAS] {cube} {bordercolor}{} +\define@cmdkey [PAS] {cube} {incolor}{} +\define@cmdkey [PAS] {cube} {angle}{} +\define@cmdkey [PAS] {cube} {coefopaq}{} +\define@cmdkey [PAS] {cube} {scale}{} +\define@cmdkey [PAS] {cube} {prof}{} +\define@boolkey[PAS] {cube} {name}[true]{} +\define@boolkey[PAS] {cube} {legende}[true]{} +\presetkeys [PAS] {cube} {angle = 45, + bordercolor = black, + incolor = white, + coefopaq = 0.5, + prof = 1, + scale = 1, + legende = false, + name = false}{} + +\newcommand*{\cube}[1][]{\pasCube[#1]} + +\def\pasCube[#1]{ + \setkeys[PAS]{cube}{#1} + \begin{scope}[scale=\cmdPAS@cube@scale] + \shade[draw=\cmdPAS@cube@bordercolor,shading=ball, ball color=\cmdPAS@cube@incolor,opacity=\cmdPAS@cube@coefopaq] (0,0) -- (1,0) -- (1,1) -- (0,1) -- cycle; + \pgfmathparse{\cmdPAS@cube@prof*cos(\cmdPAS@cube@angle)/2}\let\x\pgfmathresult + \pgfmathparse{\cmdPAS@cube@prof*sin(\cmdPAS@cube@angle)/2}\let\y\pgfmathresult + \pgfmathparse{1+\x}\let\xx\pgfmathresult + \pgfmathparse{1+\y}\let\yy\pgfmathresult + \draw[dotted,\cmdPAS@cube@bordercolor] (0,0) -- (\x,\y) -- (\xx,\y); + \draw[dotted,\cmdPAS@cube@bordercolor] (\x,\y) -- (\x,\yy); + \shade[draw=\cmdPAS@cube@bordercolor,shading=ball, ball color=\cmdPAS@cube@incolor,opacity=\cmdPAS@cube@coefopaq] (0,1) -- (\x,\yy) -- (\xx,\yy) -- (1,1) -- cycle; + \filldraw[draw=\cmdPAS@cube@bordercolor,shading=ball, ball color=\cmdPAS@cube@incolor,opacity=\cmdPAS@cube@coefopaq] (1,0) -- (1,1) -- (\xx,\yy) -- (\xx,\y) -- cycle; + \ifPAS@cube@name + \node[below left,\cmdPAS@cube@bordercolor] at (0,0) {A}; + \node[below right,\cmdPAS@cube@bordercolor] at (1,0) {B}; + \node[below right,\cmdPAS@cube@bordercolor] at (\xx,\y) {C}; + \node[below,\cmdPAS@cube@bordercolor] at (\x,\y) {D}; + \node[left,\cmdPAS@cube@bordercolor] at (0,1) {E}; + \node[below right,\cmdPAS@cube@bordercolor] at (1,1) {F}; + \node[right,\cmdPAS@cube@bordercolor] at (\xx,\yy) {G}; + \node[above,\cmdPAS@cube@bordercolor] at (\x,\yy) {H}; + \fi + \ifPAS@cube@legende + \pgfmathparse{(\xx-1)/2+1}\let\xxx\pgfmathresult + \pgfmathparse{(\yy-1)/2+1}\let\yyy\pgfmathresult + \draw[<-,>=stealth',\cmdPAS@cube@bordercolor] (.5,0) to [bend right=30] (2,0) node[right,\cmdPAS@cube@bordercolor] {\texttt{arête}}; + \IfStrEq{\cmdPAS@cube@incolor}{white}{\def\c{black}}{\def\c{\cmdPAS@cube@incolor}} + \draw[<-,>=stealth',\c] (\xxx,.5) to [bend left=30] ($(\xxx,.5)+(1,0.25)$) node[right,\c] {\texttt{face}}; + \fill[\cmdPAS@cube@bordercolor] (1,1) circle (0.01cm); + \draw[<-,>=stealth',\cmdPAS@cube@bordercolor] (1,1) to [bend left=45] ($(\xx,\yy)+(0.25,0.25)$) node[right,\cmdPAS@cube@bordercolor] {\texttt{sommet}}; + \fi + \end{scope} +} diff --git a/Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex b/Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex new file mode 100644 index 00000000000..30c7243f4ff --- /dev/null +++ b/Master/texmf-dist/doc/latex/pas-cours/macro-styles.tex @@ -0,0 +1,444 @@ +% Fichier comprenant les macros de styles + +% \env : environnement de couleurs +% Synthaxe : \env[style=nom de l'environnement,pluriel (option)]{texte} + +\define@cmdkey [PAS] {env} {style}{} +\define@cmdkey [PAS] {env} {name}{} +\define@cmdkey [PAS] {env} {color}{} +\define@cmdkey [PAS] {env} {title}{} +\define@cmdkey [PAS] {env} {symb}{} +\define@boolkey[PAS] {env} {toc}[true]{} +\define@boolkey[PAS] {env} {notoc}[true]{} +\define@boolkey[PAS] {env} {pluriel}[true]{} +\define@boolkey[PAS] {env} {endsymb}[true]{} +\define@boolkey[PAS] {env} {degrade}[true]{} +\define@boolkey[PAS] {env} {notitle}[true]{} +\define@boolkey[PAS] {env} {notitlebreak}[true]{} +\presetkeys [PAS] {env} {style= , name= , title= ,pluriel = false, color=, symb = $\blacksquare$, degrade = false, toc=false, notoc=false, notitle=false, notitlebreak=false, endsymb=false}{} + +\newcommand*{\env}[1][]{\pasEnv[#1]} + +\long\def\pasEnv[#1]#2{ + \setkeys[PAS]{env}{#1} + \if@everytoc + \ifx\cmdPAS@env@name\@empty + \else + \ifPAS@env@notoc + \else + \phantomsection + \addcontentsline{toc}{section}{\cmdPAS@env@name} + \fi + \fi + \else + \ifPAS@env@toc + \phantomsection + \addcontentsline{toc}{section}{\cmdPAS@env@name} + \fi + \fi + % + \IfStrEq{\cmdPAS@env@style}{prop} + {% + \ifPAS@env@pluriel + \def\texte{Propri\'et\'es} + \else + \def\texte{Propri\'et\'e} + \fi + \def\couleur{red}% + }{} + \IfStrEq{\cmdPAS@env@style}{demo} + {% + \ifPAS@env@pluriel + \def\texte{D\'emonstrations} + \else + \def\texte{D\'emonstration} + \fi + \def\couleur{black}% + }{} + \IfStrEq{\cmdPAS@env@style}{rem}{\ifPAS@env@pluriel\def\texte{Remarques}\else\def\texte{Remarque}\fi\def\couleur{rem}}{} + \IfStrEq{\cmdPAS@env@style}{defi} + {% + \ifPAS@env@pluriel + \def\texte{D\'efinitions} + \else + \def\texte{D\'efinition} + \fi + \def\couleur{defi} + }{} + \IfStrEq{\cmdPAS@env@style}{thm}{\ifPAS@env@pluriel\def\texte{Th\'eor\`emes}\else\def\texte{Th\'eor\`emes}\fi\def\couleur{thm}}{} + \IfStrEq{\cmdPAS@env@style}{ex}{\ifPAS@env@pluriel\def\texte{Exemples}\else\def\texte{Exemple}\fi\def\couleur{ex}}{} + \IfStrEq{\cmdPAS@env@style}{nota}{\ifPAS@env@pluriel\def\texte{Notations}\else\def\texte{Notation}\fi\def\couleur{nota}}{} + \IfStrEq{\cmdPAS@env@style}{act}{\ifPAS@env@pluriel\def\texte{Activit\'es}\else\def\texte{Activit\'e}\fi\def\couleur{orange}}{} + \IfStrEq{\cmdPAS@env@style}{meth}{\ifPAS@env@pluriel\def\texte{M\'ethodes}\else\def\texte{M\'ethode}\fi\def\couleur{brown}}{} + \IfStrEq{\cmdPAS@env@title}{}{}{\def\texte{\cmdPAS@env@title}} + \IfStrEq{\cmdPAS@env@color}{}{}{\def\couleur{\cmdPAS@env@color}} + \ifPAS@env@degrade + \tikzstyle{noeud} = [rectangle,inner sep=10pt,fill=\couleur!10,path fading=east] + \else + \tikzstyle{noeud} = [rectangle,inner sep=10pt,fill=\couleur!10] + \fi + \itemclass{\couleur} + \noindent + \begin{tikzpicture} + \node [noeud] (box) + {% + \begin{minipage}{\textwidth} + \itshape #2 + \ifPAS@env@endsymb + \hfill \cmdPAS@env@symb + \fi + \end{minipage} + }; + \ifPAS@env@notitle\else + \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$) + {\begin{ant}\textbf{\texte}\end{ant}}; + \fi + \draw[color=\couleur!50!black,very thick] (box.north west)--(box.south west)--(box.south east); + \node[left,color=\couleur] at (box.north east) {\emph{\cmdPAS@env@name}}; + \end{tikzpicture} + \vspace{0.5cm} +} + +% Environnement "pasbox" + +\newsavebox{\pas@box} +% +\newcounter{suite@box} +\newenvironment*{pasbox}[1][] +{% + \setcounter{suite@box}{0} + \setkeys[PAS]{env}{#1} + \if@everytoc + \ifx\cmdPAS@env@name\@empty\else + \ifPAS@env@notoc\else + \phantomsection + \addcontentsline{toc}{section}{\cmdPAS@env@name} + \fi + \fi + \else + \ifPAS@env@toc + \phantomsection + \addcontentsline{toc}{section}{\cmdPAS@env@name} + \fi + \fi + \IfStrEq{\cmdPAS@env@style}{thm} + {% + \ifPAS@env@pluriel + \def\texte{Th\'eor\`emes} + \else + \def\texte{Th\'eor\`eme} + \fi + \def\couleur{thm} + }{} + \IfStrEq{\cmdPAS@env@style}{demo} + {% + \ifPAS@env@pluriel + \def\texte{D\'emonstrations} + \else + \def\texte{D\'emonstration} + \fi + \def\couleur{black} + }{} + \IfStrEq{\cmdPAS@env@style}{prop} + {% + \ifPAS@env@pluriel + \def\texte{Propri\'et\'es} + \else + \def\texte{Propri\'et\'e} + \fi + \def\couleur{red} + }{} + \IfStrEq{\cmdPAS@env@style}{rem} + {% + \ifPAS@env@pluriel + \def\texte{Remarques} + \else + \def\texte{Remarque} + \fi + \def\couleur{rem} + }{} + \IfStrEq{\cmdPAS@env@style}{defi} + {% + \ifPAS@env@pluriel + \def\texte{D\'efinitions} + \else + \def\texte{D\'efinition} + \fi + \def\couleur{defi} + }{} + \IfStrEq{\cmdPAS@env@style}{ex} + {% + \ifPAS@env@pluriel + \def\texte{Exemples} + \else + \def\texte{Exemple} + \fi + \def\couleur{ex} + }{} + \IfStrEq{\cmdPAS@env@style}{nota} + {% + \ifPAS@env@pluriel + \def\texte{Notations} + \else + \def\texte{Notation} + \fi + \def\couleur{nota} + }{} + \IfStrEq{\cmdPAS@env@style}{act} + {% + \ifPAS@env@pluriel + \def\texte{Activit\'es} + \else + \def\texte{Activit\'e} + \fi + \def\couleur{orange} + }{} + \IfStrEq{\cmdPAS@env@style}{meth} + {% + \ifPAS@env@pluriel + \def\texte{M\'ethodes} + \else + \def\texte{M\'ethode} + \fi + \def\couleur{brown} + }{} + \IfStrEq{\cmdPAS@env@title}{}{}{\def\texte{\cmdPAS@env@title}} + \IfStrEq{\cmdPAS@env@color}{}{}{\def\couleur{\cmdPAS@env@color}} + \ifPAS@env@degrade + \tikzstyle{noeud} = [rectangle,inner sep=10pt,fill=\couleur!10,path fading=east] + \else + \tikzstyle{noeud} = [rectangle,inner sep=10pt,fill=\couleur!10] + \fi + \itemclass{\couleur} + \begin{lrbox}{\pas@box} + \begin{minipage}{0.93\linewidth} +} +{ + \ifPAS@env@endsymb + \hfill \cmdPAS@env@symb + \fi + \end{minipage} + \end{lrbox} + \begin{tikzpicture} + \node [noeud] (box) + {% + \usebox{\pas@box} + }; + \ifnum\thesuite@box=1 + \edef\texte{\texte~(suite)} + \ifPAS@env@notitlebreak\else\ifPAS@env@notitle\else + \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$) + {\begin{ant}\textbf{\texte}\end{ant}}; + \fi\fi + \else + \ifPAS@env@notitle\else + \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$) + {\begin{ant}\textbf{\texte}\end{ant}}; + \fi + \fi + \draw[color=\couleur!50!black,very thick] (box.north west)--(box.south west)--(box.south east); + \node[left,color=\couleur] at (box.north east) {\emph{\cmdPAS@env@name}}; + \end{tikzpicture} + \vspace{0.5cm} +} + +% \breakbox + +\newcommand*{\breakbox} +{% + \end{minipage} + \end{lrbox} + \stepcounter{suite@box} + \begin{tikzpicture} + \node [noeud] (box) + {% + \usebox{\pas@box} + }; + \ifPAS@env@notitle\else + \node[text=white,fill=\couleur,rectangle, shading=ball, ball color=\couleur, above right] (title) at ($(box.north west)+(-0.03,0)$) + {\begin{ant}\textbf{\texte}\end{ant}}; + \fi + \draw[color=\couleur!50!black,very thick] (box.north west)--(box.south west)--(box.south east); + \node[left,color=\couleur] at (box.north east) {\emph{\cmdPAS@env@name}}; + \node[rounded corners=3pt,draw=\couleur!50!black,very thick,left,fill=white] at ($(box.south east)+(-0.5,0)$) {...}; + \end{tikzpicture}\par + \begin{lrbox}{\pas@box} + \begin{minipage}{0.93\linewidth} +} + +%%%%%%%%%% définition du titre + +\define@cmdkey [PAS] {chap} {num}{} +\define@cmdkey [PAS] {chap} {color}{} +\define@cmdkey [PAS] {chap} {pos}{} +\define@boolkey[PAS] {chap} {noclearpage}[true]{} +\presetkeys [PAS] {chap} {num = , + color = red, + pos = right, + noclearpage = false}{} + +\newcommand*{\chap}[1][]{\pasChap[#1]} + +\def\pasChap[#1]#2#3{ + \setkeys[PAS]{chap}{#1} + \ifPAS@chap@noclearpage\else \clearpage \fi + \IfStrEq{\cmdPAS@chap@pos}{right} + { \tikzstyle{pastitrepos} = [text=\cmdPAS@chap@color,rectangle,left] + \tikzstyle{pastrait} = [right color=\cmdPAS@chap@color, left color=white,thick] + \tikzstyle{passstitre} = [\cmdPAS@chap@color,left,scale=0.5] + \edef\PASx{-\textwidth} + \def\PASpos{box.north west} + \def\PAStrait{box.west} + \def\PASsstitre{box.south west} + \def\PAStitrealign{flushright} + } + { \tikzstyle{pastitrepos} = [text=\cmdPAS@chap@color,rectangle,right] + \tikzstyle{pastrait} = [left color=\cmdPAS@chap@color, right color=white,thick] + \tikzstyle{passstitre} = [\cmdPAS@chap@color,right,scale=0.5] + \edef\PASx{\textwidth} + \def\PASpos{box.north east} + \def\PAStrait{box.east} + \def\PASsstitre{box.south east} + \def\PAStitrealign{flushleft} + } + \noindent + \begin{tikzpicture} + \node[fill=\cmdPAS@chap@color, shading=ball, ball color=\cmdPAS@chap@color, very thick,circle, inner xsep=5pt, inner ysep=2pt] (box) at (0,0) {\begin{Large}\textcolor{white}{\begin{ant} \textbf{\cmdPAS@chap@num} \end{ant}}\end{Large}}; + \node[pastitrepos] at (\PASpos) {\begin{minipage}{\textwidth}\begin{\PAStitrealign} \begin{Large}\textcolor{\cmdPAS@chap@color}{ \begin{ant} #2 \end{ant}}\end{Large} \end{\PAStitrealign} \end{minipage}}; + \shade[pastrait] (\PAStrait) rectangle +(\PASx,-0.01); + \node[passstitre] at (\PASsstitre) {\begin{ant}#3\end{ant}}; + \end{tikzpicture} +} + +%%%%%%%%%%%% Définition d'un mot + +\newcommand{\definmot}[1]{\texttt{\textbf{\textcolor{defi}{#1}}}} + +% Itemclass + +\newcommand{\itemclass}[1] % #1 = couleur +{ + \setlist[itemize,1]{label={\color{#1!50!black}\textbullet}} + \setlist[itemize,2]{label={\color{#1!50!black}$\rightarrow$}} + \setlist[enumerate,1] + {% + label=\fcolorbox{#1!50!black} + {#1!50!black} + {\color{#1!20}\normalsize\bfseries\arabic*} + } + \setlist[enumerate,2]{label=\textcolor{#1!50!black}{\normalsize\bfseries\alph*.}} +} +\itemclass{black}{} + +%%%%%%%%%%%% Pour le sommaire + +\renewcommand*\l@section{\color{blue!50!black}\def\@linkcolor{blue!50!black}\@dottedtocline{1}{1em}{2.3em}} +\def\contentsline#1#2#3#4{% + \ifx\\#4\\% + \csname l@#1\endcsname{#2}{#3}% + \else + \csname l@#1\endcsname{\hyper@linkstart{link}{#4}{#2}\hyper@linkend}{% + \hyper@linkstart{link}{#4}{#3}\hyper@linkend + }% + \fi +} +\renewcommand{\contentsname}{\color{purple}\titreFONT\huge Sommaire} + +%%%%%%%%%%% FONTES + +\def\titreFONT{\fontfamily{phv}\fontseries{bx}\selectfont} % pb6 +\def\tocFONT{\fontfamily{phv}\fontseries{m}\selectfont} + +%%%%%%%%%%% PREREQUIS + +\newsavebox{\prerequisBox} +\newenvironment{prerequis} +{% + \begin{lrbox}{\prerequisBox} + \begin{minipage}{0.9\linewidth} + \begin{itemize}[leftmargin=1em,label={\color{purple}$\bullet$}] + \tocFONT +} +{% + \end{itemize} + \end{minipage} + \end{lrbox} + \begin{tikzpicture} + \node (titre) {\includegraphics[scale=0.25]{prerequis.png}}; + \node[below right,text=purple] at (titre.north east) {\titreFONT\huge Pr\'erequis}; + \node[below right] (contenu) at (titre.south) {\usebox{\prerequisBox}}; + \draw[purple,very thick] (contenu.north west) -- (contenu.south west); + \end{tikzpicture} +} + +%%%%%%%%%%%%%%% A RETENIR +\newsavebox{\imageBox} +\newlength{\largeurimageBox} +\newsavebox{\aretenirBox} +\newenvironment{aretenir}[1][1] +{% +\def\sc{#1} +\begin{lrbox}{\imageBox} +\includegraphics[scale=\sc]{coeur.png} +\end{lrbox} +\settowidth{\largeurimageBox}{\usebox{\imageBox}}% +\begin{lrbox}{\aretenirBox} +\begin{minipage}{\dimexpr\linewidth-\largeurimageBox-1em} +} +{% +\end{minipage} +\end{lrbox} +\begin{tikzpicture} +\node[below right,rounded corners,very thick,draw=red!60!black] (box) {\usebox{\aretenirBox}}; +\node[below left] at ($(box.north west)+(0,0.8em)$) {\includegraphics[scale=\sc]{coeur.png}}; +\end{tikzpicture} +\vspace*{2em} +} + +%%%%%%%%%%%%%%%%%% ATTENTION + +\newsavebox{\attentionBox} + +\newenvironment{attention}[1][1] +{% +\def\sc{#1} +\begin{lrbox}{\imageBox} +\includegraphics[scale=\sc]{attention.png} +\end{lrbox} +\settowidth{\largeurimageBox}{\usebox{\imageBox}}% +\begin{lrbox}{\attentionBox} +\begin{minipage}{\dimexpr\linewidth-\largeurimageBox-1em} +} +{% +\end{minipage} +\end{lrbox} +\begin{tikzpicture} +\node[below right,rounded corners,very thick,draw=red!60!black] (box) {\usebox{\attentionBox}}; +\node[below left] at ($(box.north west)+(0,0.8em)$) {\includegraphics[scale=\sc]{attention.png}}; +\end{tikzpicture} +\vspace*{2em} +} + +%%%%%%%%%%%%%%%% BONUS + +\newcounter{bonus} +\newcommand*{\bonus}{\@ifstar{\bonus@star}{\bonus@nostar}} +\newcommand*\bonus@star[1]{% +\newpage +\begingroup +\fontfamily{phv}\fontseries{bx}\fontsize{16}{14}\selectfont +\color{blue!40!black}Complément \thebonus : #1 +\endgroup +\vspace*{1em} +} +\newcommand*\bonus@nostar[1]{% +\stepcounter{bonus} +\newpage +\phantomsection +\addcontentsline{toc}{section}{Complément \thebonus : #1} +\begingroup +\fontfamily{phv}\fontseries{bx}\fontsize{16}{14}\selectfont +\color{blue!40!black}Complément \thebonus : #1 +\endgroup +\vspace*{1em} +} diff --git a/Master/texmf-dist/doc/latex/pas-cours/prerequis.png b/Master/texmf-dist/doc/latex/pas-cours/prerequis.png Binary files differnew file mode 100644 index 00000000000..eb1927bf231 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pas-cours/prerequis.png |