Des courbes (multi-foliums, etc), dont les équations sont du site de Robert Ferréol...
[pst-anamorphosis.git] / img / serie02 / foliums.tex
1 \documentclass[12pt]{article}
2 \usepackage{pst-anamorphosis-add,pst-plot,pst-grad}
3 \usepackage[a4paper]{geometry}
4
5 \makeatletter
6 \def\psparametricplotA{\pst@object{parametricplotA}}% hv 2008-11-22
7 \def\parametricplotA{\pst@object{parametricplotA}}
8 \def\parametricplotA@i#1#2{\@ifnextchar[{\parametricplotA@x{#1}{#2}}{\parametricplotA@x{#1}{#2}[]}}
9 \def\parametricplotA@x#1#2[#3]{\@ifnextchar[{\parametricplotA@xi{#1}{#2}[#3]}{\parametricplotA@xi{#1}{#2}[#3][]}}
10 \def\parametricplotA@xi#1#2[#3][#4]#5{%
11 \pst@killglue%
12 \begingroup%
13 \use@par%
14 \@nameuse{beginplot@\psplotstyle}%
15 \addto@pscode{%
16 \tx@optionsanamorphosis
17 \tx@optionsanamorphosisAdd
18 #3 %prefix PS code
19 \psplot@init
20 /t #1 def
21 /t1 #2 def
22 /dt t1 t sub \psk@plotpoints div def
23 /F@pstplot \ifPst@algebraic (#5)
24 \ifx\psk@PlotDerivative\@none\else
25 \psk@PlotDerivative\space { (t) tx@Derive begin Derive end } repeat
26 \fi\space
27 tx@AlgToPs begin AlgToPs end cvx
28 \else { #5 } \fi def
29 \ifPst@VarStep
30 /StillZero 0 def /LastNonZeroStep dt def
31 /F2@pstplot tx@Derive begin (#5) (t) Derive (t) Derive end
32 \ifx\psk@PlotDerivative\@none\else
33 \psk@PlotDerivative\space { (t) tx@Derive begin Derive end } repeat
34 \fi\space
35 tx@AlgToPs begin AlgToPs end cvx def
36 %% computation of the tolerance defined by plotpoints
37 /epsilon12 \ifx\psk@VarStepEpsilon\@default
38 tx@Derive begin F2@pstplot end Pyth
39 dt 3 exp abs mul
40 \else\psk@VarStepEpsilon\space 12 mul \fi def
41 /ComputeStep {
42 dup 1e-4 lt
43 { pop StillZero 2 ge { LastNonZeroStep 2 mul } { LastNonZeroStep } ifelse /StillZero StillZero 1 add def }
44 { epsilon12 exch div 1 3 div exp /StillZero 0 def }
45 ifelse } bind def
46 \fi
47 /xy {
48 \ifPst@algebraic F@pstplot \else #5 \fi
49 \pst@number\psyunit mul exch
50 \pst@number\psxunit mul exch
51 tx@anamorphosisPathDict begin Anamorphose end
52 } def
53 }%
54 \gdef\psplot@init{}%
55 \@pstfalse
56 \@nameuse{testqp@\psplotstyle}%
57 \if@pst\parametricplotA@ii{#4}\else\parametricplotA@iii{#4}\fi
58 \endgroup%
59 \ignorespaces}
60 %
61 \def\parametricplotA@ii#1{% para is the post code
62 \ifPst@VarStep%
63 \addto@pscode{%
64 mark xy \@nameuse{beginqp@\psplotstyle}
65 { F2@pstplot Pyth ComputeStep
66 t 2 copy add dup t1 gt {pop t1} if /t exch def F2@pstplot Pyth ComputeStep
67 /t 3 -1 roll def 2 copy gt { exch } if pop
68 /t t 3 -1 roll add dup t1 gt {pop t1} if def
69 xy \@nameuse{doqp@\psplotstyle}
70 t t1 eq { exit } if } loop}%
71 \else\pst@killglue%
72 \addto@pscode{%
73 /ps@Exit false def
74 xy \@nameuse{beginqp@\psplotstyle}
75 \psk@plotpoints 1 sub {
76 /t t dt add def
77 xy \@nameuse{doqp@\psplotstyle}
78 ps@Exit { exit } if
79 } repeat
80 ps@Exit not {
81 /t t1 def
82 xy \@nameuse{doqp@\psplotstyle}
83 } if
84 }%
85 \fi%
86 \addto@pscode{ #1 }%
87 \@nameuse{endqp@\psplotstyle}}
88 %
89 \def\parametricplotA@iii#1{%
90 \ifPst@VarStep%
91 \addto@pscode{%
92 /n 2 def
93 mark
94 { xy n 2 roll F2@pstplot Pyth
95 ComputeStep t 2 copy add dup t1 gt {pop t1} if
96 /t exch def F2@pstplot Pyth ComputeStep
97 /t 3 -1 roll def 2 copy gt { exch } if pop
98 /t t 3 -1 roll dup /LastNonZeroStep exch def add dup t1 gt {pop t1} if def /n n 2 add def
99 t t1 eq { exit } if } loop
100 xy n 2 roll}%
101 \else\pst@killglue%
102 \addto@pscode{
103 mark
104 /n 2 def
105 \psk@plotpoints {
106 xy
107 n 2 roll
108 /n n 2 add def
109 /t t dt add def
110 } repeat
111 /t t1 def
112 xy
113 n 2 roll}%
114 \fi%
115 \addto@pscode{ #1 }%
116 \@nameuse{endplot@\psplotstyle}}
117 %
118 \makeatother
119 \begin{document}
120 \begin{center}
121 \begin{pspicture}(-6,-6)(6,6)
122 \pscircle[doubleline=true]{3}
123 \psset{type=conical}
124 \parametricplot[plotpoints=3600,linecolor=red,linewidth=0.5mm]{0}{360}{%
125 /Radius 0.75 t 4 mul cos mul def
126 Radius t cos mul 1 add
127 Radius t sin mul
128 }
129 \parametricplotA[plotpoints=3600,linecolor=red,linewidth=0.5mm]{0}{360}{%
130 /Radius 0.75 t 4 mul cos mul def
131 Radius t cos mul 1 add
132 Radius t sin mul
133 }
134 \parametricplot[plotpoints=3600,linecolor=blue,linewidth=0.5mm]{0}{360}{%
135 /Radius 1 t 5 mul cos mul def
136 Radius t cos mul -1.25 add
137 Radius t sin mul
138 }
139 \parametricplotA[plotpoints=3600,linecolor=blue,linewidth=0.5mm]{0}{360}{%
140 /Radius 1 t 5 mul cos mul def
141 Radius t cos mul -1.25 add
142 Radius t sin mul
143 }
144 \parametricplot[plotpoints=3600,fillstyle=solid,fillcolor=green!50]{0}{360}{%
145 /Radius 1 t 2 mul sin t 6 mul sin 4 div add mul def
146 Radius t cos mul
147 Radius t sin mul 1.5 add
148 }
149 \parametricplotA[plotpoints=3600,fillstyle=solid,fillcolor=green!50]{0}{360}{%
150 /Radius 1 t 2 mul sin t 6 mul sin 4 div add mul def
151 Radius t cos mul
152 Radius t sin mul 1.5 add
153 }
154 \parametricplot[plotpoints=3600,fillstyle=gradient,gradend=yellow,gradbegin=white]{0}{360}{%
155 /Radius 1 t cos 3 exp mul def
156 Radius t sin mul 0 add
157 Radius t cos mul 1 add neg
158 }
159 \parametricplotA[plotpoints=3600,fillstyle=gradient,gradbegin=yellow,gradend=white]{0}{360}{%
160 /Radius 1 t cos 3 exp mul def
161 Radius t sin mul 0 add
162 Radius t cos mul 1 add neg
163 }
164 {\psset{linewidth=0.5\pslinewidth,linecolor={[rgb]{1 0.75 0}}}
165 \multido{\n=0.25+0.25,\N=0.25+0.25}{9}{%
166 \pnode(! \n\space -2.25){A}
167 \pnode(! \n\space 2.25){B}
168 \psline(A)(B)
169 \pslineA(A)(B)
170 \pnode(!-2.25 \N){A}
171 \pnode(!2.25 \N){B}
172 \pslineA(A)(B)
173 \psline(A)(B)
174 }
175 \multido{\n=-2.25+0.25,\N=-2.25+0.25}{9}{%
176 \pnode(! \n\space -2.25){A}
177 \pnode(! \n\space 2.25){B}
178 \psline(A)(B)
179 \pslineA(A)(B)
180 \pnode(!-2.25 \N){A}
181 \pnode(!2.25 \N){B}
182 \pslineA(A)(B)
183 \psline(A)(B)
184 }
185 \psline(-2.25,0)(2.25,0)
186 \psline(0,-2.25)(0,2.25)
187 \pslineA(0,-2.25)(0,-0.25)
188 \pslineA(0,2.25)(0,0.25)
189 \pslineA(-2.25,0)(-0.25,0)
190 \pslineA(2.25,0)(0.25,0)}
191 \psdot[dotstyle=x,dotsize=.2](0,0)
192 \end{pspicture}
193 \end{center}
194 \end{document}

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.