summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/dvips/pst-moire/pst-moire.pro
blob: 59fd37da5e62a16f9e0d922a1fbf26d110768428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                   %%
%% This is file `pst-moire.pro'                                      %%
%%                                                                   %%
%% IMPORTANT NOTICE:                                                 %%
%%                                                                   %%
%% Package `pst-moire'                                               %%
%%                                                                   %%
%% Jürgen Gilg, Manuel Luque, Jean-Michel Sarlat                     %%
%%                                                                   %%
%% Copyright (C) 2018                                                %%
%%                                                                   %%
%% This program can redistributed and/or modified under              %%
%% the terms of the LaTeX Project Public License                     %%
%% Distributed from CTAN archives in directory                       %%
%% macros/latex/base/lppl.txt; either version 1.3c of                %%
%% the License, or (at your option) any later version.               %%
%%                                                                   %%
%% DESCRIPTION:                                                      %%
%%   `pst-moire' is a PSTricks package to draw moire patterns        %%
%%                                                                   %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/moireDict 100 dict def
moireDict begin
/pst-Fresnel {
gsave
0 0 translate
1 2 R R mul {%
    /n_1 exch def
    /n n_1 1 add def
    /R_1 n_1 sqrt def
    /R n sqrt def
    /width R R_1 sub unit def
    /radius R R_1 add 2 div unit def
    width setlinewidth
    linecolor % \pst@usecolor\pslinecolor
    circle
    stroke
    } for
grestore
} def
%
/pst-radial {
/secteur {
gsave
    newpath
    0 0 moveto
    0 0 Runit 0 1 arc
    closepath
    linecolor
    fill
grestore
    }
def
gsave
newpath
Runit 0 moveto
0 0 Runit 0 360 arc
Runit 10 div 0 moveto
0 0 Runit 10 div 360 0 arcn
closepath
clip
1 1 120 { % les angles
    secteur
    3 rotate
    } for
grestore
} def
%
/pst-linear {
Runit neg 0 translate
/trait {
    newpath
    0 Runit neg moveto
    0 Runit lineto
    linecolor
    linewidth
    stroke
    }
def
gsave
0 1 NombreTraits 1 add{% 50 traits espacés de 2 mm
    trait
    mm 2 mul 0 translate
    } for
grestore
} def
%
/pst-square {
/Square {
    newpath
    Side neg Side neg moveto
    Side Side neg lineto
    Side Side lineto
    Side neg Side lineto
    closepath
    linecolor
    linewidth
    stroke
    }def
gsave
0 1 NombreTraits 2 div {% 50 carrés espacés de 2 mm
    /Side exch mm 2 mul mul def
    Square
    } for
grestore
} def
%
/pst-Newton {
/SquareNewton {
    newpath
    Side neg Side neg moveto
    Side Side neg lineto
    Side Side lineto
    Side neg Side lineto
    closepath
    linecolor
    width setlinewidth % Width mm
    stroke
    }
def
gsave
1 2 R R mul {%
    /n_1 exch def
    /n n_1 1 add def
    /R_1 n_1 sqrt def
    /R n sqrt def
    /width R R_1 sub unit def
    /Side R R_1 add 2 div unit def
     SquareNewton
    } for
grestore
}def
%
/pst-circle {
/Circle {
    newpath
    0 0 Radius 0 360 arc
    closepath
    linecolor
    linewidth
    stroke
    }def
    gsave
0 1 NombreTraits 2 div {% 50 carrés espacés de 2 mm
    /Radius exch mm 2 mul mul def
    Circle
    } for
grestore
} def
%
/pst-Bouasse{
/grille {
0 1 51 { % 51 traits
    /trait exch def
    /xS 2 trait mul 0.01 trait dup mul mul add % en mm
        mm mul
        64 mm mul sub % en pts
    def
gsave
newpath
    xS 183 neg moveto
    xS 183 lineto
    linewidth
    linecolor
    stroke
    } for
} def % dessin de la grille
reduc reduc scale
    grille
grestore
} def
%
/pst-Gauss1{% definition obsolete
10 dict begin
/a 0.5 def
/yStart -10 def
/yStop 10 def 
/TRAME {
-15 0.5 15 { % le nombre de traits
    /k exch def
    /p 2.71828 0.5 k a mul dup mul mul neg exp m k a mul mul sub def
    /xStart 10 neg p sub m div def
    /xStop 10 p sub m div def
    linecolor
    linewidth
    newpath
    xStart unit yStart unit moveto
    xStop unit yStop unit lineto
    stroke
} for
} def
/CIRCLE {0 0 Runit 0 360 arc } def
gsave
CIRCLE clip
    90 Alpha sub rotate
    TRAME
grestore
end
} def
%
/pst-Gauss {
0 0 translate
10 dict begin
/A1 3 def
/K1 0.5 def
%/E1 0.25 def
/TRAME {
-40 E1 2 mul 40 {/n exch def
gsave
    n E1 mul unit % x
    A1 unit 2.71828 K1 n E1 mul mul dup mul neg exp mul % y
    translate
    linecolor
    linewidth
     -6 unit -6 m mul unit moveto
      6 unit 6 m mul unit lineto
     stroke
grestore
     } for
} def
Runit neg Runit neg moveto
Runit neg Runit lineto
Runit Runit lineto
Runit Runit neg lineto
Runit neg Runit neg lineto
clip
    TRAME
end
} def
%
/pst-dot {
/DOT {DotSize DotStyle Dot} def
/pas {DotSize DS 4 mul} bind def
R unit neg pas R unit { /xPos exch def
R unit neg pas R unit { /yPos exch def
xPos yPos DOT
    } for
} for
} def
%
/pst-chess {
/DOT {DotSize DotStyle Dot} def
/pas {DotSize DS 4 mul} bind def
R unit neg pas R unit { /xPos exch def
R unit neg pas R unit { /yPos exch def
xPos yPos DOT
    } for
} for
%
R unit neg pas 2 div add pas R unit pas 2 div sub { /xPos exch def
R unit neg pas 2 div add pas R unit pas 2 div sub{ /yPos exch def
xPos yPos DOT
    } for
} for
} def
%
end
% END pst-moire.pro