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