]> www.hackdaworld.org Git - lectures/latex.git/blob - nlsop/graphs_ps.tex
begin test of random values
[lectures/latex.git] / nlsop / graphs_ps.tex
1 % `special' commands for version 1.53 of graphs.sty. Frank Drewes, 19.12.2000
2
3 \def\ps@s{ }
4 \def\ps@convertnum#1{
5         #1 \number\unitlength\ps@s mul 65536 div 72.27 div 72 mul
6 }
7
8 %-----------------------------------------------------------------------------%
9
10
11 \def\ps@rectangle[#1,#2]{% width, height
12 \special{"      \ps@convertnum{#1}
13                 \ps@convertnum{#2}
14                 [ \g@ncolour\ps@s\g@ncolourmod ]\ps@s
15                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
16                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
17                 \g@ldash\ps@s
18                 \iffillednodes true \else false\fi\ps@s
19                 psrectangle}}
20
21 %-----------------------------------------------------------------------------%
22
23 \def\ps@circle[#1]{% diameter
24 \special{"      \ps@convertnum{#1}
25                 [ \g@ncolour\ps@s\g@ncolourmod ]\ps@s
26                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
27                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
28                 \g@ldash\ps@s
29                 \iffillednodes true \else false\fi\ps@s
30                 pscircle}}
31
32 %-----------------------------------------------------------------------------%
33
34 \def\ps@line(#1,#2){% end x, end y
35 \special{"      \ps@convertnum{#1}
36                 \ps@convertnum{#2}
37                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
38                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
39                 \g@ldash\ps@s
40                 psline}}
41
42 %-----------------------------------------------------------------------------%
43
44 \def\ps@loopA(#1,#2)(#3,#4){% from (#1,#2) to (#3,#4)
45 \special{"      \ps@convertnum{#1}
46                 \ps@convertnum{#2}
47                 \ps@convertnum{#3}
48                 \ps@convertnum{#4}
49                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
50                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
51                 \g@ldash\ps@s
52                 psloop}}
53
54 %-----------------------------------------------------------------------------%
55
56 \def\ps@loopB#1(#2,#3){% angle #1, axis (#2,#3)
57 \special{"      #1
58                 \ps@convertnum{#2}
59                 \ps@convertnum{#3}
60                 psloopbyangle
61                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
62                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
63                 \g@ldash\ps@s
64                 psloop}}
65                 
66 %-----------------------------------------------------------------------------%
67
68 \def\ps@looparrowonrectangleA(#1,#2)(#3,#4)[#5,#6]{% 
69 \special{"      \ps@convertnum{#1}
70                 \ps@convertnum{#2}
71                 \ps@convertnum{#3}
72                 \ps@convertnum{#4}
73                 \ps@convertnum{#5}
74                 \ps@convertnum{#6}
75                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
76                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
77                 \g@ldash\ps@s
78                 \ps@convertnum{\g@alength}\g@alengthmod\ps@s
79                 \g@awidth\ps@s\g@awidthmod\ps@s
80                 \g@atype\ps@s
81                 pslooparrowonrectangle}}
82
83 %-----------------------------------------------------------------------------%
84
85 \def\ps@looparrowoncircleA(#1,#2)(#3,#4)[#5]{% 
86 \special{"      \ps@convertnum{#1}
87                 \ps@convertnum{#2}
88                 \ps@convertnum{#3}
89                 \ps@convertnum{#4}
90                 \ps@convertnum{#5}
91                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
92                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
93                 \g@ldash\ps@s
94                 \ps@convertnum{\g@alength}\g@alengthmod\ps@s
95                 \g@awidth\ps@s\g@awidthmod\ps@s
96                 \g@atype\ps@s
97                 pslooparrowoncircle}}
98
99 %-----------------------------------------------------------------------------%
100
101 \def\ps@looparrowonrectangleB#1(#2,#3)[#4,#5]{% 
102 \special{"      #1
103                 \ps@convertnum{#2}
104                 \ps@convertnum{#3}
105                 psloopbyangle
106                 \ps@convertnum{#4}
107                 \ps@convertnum{#5}
108                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
109                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
110                 \g@ldash\ps@s
111                 \ps@convertnum{\g@alength}\g@alengthmod\ps@s
112                 \g@awidth\ps@s\g@awidthmod\ps@s
113                 \g@atype\ps@s
114                 pslooparrowonrectangle}}
115
116 %-----------------------------------------------------------------------------%
117
118 \def\ps@looparrowoncircleB#1(#2,#3)[#4]{% 
119 \special{"      #1
120                 \ps@convertnum{#2}
121                 \ps@convertnum{#3}
122                 psloopbyangle
123                 \ps@convertnum{#4}
124                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
125                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
126                 \g@ldash\ps@s
127                 \ps@convertnum{\g@alength}\g@alengthmod\ps@s
128                 \g@awidth\ps@s\g@awidthmod\ps@s
129                 \g@atype\ps@s
130                 pslooparrowoncircle}}
131
132 %-----------------------------------------------------------------------------%
133
134 \def\ps@deletebox(#1,#2){% width, height in scaled points
135 \special{"      #1 65536 div
136                 #2 65536 div
137                 psdeletebox}}
138
139 %-----------------------------------------------------------------------------%
140
141 \def\ps@arrowonrectangle(#1,#2) [#3,#4]{% x, y, width, height
142 \special{"      \ps@convertnum{#1}
143                 \ps@convertnum{#2}
144                 \ps@convertnum{#3}
145                 \ps@convertnum{#4}
146                 \ps@convertnum{\g@alength}\g@alengthmod\ps@s
147                 \g@awidth\ps@s\g@awidthmod\ps@s
148                 \g@atype\ps@s
149                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
150                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
151                 \g@ldash\ps@s
152                 psarrowonrectangle}}
153
154 %-----------------------------------------------------------------------------%
155
156 \def\ps@arrowoncircle(#1,#2) [#3]{% x, y, diameter of circle
157 \special{"      \ps@convertnum{#1}
158                 \ps@convertnum{#2}
159                 \ps@convertnum{#3}
160                 \ps@convertnum{\g@alength}\g@alengthmod\ps@s
161                 \g@awidth\ps@s\g@awidthmod\ps@s
162                 \g@atype\ps@s
163                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
164                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
165                 \g@ldash\ps@s
166                 psarrowoncircle}}
167
168 %-----------------------------------------------------------------------------%
169
170 \def\ps@path(#1,#2)#3{% start coordinates, (xi,yi[,di]) ...
171         \def\extractvalues(##1)##2;{%
172           \ifx\endmarker##1\else%
173             \extractvalues##2;\extractvals(##1,0,)%
174           \fi}%
175         \def\extractvals(##1,##2,##3,##4){%
176           \ps@convertnum{##1}%
177           \ps@convertnum{##2}%
178           ##3%
179         }%
180         \special{" mark \extractvalues#3(\endmarker);
181                         \ps@convertnum{#1}
182                         \ps@convertnum{#2}
183                         \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
184                         [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
185                         \g@ldash\ps@s
186                         [ \g@fcolour\ps@s\g@fcolourmod ]\ps@s
187                         \iffilledareas true \else false\fi\ps@s pspath}}
188
189 %-----------------------------------------------------------------------------%
190
191 \def\ps@curve#1#2{% base length, (x1,y1,ang1[factor1]) ...
192         \def\extractvalues(##1(##2;##3{%
193           \ifx\endmarker##1\else%
194             \extractvalues(##2;{##3}\extractvals(##1[##3,##3];%
195           \fi}%
196         \def\extractvals(##1,##2,##3)[##4,##5]##6;{%
197           ##5\ps@s
198           ##4\ps@s
199           ##3\ps@s
200           \ps@convertnum{##2}%
201           \ps@convertnum{##1}%
202         }%
203         \special{" mark \extractvalues#2(\endmarker(;{#1}
204                         \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
205                         [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
206                         \g@ldash\ps@s
207                         [ \g@fcolour\ps@s\g@fcolourmod ]\ps@s
208                         \iffilledareas true \else false\fi\ps@s pscurve}}
209
210 %-----------------------------------------------------------------------------%
211
212 \def\ps@bubble#1#2{% length factor, (x1,y1) ...
213         \def\extractvalues(##1)##2;{%
214           \ifx\endmarker##1\else%
215             \extractvalues##2;\extractvals(##1)%
216           \fi}%
217         \def\extractvals(##1,##2){%
218           \ps@convertnum{##2}%
219           \ps@convertnum{##1}%
220         }%
221         \special{" mark \extractvalues#2(\endmarker);
222                         #1\ps@s
223                         \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
224                         [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
225                         \g@ldash\ps@s
226                         [ \g@fcolour\ps@s\g@fcolourmod ]\ps@s
227                         \iffilledareas true \else false\fi\ps@s psbubble}}
228
229 %-----------------------------------------------------------------------------%
230
231 \def\ps@dirbowoncircle(#1,#2)(#3,#4,#5)[#6]{% (x1,x2) (y1,y2,d), radius
232 \special{"      \ps@convertnum{#1}
233                 \ps@convertnum{#2}
234                 \ps@convertnum{#3}
235                 \ps@convertnum{#4}
236                 #5\ps@s
237                 \ps@convertnum{#6}
238                 \ps@convertnum{\g@alength}\g@alengthmod\ps@s
239                 \g@awidth\ps@s\g@awidthmod\ps@s
240                 \g@atype\ps@s
241                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
242                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
243                 \g@ldash\ps@s
244                 psdirbowoncircle}}
245
246 %-----------------------------------------------------------------------------%
247
248 \def\ps@dirbowonrectangle(#1,#2)(#3,#4,#5)[#6,#7]{% (x1,x2) (y1,y2,d),
249                                                   % xsize, ysize
250 \special{"      \ps@convertnum{#1}
251                 \ps@convertnum{#2}
252                 \ps@convertnum{#3}
253                 \ps@convertnum{#4}
254                 #5\ps@s
255                 \ps@convertnum{#6}
256                 \ps@convertnum{#7}
257                 \ps@convertnum{\g@alength}\g@alengthmod\ps@s
258                 \g@awidth\ps@s\g@awidthmod\ps@s
259                 \g@atype\ps@s
260                 \ps@convertnum{\g@lwidth}\g@lwidthmod\ps@s
261                 [ \g@lcolour\ps@s\g@lcolourmod ]\ps@s
262                 \g@ldash\ps@s
263                 psdirbowonrectangle}}
264
265 %-----------------------------------------------------------------------------%
266