Debian Codegraph @

texmf-dist/fonts/source/public/mdsymbol/mdarrows.mf

raw
1 %
2 % Copyright (c) 2011, 2012, Sebastian Schubert <[email protected]>
3 %
4 % This Font Software is licensed under the SIL Open Font License,
5 % Version 1.1. This license is in the accompanying file OFL.txt, and
6 % is also available with a FAQ at: http://scripts.sil.org/OFL
7 %
8
9 def ifneg(expr a,b) =
10 if negated: a else: b fi
11 enddef;
12
13 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
14 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "single arrow (" & decimal alpha & ")";
15 draw_line(foot_ex, head, false);
16 draw_arrowhead(head, alpha, arrow_spread, line_thickness);
17
18 if negated:
19 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
20 fi
21 endchar;
22 endfor;
23
24 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
25 beginarrow(alpha, 6/5, ifneg(19/10, 13/10) * arrow_spread#); "double arrow (" & decimal alpha & ")";
26 z1 - z0 = z3 - z2 = equal_spread * dir (alpha + 90);
27 1/2[z0,z1] = foot_ex;
28 1/2[z2,z3] = head;
29
30 draw_line(z0, arrowhead_intersection(head, alpha, 13/10arrow_spread, z0 -- z2), false);
31 draw_line(z1, arrowhead_intersection(head, alpha, 13/10arrow_spread, z1 -- z3), false);
32 draw_arrowhead(head, alpha, 13/10arrow_spread, line_thickness);
33
34 if negated:
35 stroke_through_arrow(1/2[foot, head - arrow_spread * dir alpha], alpha, 19/10arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
36 fi
37 endchar;
38 endfor;
39
40 for alpha = 0, 90, 45, 135:
41 beginarrow(alpha, 6/5, ifneg(3/2, 1) * arrow_spread#); "bidirectional arrow (" & decimal alpha & ")";
42 draw_line(foot, head, false);
43 draw_arrowhead(head, alpha, arrow_spread, line_thickness);
44 draw_arrowhead(foot, alpha+180, arrow_spread, line_thickness);
45
46 if negated:
47 stroke_through_arrow(1/2[foot, head], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
48 fi
49 endchar;
50 endfor;
51
52 for alpha = 0, 90, 45, 135:
53 beginarrow(alpha, 7/5, ifneg(19/10, 13/10) * arrow_spread#); "double bidirectional arrow (" & decimal alpha & ")";
54 z1 - z0 = z3 - z2 = equal_spread * dir (alpha + 90);
55 1/2[z0,z1] = foot;
56 1/2[z2,z3] = head;
57
58 draw_line(arrowhead_intersection(foot, alpha+180, 13/10arrow_spread, z0 -- z2), arrowhead_intersection(head, alpha, 13/10arrow_spread, z0 -- z2), false);
59 draw_line(arrowhead_intersection(foot, alpha+180, 13/10arrow_spread, z1 -- z3), arrowhead_intersection(head, alpha, 13/10arrow_spread, z1 -- z3), false);
60 draw_arrowhead(head, alpha, 13/10arrow_spread, line_thickness);
61 draw_arrowhead(foot, alpha+180, 13/10arrow_spread, line_thickness);
62
63 if negated:
64 stroke_through_arrow(1/2[foot, head], alpha, 19/10arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
65 fi
66 endchar;
67 endfor;
68
69 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
70 beginarrow(alpha, 5/4, ifneg(3/2, 1) * arrow_spread#); "double-head arrow (" & decimal alpha & ")";
71 draw_line(foot_ex, head, false);
72 draw_arrowhead(head, alpha, arrow_spread, line_thickness);
73 draw_arrowhead(head - 1/4arrow_len * dir alpha, alpha, arrow_spread, line_thickness);
74
75 if negated:
76 stroke_through_arrow(1/2[foot, head - (1/2arrow_spread + 1/4arrow_len) * dir alpha], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
77 fi
78 endchar;
79 endfor;
80
81 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
82 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "tailed arrow (" & decimal alpha & ")";
83 z0 = foot + 1/2arrow_spread * dir alpha;
84
85 draw_line(z0, head, false);
86 draw_arrowhead(head, alpha, arrow_spread, line_thickness);
87 draw_arrowhead(z0, alpha, arrow_spread, line_thickness);
88
89 if negated:
90 stroke_through_arrow(1/2[foot, head], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
91 fi
92 endchar;
93 endfor;
94
95 for alpha = 0, 90, 180, 270:
96 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "arrow with foot (" & decimal alpha & ")";
97 draw_line(foot, head, false);
98 draw_line(foot - 1/2arrow_spread * dir (alpha + 90), foot + 1/2arrow_spread * dir (alpha + 90), true);
99 draw_arrowhead(head, alpha, arrow_spread, line_thickness);
100
101 if negated:
102 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
103 fi
104 endchar;
105 endfor;
106
107 for alpha = 0, 90, 180, 270:
108 beginarrow(alpha, 6/5, ifneg(19/10, 13/10) * arrow_spread#); "double arrow with foot (" & decimal alpha & ")";
109 z1 - z0 = z3 - z2 = equal_spread * dir (alpha + 90);
110 1/2[z0,z1] = foot_ex;
111 1/2[z2,z3] = head;
112
113 draw_line(z0, arrowhead_intersection(head, alpha, 13/10arrow_spread, z0 -- z2), false);
114 draw_line(z1, arrowhead_intersection(head, alpha, 13/10arrow_spread, z1 -- z3), false);
115 draw_line(foot - 13/20arrow_spread * dir (alpha + 90), foot + 13/20arrow_spread * dir (alpha + 90), true);
116 draw_arrowhead(head, alpha, 13/10arrow_spread, line_thickness);
117
118 if negated:
119 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 19/10arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
120 fi
121 endchar;
122 endfor;
123
124 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
125 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "left embedding (" & decimal alpha & ")";
126 thick := line_thickness;
127
128 z0 = foot + 1/4arrow_spread * dir(alpha + 90);
129 1/2[z1,z2] = z0 + 1/4arrow_spread * dir alpha;
130 z2 = z1 + 1/2arrow_spread * dir (alpha + 90);
131 z3 = head;
132 z4 = z2 + 1/2thick * dir alpha;
133
134 penpos0(thick, alpha);
135 penpos1(thick, alpha + 90);
136 penpos2(thick, alpha - 90);
137 penpos3(thick, alpha + 90);
138 penpos4(thick, alpha - 90);
139
140 draw_arrowhead(head, alpha, arrow_spread, thick);
141 fill stroke z4.e -- z2.e{dir (alpha + 180)} ..
142 z0.e{dir (alpha - 90)} .. z1.e{dir alpha} -- z3.e;
143
144 if negated:
145 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
146 fi
147 endchar;
148 endfor;
149
150 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
151 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "right embedding (" & decimal alpha & ")";
152 thick := line_thickness;
153
154 z0 = foot - 1/4arrow_spread * dir(alpha + 90);
155 1/2[z1,z2] = z0 + 1/4arrow_spread * dir alpha;
156 z2 = z1 - 1/2arrow_spread * dir (alpha + 90);
157 z3 = head;
158 z4 = z2 + 1/2thick * dir alpha;
159
160 penpos0(thick, alpha + 180);
161 penpos1(thick, alpha + 90);
162 penpos2(thick, alpha - 90);
163 penpos3(thick, alpha + 90);
164 penpos4(thick, alpha - 90);
165
166 draw_arrowhead(head, alpha, arrow_spread, thick);
167 fill stroke z4.e -- z2.e{dir (alpha + 180)} ..
168 z0.e{dir (alpha + 90)} .. z1.e{dir alpha} -- z3.e;
169
170 if negated:
171 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
172 fi
173 endchar;
174 endfor;
175
176 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
177 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "left harpoon (" & decimal alpha & ")";
178 draw_line(foot_ex, head, false);
179 draw_arrowhead_left(head, alpha, arrow_spread, line_thickness);
180
181 if negated:
182 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
183 fi
184 endchar;
185 endfor;
186
187 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
188 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "right harpoon (" & decimal alpha & ")";
189 draw_line(foot_ex, head, false);
190 draw_arrowhead_right(head, alpha, arrow_spread, line_thickness);
191
192 if negated:
193 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
194 fi
195 endchar;
196 endfor;
197
198 for alpha = 0, 90, 45, 135:
199 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "left left harpoon (" & decimal alpha & ")";
200 draw_line(foot, head, false);
201 draw_arrowhead_left(head, alpha, arrow_spread, line_thickness);
202 draw_arrowhead_left(foot, alpha+180, arrow_spread, line_thickness);
203
204 if negated:
205 stroke_through_arrow(1/2[foot, head], alpha, 3/2arrow_spread)(80, 80, 110, 110);
206 fi
207 endchar;
208 endfor;
209
210 for alpha = 0, 90, 45, 135:
211 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "right right harpoon (" & decimal alpha & ")";
212 draw_line(foot, head, false);
213 draw_arrowhead_right(head, alpha, arrow_spread, line_thickness);
214 draw_arrowhead_right(foot, alpha+180, arrow_spread, line_thickness);
215
216 if negated:
217 stroke_through_arrow(1/2[foot, head], alpha, 3/2arrow_spread)(70, 70, 100, 100);
218 fi
219 endchar;
220 endfor;
221
222 for alpha = 0, 90, 45, 135:
223 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread# + equal_spread#); "double left left harpoon (" & decimal alpha & ")";
224 z1 - z0 = z1' - z0' = z3 - z2 = z3' - z2' = equal_spread * dir (alpha + 90);
225 1/2[z0,z1] = foot;
226 1/2[z0',z1'] = foot_ex;
227 1/2[z2,z3] = head;
228 1/2[z2',z3'] = head_ex;
229
230 draw_line(z2', z0, false);
231 draw_line(z1', z3, false);
232 draw_arrowhead_left(z3, alpha, arrow_spread, line_thickness);
233 draw_arrowhead_left(z0, alpha+180, arrow_spread, line_thickness);
234
235 if negated:
236 stroke_through_arrow(1/2[foot, head], alpha, 3/2arrow_spread + equal_spread)(80, 80, 110, 110);
237 fi
238 endchar;
239 endfor;
240
241 for alpha = 0, 90, 45, 135:
242 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread# + equal_spread#); "double right right harpoon (" & decimal alpha & ")";
243 z1 - z0 = z1' - z0' = z3 - z2 = z3' - z2' = equal_spread * dir (alpha + 90);
244 1/2[z0,z1] = foot;
245 1/2[z0',z1'] = foot_ex;
246 1/2[z2,z3] = head;
247 1/2[z2',z3'] = head_ex;
248
249 draw_line(z0', z2, false);
250 draw_line(z3', z1, false);
251 draw_arrowhead_right(z2, alpha, arrow_spread, line_thickness);
252 draw_arrowhead_right(z1, alpha+180, arrow_spread, line_thickness);
253
254 if negated:
255 stroke_through_arrow(1/2[foot, head], alpha, 3/2arrow_spread + equal_spread)(70, 70, 100, 100);
256 fi
257 endchar;
258 endfor;
259
260 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
261 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "broken arrow (" & decimal alpha & ")";
262 z0 = ifneg( 4/20, 6/20)[foot,head];
263 z1 = ifneg(13/20,11/20)[foot,head];
264
265 draw_line(foot_ex, z0, false);
266 draw_line(z1, head, false);
267 draw_arrowhead(head, alpha, arrow_spread, line_thickness);
268
269 if negated:
270 stroke_through_arrow(1/2[z0, z1], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
271 fi
272 endchar;
273 endfor;
274
275 for alpha = 0, 90, 180, 270:
276 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "multi map (" & decimal alpha & ")";
277 draw_line(foot_ex, head - (4/5arrow_spread + 1/4line_thickness) * dir alpha, false);
278 draw_circle(head - 2/5arrow_spread * dir alpha, 2/5arrow_spread, line_thickness);
279
280 if negated:
281 stroke_through_arrow(1/2[foot, head - 4/5arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
282 fi
283 endchar;
284 endfor;
285
286 for alpha = 0, 90, 180, 270:
287 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#); "filled multi map (" & decimal alpha & ")";
288 draw_line(foot_ex, head_ex - 2/5arrow_spread * dir alpha, false);
289 filldraw_circle(head - 2/5arrow_spread * dir alpha, 2/5arrow_spread, line_thickness);
290
291 if negated:
292 stroke_through_arrow(1/2[foot, head - 4/5arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
293 fi
294 endchar;
295 endfor;
296
297 beginarrow(0, 7/5, ifneg(3/2, 1) * arrow_spread#); "double multi map";
298 draw_line(foot + (4/5arrow_spread + 1/4line_thickness) * right, head - (4/5arrow_spread + 1/4line_thickness) * right, false);
299 draw_circle(head - 2/5arrow_spread * right, 2/5arrow_spread, line_thickness);
300 draw_circle(foot + 2/5arrow_spread * right, 2/5arrow_spread, line_thickness);
301
302 if negated:
303 stroke_through_arrow(1/2[foot, head], 0, 3/2arrow_spread)(70);
304 fi
305 endchar;
306
307 beginarrow(0, 7/5, ifneg(3/2, 1) * arrow_spread#); "filled double multi map";
308 draw_line(foot_ex + 2/5arrow_spread * right, head - 2/5arrow_spread * right, false);
309 filldraw_circle(head - 2/5arrow_spread * right, 2/5arrow_spread, line_thickness);
310 filldraw_circle(foot + 2/5arrow_spread * right, 2/5arrow_spread, line_thickness);
311
312 if negated:
313 stroke_through_arrow(1/2[foot, head], 0, 3/2arrow_spread)(70);
314 fi
315 endchar;
316
317 for alpha = 0, 180:
318 beginarrow(alpha, 7/5, ifneg(3/2, 1) * arrow_spread#); "image of (" & decimal alpha & ")";
319 draw_line(foot_ex + 2/5arrow_spread * dir alpha, head - (4/5arrow_spread + 1/4line_thickness) * dir alpha, false);
320 filldraw_circle(foot + 2/5arrow_spread * dir alpha, 2/5arrow_spread, line_thickness);
321 draw_circle(head - 2/5arrow_spread * dir alpha, 2/5arrow_spread, line_thickness);
322
323 if negated:
324 stroke_through_arrow(1/2[foot, head], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
325 fi
326 endchar;
327 endfor;
328
329 for alpha = 0, 90, 180, 270:
330 beginarrow(alpha, 1, 3/4plus_size# + ifneg(1,0) * arrow_spread#); "pitchfork (" & decimal alpha & ")";
331 draw_line(foot_ex, head_ex, false);
332 draw_subset(a, foot + 1/2arrow_len * dir alpha, foot_ex, 3/4plus_size, line_thickness);
333
334 if negated:
335 stroke_through_arrow(1/4[foot, head], alpha, 3/4plus_size + arrow_spread)(80, 80, 100, 100, 80, 80, 100, 100);
336 fi
337 endchar;
338 endfor;
339
340 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
341 beginarrow(alpha, 1, 2arrow_spread#+line_thickness#); "parallel arrows (" & decimal alpha & ")";
342 z1 - z0 = z3 - z2 = (arrow_spread+line_thickness) * dir (alpha + 90);
343 1/2[z0,z1] = foot_ex;
344 1/2[z2,z3] = head;
345
346 draw_line(z0, z2, false);
347 draw_line(z1, z3, false);
348 draw_arrowhead(z2, alpha, arrow_spread, line_thickness);
349 draw_arrowhead(z3, alpha, arrow_spread, line_thickness);
350
351 if negated:
352 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
353 fi
354 endchar;
355 endfor;
356
357 for alpha = 0, 90, 45, 135:
358 beginarrow(alpha, 1, 2arrow_spread#); "anti-parallel arrows right left (" & decimal alpha & ")";
359 z1 - z0 = z1' - z0' = z3 - z2 = z3' - z2' = arrow_spread * dir (alpha + 90);
360 1/2[z0,z1] = foot;
361 1/2[z0',z1'] = foot_ex;
362 1/2[z2,z3] = head;
363 1/2[z2',z3'] = head_ex;
364
365 draw_line(z2', z0, false);
366 draw_line(z1', z3, false);
367 draw_arrowhead(z3, alpha, arrow_spread, line_thickness);
368 draw_arrowhead(z0, alpha+180, arrow_spread, line_thickness);
369
370 if negated:
371 stroke_through_arrow(1/2[foot, head], alpha, 2arrow_spread)(80, 80, 110, 110);
372 fi
373 endchar;
374 endfor;
375
376 for alpha = 0, 90, 45, 135:
377 beginarrow(alpha, 1, 2arrow_spread#); "anti-parallel arrows left right (" & decimal alpha & ")";
378 z1 - z0 = z1' - z0' = z3 - z2 = z3' - z2' = arrow_spread * dir (alpha + 90);
379 1/2[z0,z1] = foot;
380 1/2[z0',z1'] = foot_ex;
381 1/2[z2,z3] = head;
382 1/2[z2',z3'] = head_ex;
383
384 draw_line(z0', z2, false);
385 draw_line(z3', z1, false);
386 draw_arrowhead(z2, alpha, arrow_spread, line_thickness);
387 draw_arrowhead(z1, alpha+180, arrow_spread, line_thickness);
388
389 if negated:
390 stroke_through_arrow(1/2[foot, head], alpha, 2arrow_spread)(70, 70, 100, 100);
391 fi
392 endchar;
393 endfor;
394
395 for sign = 1, -1:
396 for alpha = 0, 90, 180, 270:
397 beginarrow(alpha, 1, ifneg(3/2, 1) * arrow_spread#);
398 if sign > 0: "left right" else: "right left" fi & " wave arrow (" & decimal alpha & ")";
399 thick := line_thickness;
400
401 z0 = foot - sign * 1/8arrow_spread * dir (alpha + 90);
402 z1 = 4/18[foot,head] + sign * 1/4arrow_spread * dir (alpha + 90);
403 z2 = 7/18[foot,head];
404 z3 = 10/18[foot,head] - sign * 1/4arrow_spread * dir (alpha + 90);
405 z4 = 12/18[foot,head] - sign * 1/8arrow_spread * dir (alpha + 90);
406 z5 = 14/18[foot,head];
407 z6 = head;
408
409 penpos0(thick, alpha - 90 + sign * 55);
410 penpos1(thick, alpha - 90);
411 penpos2(thick, alpha - 90 - sign * 55);
412 penpos3(thick, alpha - 90);
413 penpos4(thick, alpha - 90 + sign * 35);
414 penpos5(thick, alpha - 90);
415 penpos6(thick, alpha - 90);
416
417 penlabels(0,1,2,3,4,5,6);
418
419 fill stroke z0.e{dir (alpha + sign * 55)} .. z1.e{dir alpha} .. z2.e{dir (alpha - sign * 55)} .. z3.e{dir alpha} .. z4.e{dir (alpha + sign * 35)} ... {dir alpha}z5.e -- z6.e;
420 draw_arrowhead(z6, alpha, arrow_spread, thick);
421
422 if negated:
423 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 70, 70, 70, 70, 70, 70);
424 fi
425 endchar;
426 endfor;
427 endfor;
428
429 for sign = 1, -1:
430 for alpha = 0, 90:
431 beginarrow(alpha, 6/5, ifneg(3/2, 1) * arrow_spread#);
432 if sign > 0: "left right" else: "right left" fi & " bidirectional wave arrow (" & decimal alpha & ")";
433 thick := line_thickness;
434
435 z0 = foot;
436 z1 = 4/22[foot,head];
437 z2 = 6/22[foot,head] + sign * 1/8arrow_spread * dir (alpha + 90);
438 z3 = 8/22[foot,head] + sign * 1/4arrow_spread * dir (alpha + 90);
439 z4 = 11/22[foot,head];
440 z5 = 14/22[foot,head] - sign * 1/4arrow_spread * dir (alpha + 90);
441 z6 = 16/22[foot,head] - sign * 1/8arrow_spread * dir (alpha + 90);
442 z7 = 18/22[foot,head];
443 z8 = head;
444
445 penpos0(thick, alpha - 90);
446 penpos1(thick, alpha - 90);
447 penpos2(thick, alpha - 90 + sign * 35);
448 penpos3(thick, alpha - 90);
449 penpos4(thick, alpha - 90 - sign * 55);
450 penpos5(thick, alpha - 90);
451 penpos6(thick, alpha - 90 + sign * 35);
452 penpos7(thick, alpha - 90);
453 penpos8(thick, alpha - 90);
454
455 penlabels(0,1,2,3,4,5,6,7,8);
456
457 fill stroke z0e. -- z1.e{dir alpha} .. z2.e{dir (alpha + sign * 35)} .. z3.e{dir alpha} .. z4.e{dir (alpha - sign * 55)} .. z5.e{dir alpha} ... z6.e{dir (alpha + sign * 35)} .. {dir alpha}z7.e -- z8.e;
458 draw_arrowhead(z0, alpha + 180, arrow_spread, thick);
459 draw_arrowhead(z8, alpha, arrow_spread, thick);
460
461 if negated:
462 stroke_through_arrow(1/2[foot, head], alpha, 3/2arrow_spread)(70, 70, 70, 70);
463 fi
464 endchar;
465 endfor;
466 endfor;
467
468 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
469 beginarrow(alpha, 1, ifneg(3/2,1) * arrow_spread#); "right bend arrow (" & decimal alpha & ")";
470 thick := line_thickness;
471
472 z0 = foot - 1/4arrow_spread * dir (alpha + 90);
473 z1 = 9/20[foot,head] + 1/4arrow_spread * dir (alpha + 90);
474 z2 = 19/20[foot,head] - 1/2arrow_spread * dir (alpha + 90);
475
476 penpos0(thick, alpha - 35);
477 penpos1(thick, alpha - 90);
478 penpos2(thick, alpha - 150);
479
480 fill stroke z0.e{dir (alpha + 55)} .. z1.e .. {dir (alpha - 60)}z2.e;
481 draw_arrowhead(z2, alpha - 50, arrow_spread, thick);
482
483 if negated:
484 stroke_through_arrow(1/10[z1,z2] + 1/8arrow_spread * dir (alpha - 90), alpha, 3/2arrow_spread)(80, 80, 80, 80, 80, 80, 80, 80);
485 fi
486 endchar;
487 endfor;
488
489 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
490 beginarrow(alpha, 1, ifneg(3/2,1) * arrow_spread#); "left bend arrow (" & decimal alpha & ")";
491 thick := line_thickness;
492
493 z0 = foot + 1/4arrow_spread * dir (alpha + 90);
494 z1 = 9/20[foot,head] - 1/4arrow_spread * dir (alpha + 90);
495 z2 = 19/20[foot,head] + 1/2arrow_spread * dir (alpha + 90);
496
497 penpos0(thick, alpha + 35);
498 penpos1(thick, alpha + 90);
499 penpos2(thick, alpha + 150);
500
501 fill stroke z0.e{dir (alpha - 55)} .. z1.e .. {dir (alpha + 60)}z2.e;
502 draw_arrowhead(z2, alpha + 50, arrow_spread, thick);
503
504 if negated:
505 stroke_through_arrow(1/10[z1,z2] + 1/8arrow_spread * dir (alpha + 90), alpha, 3/2arrow_spread)(110, 110, 110, 110, 110, 110, 110, 110);
506 fi
507 endchar;
508 endfor;
509
510 for alpha = 0, 90, 180, 270, 45, 135, 225, 315:
511 beginarrow(alpha, 6/5, ifneg(3/2,1) * arrow_spread#); "bidirectional bend arrow (" & decimal alpha & ")";
512 thick := line_thickness;
513
514 z0 = 1/20[foot,head] - 1/2arrow_spread * dir (alpha + 90);
515 z1 = 1/2[foot,head] + 1/4arrow_spread * dir (alpha + 90);
516 z2 = 19/20[foot,head] - 1/2arrow_spread * dir (alpha + 90);
517
518 penpos0(thick, alpha - 30);
519 penpos1(thick, alpha - 90);
520 penpos2(thick, alpha - 150);
521
522 fill stroke z0.e{dir (alpha + 60)} .. z1.e .. {dir (alpha - 60)}z2.e;
523 draw_arrowhead(z0, alpha + 230, arrow_spread, thick);
524 draw_arrowhead(z2, alpha - 50, arrow_spread, thick);
525
526 if negated:
527 stroke_through_arrow(z1 + 1/8arrow_spread * dir (alpha - 90), alpha, 3/2arrow_spread)(80, 80, 100, 100, 80, 80, 100, 100);
528 fi
529 endchar;
530 endfor;
531
532 for alpha = 0, 180:
533 beginarrow(alpha, 1, ifneg(3/2,1) * arrow_spread#); "headless arrow with foot (" & decimal alpha & ")";
534 draw_line(foot_ex, head_ex, false);
535 draw_line(foot - 1/2arrow_spread * dir (alpha + 90), foot + 1/2arrow_spread * dir (alpha + 90), true);
536
537 if negated:
538 stroke_through_arrow(1/2[foot, head], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
539 fi
540 endchar;
541 endfor;
542
543 for sign = 1, -1:
544 for alpha = 0, 90, 180, 270:
545 beginoperator(large_op_size#, 1);
546 if sign > 0: "right" else: "left" fi & " circle arrow (" & decimal alpha & ")";
547
548 thick := line_thickness;
549 r := (w - 2side_bearing)/2 - arrow_spread/3;
550
551 for i = 0 upto 7:
552 z[i] = centre + r * dir (alpha + i/8 * 360);
553 penpos[i](thick, alpha + i/8 * 360);
554 endfor;
555
556 z0' = centre + r * dir (alpha + 10);
557 penpos0'(thick, alpha + 10);
558 z0'' = centre + r * dir (alpha - 10);
559 penpos0''(thick, alpha - 10);
560
561 penlabels(0',0'',1,2,3,4,5,6,7);
562
563 fill stroke z0'.e{dir (alpha + 100)} .. z1.e .. z2.e .. z3.e .. z4.e .. z5.e .. z6.e .. z7.e .. {dir (alpha + 80)}z0''.e;
564
565 if sign > 0:
566 draw_arrowhead(z0'', (alpha + 65), arrow_spread, thick);
567 else:
568 draw_arrowhead(z0', (alpha - 65), arrow_spread, thick);
569 fi;
570
571 if negated:
572 1/2[z8,z9] = centre;
573 if (alpha = 90) or (alpha = 270):
574 y8 - y9 = large_op_size * sind 45;
575 z8 - z9 = whatever * dir 40;
576 else:
577 y8 - y9 = large_op_size;
578 z8 - z9 = whatever * dir 80;
579 fi
580
581 draw_straight(z8, z9, stroke_through_thickness, false);
582 fi
583 endchar;
584 endfor;
585 endfor;
586
587 for alpha = 0, 90, 180, 270:
588 beginarrow(alpha, 6/5, ifneg(21/10, 14/10) * arrow_spread#+line_thickness#/2); "triple arrow (" & decimal alpha & ")";
589 z1 - z0 = z2 - z1 = 2/3equal_spread * dir (alpha + 90);
590 z1 = foot_ex;
591 z4 - z3 = z5 - z4 = 2/3equal_spread * dir (alpha + 90);
592 z4 = head_ex;
593
594 draw_straight(z0, arrowhead_intersection(head, alpha, 3/2arrow_spread, z0 -- z3), 4/5line_thickness, false);
595 draw_straight(z1, arrowhead_intersection(head, alpha, 3/2arrow_spread, z1 -- z4), 4/5line_thickness, false);
596 draw_straight(z2, arrowhead_intersection(head, alpha, 3/2arrow_spread, z2 -- z5), 4/5line_thickness, false);
597 draw_arrowhead(head, alpha, 3/2arrow_spread, line_thickness);
598
599 if negated:
600 stroke_through_arrow(1/2[foot, head - arrow_spread * dir alpha], alpha, 21/10arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
601 fi
602 endchar;
603 endfor;
604
605 for alpha = 0, 180:
606 beginarrow(alpha, 2, ifneg(3/2, 1) * arrow_spread#); "long single arrow (" & decimal alpha & ")";
607 draw_line(foot_ex, head, false);
608 draw_arrowhead(head, alpha, arrow_spread, line_thickness);
609
610 if negated:
611 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
612 fi
613 endchar;
614 endfor;
615
616 for alpha = 0, 180:
617 beginarrow(alpha, 2, ifneg(19/10, 13/10) * arrow_spread#); "long double arrow (" & decimal alpha & ")";
618 z1 - z0 = z3 - z2 = equal_spread * dir (alpha + 90);
619 1/2[z0,z1] = foot_ex;
620 1/2[z2,z3] = head;
621
622 draw_line(z0, arrowhead_intersection(head, alpha, 13/10arrow_spread, z0 -- z2), false);
623 draw_line(z1, arrowhead_intersection(head, alpha, 13/10arrow_spread, z1 -- z3), false);
624 draw_arrowhead(head, alpha, 13/10arrow_spread, line_thickness);
625
626 if negated:
627 stroke_through_arrow(1/2[foot, head - arrow_spread * dir alpha], alpha, 19/10arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
628 fi
629 endchar;
630 endfor;
631
632 for alpha = 0:
633 beginarrow(alpha, 2, ifneg(3/2, 1) * arrow_spread#); "long bidirectional arrow (" & decimal alpha & ")";
634 draw_line(foot, head, false);
635 draw_arrowhead(head, alpha, arrow_spread, line_thickness);
636 draw_arrowhead(foot, alpha+180, arrow_spread, line_thickness);
637
638 if negated:
639 stroke_through_arrow(1/2[foot, head], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
640 fi
641 endchar;
642 endfor;
643
644 for alpha = 0:
645 beginarrow(alpha, 2, ifneg(19/10, 13/10) * arrow_spread#); "long double bidirectional arrow (" & decimal alpha & ")";
646 z1 - z0 = z3 - z2 = equal_spread * dir (alpha + 90);
647 1/2[z0,z1] = foot;
648 1/2[z2,z3] = head;
649
650 draw_line(arrowhead_intersection(foot, alpha+180, 13/10arrow_spread, z0 -- z2), arrowhead_intersection(head, alpha, 13/10arrow_spread, z0 -- z2), false);
651 draw_line(arrowhead_intersection(foot, alpha+180, 13/10arrow_spread, z1 -- z3), arrowhead_intersection(head, alpha, 13/10arrow_spread, z1 -- z3), false);
652 draw_arrowhead(head, alpha, 13/10arrow_spread, line_thickness);
653 draw_arrowhead(foot, alpha+180, 13/10arrow_spread, line_thickness);
654
655 if negated:
656 stroke_through_arrow(1/2[foot, head], alpha, 19/10arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
657 fi
658 endchar;
659 endfor;
660
661 for alpha = 0, 180:
662 beginarrow(alpha, 2, ifneg(3/2, 1) * arrow_spread#); "long arrow with foot (" & decimal alpha & ")";
663 draw_line(foot, head, false);
664 draw_line(foot - 1/2arrow_spread * dir (alpha + 90), foot + 1/2arrow_spread * dir (alpha + 90), true);
665 draw_arrowhead(head, alpha, arrow_spread, line_thickness);
666
667 if negated:
668 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
669 fi
670 endchar;
671 endfor;
672
673 for alpha = 0, 180:
674 beginarrow(alpha, 2, ifneg(19/10, 13/10) * arrow_spread#); "long double arrow with foot (" & decimal alpha & ")";
675 z1 - z0 = z3 - z2 = equal_spread * dir (alpha + 90);
676 1/2[z0,z1] = foot_ex;
677 1/2[z2,z3] = head;
678
679 draw_line(z0, arrowhead_intersection(head, alpha, 13/10arrow_spread, z0 -- z2), false);
680 draw_line(z1, arrowhead_intersection(head, alpha, 13/10arrow_spread, z1 -- z3), false);
681 draw_line(foot - 13/20arrow_spread * dir (alpha + 90), foot + 13/20arrow_spread * dir (alpha + 90), true);
682 draw_arrowhead(head, alpha, 13/10arrow_spread, line_thickness);
683
684 if negated:
685 stroke_through_arrow(1/2[foot, head - arrow_spread * dir alpha], alpha, 19/10arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
686 fi
687 endchar;
688 endfor;
689
690 for alpha = 0, 180:
691 beginarrow(alpha, 2, ifneg(3/2, 1) * arrow_spread#); "long wave arrow (" & decimal alpha & ")";
692 thick := line_thickness;
693 sign := if alpha > 0: 1 else: -1 fi;
694
695 z0 = foot - 1/8arrow_spread * up;
696 z1 = 4/43[foot,head] + 1/4arrow_spread * up;
697 z2 = 7/43[foot,head];
698 z3 = 10/43[foot,head] - 1/4arrow_spread * up;
699 z4 = 13/43[foot,head];
700 z5 = 16/43[foot,head] + 1/4arrow_spread * up;
701 z6 = 19/43[foot,head];
702 z7 = 22/43[foot,head] - 1/4arrow_spread * up;
703 z8 = 25/43[foot,head];
704 z9 = 28/43[foot,head] + 1/4arrow_spread * up;
705 z10 = 31/43[foot,head];
706 z11 = 34/43[foot,head] - 1/4arrow_spread * up;
707 z12 = 36/43[foot,head] - 1/8arrow_spread * up;
708 z13 = 38/43[foot,head];
709 z14 = head;
710
711 penpos0(thick, sign * 35);
712 penpos1(thick, sign * 90);
713 penpos2(thick, sign * 145);
714 penpos3(thick, sign * 90);
715 penpos4(thick, sign * 35);
716 penpos5(thick, sign * 90);
717 penpos6(thick, sign * 145);
718 penpos7(thick, sign * 90);
719 penpos8(thick, sign * 35);
720 penpos9(thick, sign * 90);
721 penpos10(thick, sign * 145);
722 penpos11(thick, sign * 90);
723 penpos12(thick, sign * 45);
724 penpos13(thick, sign * 90);
725 penpos14(thick, sign * 90);
726
727 penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14);
728
729 fill stroke z0e{dir (sign * 35 + 90)} .. z1.e{dir (sign * 90 + 90)} .. z2.e{dir (sign * 145 + 90)} .. z3.e{dir (sign * 90 + 90)} .. z4.e{dir (sign * 35 + 90)} .. z5.e{dir (sign * 90 + 90)} .. z6.e{dir (sign * 145 + 90)} .. z7.e{dir (sign * 90 + 90)} .. z8.e{dir (sign * 35 + 90)} .. z9.e{dir (sign * 90 + 90)} .. z10.e{dir (sign * 145 + 90)} .. z11.e{dir (sign * 90 + 90)} .. z12.e{dir (sign * 45 + 90)} .. {dir (sign * 90 + 90)}z13.e -- z14.e;
730 draw_arrowhead(z14, alpha, arrow_spread, thick);
731
732 if negated:
733 stroke_through_arrow(1/2[foot, head - 1/2arrow_spread * dir alpha], alpha, 3/2arrow_spread)(70, 70, 70, 70, 70, 70, 70, 70);
734 fi
735 endchar;
736 endfor;
737
738 for alpha = 0, 180:
739 beginarrow(alpha, 2, ifneg(3/2,1) * arrow_spread#); "long headless arrow with foot (" & decimal alpha & ")";
740 draw_line(foot_ex, head_ex, false);
741 draw_line(foot - 1/2arrow_spread * dir (alpha + 90), foot + 1/2arrow_spread * dir (alpha + 90), true);
742
743 if negated:
744 stroke_through_arrow(1/2[foot, head], alpha, 3/2arrow_spread)(70, 70, 110, 110, 70, 70, 110, 110);
745 fi
746 endchar;
747 endfor;
748
749 if not negated:
750 for sign = 1, -1:
751 beginsymbol(4/3arrow_spread# + line_thickness# + 2side_bearing#, vcentre(2arrow_spread# + line_thickness#)); "left shift";
752 y0 = y1 = h - 1/2arrow_spread - 1/2line_thickness;
753 y2 = -d + 1/2line_thickness;
754 1/2[x0,x1] = w/2;
755 x1 - x0 = sign * 4/3arrow_spread;
756 x2 = x1;
757
758 draw_line(z2, z1, true);
759 draw_line(z1, z0, false);
760 draw_arrowhead(z0, 90 + sign * 90, arrow_spread, line_thickness);
761 endchar;
762 endfor;
763
764 for sign = 1, -1:
765 beginsymbol(4/3arrow_spread# + line_thickness# + 2side_bearing#, vcentre(2arrow_spread# + line_thickness#)); "left down shift";
766 y0 = y1 = -d + 1/2arrow_spread + 1/2line_thickness;
767 y2 = h - 1/2line_thickness;
768 1/2[x0,x1] = w/2;
769 x1 - x0 = sign * 4/3arrow_spread;
770 x2 = x1;
771
772 draw_line(z2, z1, true);
773 draw_line(z1, z0, false);
774 draw_arrowhead(z0, 90 + sign * 90, arrow_spread, line_thickness);
775 endchar;
776 endfor;
777
778 for sign = -1, 1:
779 beginsymbol(arrow_diag_len# + 2side_bearing#, vcentre(arrow_diag_len#)); "loop arrow";
780 thick := line_thickness;
781 arrow_len := arrow_diag_len;
782 pair centre;
783 centre := (w/2, (h-d)/2);
784
785 z0 = centre + sign * (arrow_len - line_thickness)/2 * left;
786 z1 = centre + arrow_len/2 * down;
787 z2 = centre + (arrow_len - line_thickness)/4 * up;
788 z3 = centre + sign * (arrow_len - line_thickness)/4 * right;
789 z4 = centre + (arrow_len - line_thickness) * (1/4sign, 1/2);
790 z5 = centre + (arrow_len - line_thickness) * (1/2sign, 1/4);
791
792 penpos0(thick, - sign * 90);
793 penpos1(thick, 180);
794 penpos2(thick, 180);
795 penpos3(thick, - sign * 90);
796 penpos4(thick, sign * 90);
797 penpos5(thick, 0);
798
799 fill stroke z0e -- z3e{sign * right} .. {up}z5e .. {sign * left}z4e .. {down}z2e -- z1e;
800 draw_arrowhead(z0, 90 + sign * 90, arrow_spread, thick);
801
802 penlabels(0,1,2,3,4,5);
803 endchar;
804 endfor;
805 fi