Debian Codegraph @

texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.meta.code.tex

raw
1 % Copyright 2018 by Till Tantau
2 %
3 % This file may be distributed and/or modified
4 %
5 % 1. under the LaTeX Project Public License and/or
6 % 2. under the GNU Public License.
7 %
8 % See the file doc/generic/pgf/licenses/LICENSE for more details.
9
10 \ProvidesFileRCS{pgflibraryarrows.meta.code.tex}
11
12
13
14 %
15 %
16 % Meta keys
17 %
18 %
19
20
21 \newdimen\pgfarrowinset
22 \newdimen\pgfarrowlength
23 \newdimen\pgfarrowwidth
24 \newdimen\pgfarrowlinewidth
25 \newif\ifpgfarrowroundcap
26 \newif\ifpgfarrowroundjoin
27
28 \pgfarrowsaddtolengthscalelist\pgfarrowlength
29 \pgfarrowsaddtolengthscalelist\pgfarrowinset
30 \pgfarrowsaddtowidthscalelist\pgfarrowwidth
31
32
33 \pgfkeys{
34 /pgf/arrow keys/.cd,
35 length/.code={%
36 \pgfarrowsthreeparameters{#1}%
37 \expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\pgfarrowslinewidthdependent\pgfarrowstheparameters\pgfarrowlength\pgf@x}%
38 },
39 inset/.code={%
40 \pgfarrowsthreeparameters{#1}%
41 \expandafter\pgfarrowsaddtolateoptions\expandafter{\expandafter\pgfarrowslinewidthdependent\pgfarrowstheparameters\pgfarrowinset\pgf@x}%
42 },
43 inset'/.code={
44 \pgfarrowsthreeparameters{#1}%
45 \expandafter\pgfarrowsaddtolateoptions\expandafter{\expandafter\pgfarrowslengthdependent\pgfarrowstheparameters\pgfarrowinset}%
46 },
47 line width/.code={%
48 \pgfarrowsthreeparameters{#1}%
49 \expandafter\pgfarrowsaddtolateoptions\expandafter{\expandafter\pgfarrowslinewidthdependent\pgfarrowstheparameters\pgfarrowlinewidth\pgf@x}%
50 },
51 line width'/.code={
52 \pgfarrowsthreeparameters{#1}%
53 \expandafter\pgfarrowsaddtolateoptions\expandafter{\expandafter\pgfarrowslengthdependent\pgfarrowstheparameters\pgfarrowlinewidth}%
54 },
55 width/.code={%
56 \pgfarrowsthreeparameters{#1}%
57 \expandafter\pgfarrowsaddtolateoptions\expandafter{\expandafter\pgfarrowslinewidthdependent\pgfarrowstheparameters\pgfarrowwidth\pgf@x}%
58 },
59 width'/.code={%
60 \pgfarrowsthreeparameters{#1}%
61 \expandafter\pgfarrowsaddtolateoptions\expandafter{\expandafter\pgfarrowslengthdependent\pgfarrowstheparameters\pgfarrowwidth}%
62 },
63 angle/.code={%
64 \pgfarrowsfourparameters{#1}%
65 \expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\pgfarrows@angle@setup\pgfarrowstheparameters}%
66 },
67 angle'/.code={
68 \pgfarrowsaddtolateoptions{\pgfarrows@angle@setup@prime{#1}}%
69 },
70 %
71 line cap/.is choice,
72 line cap/butt/.code=\pgfarrowsaddtooptions{\pgfarrowroundcapfalse},
73 line cap/round/.code=\pgfarrowsaddtooptions{\pgfarrowroundcaptrue},
74 line join/.is choice,
75 line join/miter/.code=\pgfarrowsaddtooptions{\pgfarrowroundjoinfalse},
76 line join/round/.code=\pgfarrowsaddtooptions{\pgfarrowroundjointrue},
77 round/.style={line cap=round,line join=round},
78 sharp/.style={line cap=butt,line join=miter},
79 }%
80 %
81 %
82 % Classification of arrow tips:
83 %
84 %
85 % Barbs
86 % -----
87 %
88 % These arrow tips consisting of stroked lines starting at the tip,
89 % typically going backward. They cannot be filled, only stroked
90 %
91 % A special case are the arrows mimicking the tip at the end of a
92 % \rightarrow command.
93 %
94 %
95 % Geometric
96 % ---------
97 %
98 % The arrow tips have a geometric form like a triangle or a
99 % "stealth" fighter or a kite. They can be filled and/or stroked.
100 %
101 %
102 % Caps
103 % ----
104 %
105 % These arrow tips have their width fixed to the line width and
106 % provide different ways of adding a "cap" to the end of a line. This
107 % allows one to use more than just the standard "round cap", "butt
108 % cap" and "rect cap" and, additionally, one can one kind of cap at
109 % one end and another at the other end.
110 %
111 %
112 % Other
113 % -----
114 %
115 % Special purpose arrow tips.
116 %
117
118
119
120 %
121 %
122 % Barbs arrow tips
123 %
124 %
125
126
127 % An Straight Barb yields a simple angle
128
129 \pgfdeclarearrow{
130 name = Straight Barb,
131 defaults = {
132 length = +1.5pt 2,
133 width' = +0pt 2,
134 line width = +0pt 1 1,
135 },
136 setup code = {
137 % Compute front miter length:
138 \pgfmathdivide@{\pgf@sys@tonumber\pgfarrowlength}{\pgf@sys@tonumber\pgfarrowwidth}%
139 \let\pgf@temp@quot\pgfmathresult%
140 \pgf@x\pgfmathresult pt%
141 \pgf@x\pgfmathresult\pgf@x%
142 \pgf@x4\pgf@x%
143 \advance\pgf@x by1pt%
144 \pgfmathsqrt@{\pgf@sys@tonumber\pgf@x}%
145 \pgf@xc\pgfmathresult\pgfarrowlinewidth% xc is front miter
146 \[email protected]\pgf@xc
147 \pgf@xa\pgf@temp@quot\pgfarrowlinewidth% xa is extra harpoon miter
148 % Set ends
149 \ifpgfarrowroundjoin
150 \pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by.5\pgfarrowlinewidth}
151 \else
152 \pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by\pgf@xc\ifpgfarrowharpoon\advance\pgf@x by\pgf@xa\fi}
153 \fi
154 \pgfarrowssetvisualbackend{\pgfarrowlength\advance\pgf@x by.5\pgfarrowlinewidth}
155 \pgfarrowssetbackend{-.5\pgfarrowlinewidth}
156 % harpoon miter correction
157 \ifpgfarrowreversed
158 \pgfarrowssetlineend{\pgfarrowlength\ifpgfarrowharpoon\advance\pgf@x by.5\pgfarrowlinewidth\fi}
159 \else
160 \pgfarrowssetlineend{\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth}
161 \fi
162 % The hull:
163 \ifpgfarrowroundjoin
164 \pgfarrowshullpoint{\pgfarrowlength\advance\pgf@x by.5\pgfarrowlinewidth}{\ifpgfarrowharpoon-.5\pgfarrowlinewidth\else0pt\fi}%
165 \else%
166 \ifpgfarrowharpoon
167 \pgfarrowshullpoint{\pgfarrowlength\advance\pgf@x by\pgf@xc\advance\pgf@x by\pgf@xa}{-.5\pgfarrowlinewidth}%
168 \else
169 \pgfarrowshullpoint{\pgfarrowlength\advance\pgf@x by\pgf@xc\advance\pgf@x by\pgf@xa}{0pt}%
170 \fi%
171 \fi
172 \pgfarrowsupperhullpoint{.5\pgfarrowlinewidth}{.5\pgfarrowwidth\advance\pgf@y by.5\pgfarrowlinewidth}%
173 \pgfarrowsupperhullpoint{-.5\pgfarrowlinewidth}{.5\pgfarrowwidth\advance\pgf@y by.5\pgfarrowlinewidth}%
174 \ifpgfarrowharpoon
175 \pgfarrowshullpoint{-.5\pgfarrowlinewidth}{-.5\pgfarrowlinewidth}%
176 \fi
177 % The following are needed in the code:
178 \pgfarrowssavethe\pgfarrowlinewidth
179 \pgfarrowssavethe\pgfarrowlength
180 \pgfarrowssavethe\pgfarrowwidth
181 },
182 drawing code = {
183 \pgfsetdash{}{+0pt}
184 \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi
185 \ifpgfarrowroundcap\pgfsetroundcap\else\pgfsetbuttcap\fi
186 \ifdim\pgfarrowlinewidth=\pgflinewidth\else\pgfsetlinewidth{+\pgfarrowlinewidth}\fi
187 \pgfpathmoveto{\pgfqpoint{0pt}{.5\pgfarrowwidth}}
188 \pgfpathlineto{\pgfqpoint{\pgfarrowlength}{0pt}}
189 \ifpgfarrowharpoon
190 \pgfpathlineto{\pgfqpoint{\pgfarrowlength\advance\pgf@x by\ifpgfarrowreversed\else-\fi\pgfarrowlinewidth}{0pt}}
191 \else
192 \pgfpathlineto{\pgfqpoint{0pt}{-.5\pgfarrowwidth}}
193 \fi
194 \pgfusepathqstroke
195 },
196 parameters = {
197 \the\pgfarrowlinewidth,%
198 \the\pgfarrowlength,%
199 \the\pgfarrowwidth,%
200 \ifpgfarrowharpoon h\fi%
201 \ifpgfarrowroundjoin j\fi%
202 \ifpgfarrowroundcap c\fi%
203 },
204 }%
205 %
206 %
207 % Hooks are barbs that consist of an arc going forward from the line
208 % end and curving back by a given angle specified using the |arc|
209 % key.
210
211 \pgfkeys{
212 /pgf/arrow keys/.cd,
213 arc/.code={%
214 \pgfmathparse{#1}%
215 \expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\def\expandafter\pgfarrowarc\expandafter{\pgfmathresult}}
216 }
217 }%
218
219 \def\pgfarrowarc{180}%
220
221 \pgfdeclarearrow{
222 name = Hooks,
223 defaults = {
224 length = +0.75pt 1.25,
225 width' = +0pt 4 -1,
226 line width = +0pt 1 1,
227 },
228 setup code = {
229 \ifpgfarrowharpoon
230 \pgfarrowshullpoint{.5\pgfarrowlength}{-.5\pgfarrowlinewidth}
231 \pgfarrowshullpoint{\pgfarrowlength}{-.5\pgfarrowlinewidth\advance\pgf@y by.125\pgfarrowwidth}
232 \fi
233 \ifdim\pgfarrowarc pt<90.1pt
234 \pgfarrowsupperhullpoint{0pt}{.25\pgfarrowwidth\ifpgfarrowroundcap\else\advance\pgf@y by-.25\pgfarrowlinewidth\fi}
235 \pgfarrowsupperhullpoint{\pgfarrowlength}{.25\pgfarrowwidth\ifpgfarrowroundcap\else\advance\pgf@y by-.25\pgfarrowlinewidth\fi}
236 \else%
237 \pgfarrowsupperhullpoint{\pgfarrowlength}{.375\pgfarrowwidth}
238 \pgfarrowsupperhullpoint{.5\pgfarrowlength}{.5\pgfarrowwidth}
239 \ifdim\pgfarrowarc pt>180pt
240 \pgfarrowsupperhullpoint{-.5\pgfarrowlength}{.5\pgfarrowwidth}
241 \pgfarrowsupperhullpoint{-\pgfarrowlength}{.375\pgfarrowwidth}
242 \pgfarrowsupperhullpoint{-\pgfarrowlength}{.25\pgfarrowwidth}
243 \else
244 \pgfarrowsupperhullpoint{\ifpgfarrowroundcap-.5\pgfarrowlinewidth\else0pt\fi}{.25\pgfarrowwidth}
245 \pgfarrowsupperhullpoint{\ifpgfarrowroundcap-.5\pgfarrowlinewidth\else0pt\fi}{.5\pgfarrowwidth}
246 \fi
247 \fi
248 % Adjust width and length: Take line thickness into account:
249 \advance\pgfarrowlength by-.5\pgfarrowlinewidth
250 \advance\pgfarrowwidth by-\pgfarrowlinewidth
251 \ifpgfarrowreversed
252 \ifpgfarrowroundjoin
253 \pgfarrowssetbackend{-.5\pgfarrowlinewidth}
254 \fi
255 \fi
256 % There are four different intervals for the values of
257 % \pgfarrowsarc that give rise to four different settings of tip
258 % ends and so on:
259 %
260 % Case 1: 0 <= Angle < 90
261 %
262 \ifdim\pgfarrowarc pt<90pt%
263 % Tip end is given by sin(pgfarrowarc)*length
264 \pgfmathsin@{\pgfarrowarc}
265 \pgfarrowssettipend{\pgfmathresult\pgfarrowlength\advance\pgf@x by.5\pgfarrowlinewidth}%
266 \else\ifdim\pgfarrowarc pt<180pt%
267 \pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by.5\pgfarrowlinewidth}%
268 \ifpgfarrowroundcap\pgfarrowssetbackend{-.5\pgfarrowlinewidth}\fi%
269 \else\ifdim\pgfarrowarc pt<270pt%
270 \pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by.5\pgfarrowlinewidth}%
271 \ifdim\pgfarrowarc pt>180pt
272 % Back end is given by sin(pgfarrowarc)*length
273 \pgfmathsin@{\pgfarrowarc}
274 \pgfarrowssetbackend{\pgfmathresult\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth}%
275 \else
276 \ifpgfarrowroundcap\pgfarrowssetbackend{-.5\pgfarrowlinewidth}\fi%
277 \fi%
278 \else%
279 \pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by.5\pgfarrowlinewidth}%
280 \pgfarrowssetbackend{-\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth}%
281 \fi\fi\fi%
282 \ifpgfarrowreversed
283 \pgfarrowssetlineend{.5\pgfarrowlinewidth}
284 \else%
285 \ifpgfarrowharpoon
286 \pgfarrowssetlineend{0pt}
287 \else
288 \pgfarrowssetlineend{.25\pgfarrowlinewidth}
289 \fi
290 \fi
291 % Adjust arc:
292 \pgf@x\pgfarrowarc pt%
293 \advance\pgf@x by-90pt%
294 \edef\pgfarrowarc{\pgf@sys@tonumber\pgf@x}%
295 % The following are needed in the code:
296 \pgfarrowssavethe\pgfarrowlinewidth
297 \pgfarrowssavethe\pgfarrowlength
298 \pgfarrowssavethe\pgfarrowwidth
299 \pgfarrowssave\pgfarrowarc
300 },
301 drawing code = {
302 \pgfsetdash{}{+0pt}
303 \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi
304 \ifpgfarrowroundcap\pgfsetroundcap\else\pgfsetbuttcap\fi
305 \ifdim\pgfarrowlinewidth=\pgflinewidth\else\pgfsetlinewidth{+\pgfarrowlinewidth}\fi
306 {%
307 \pgftransformxscale{+\pgfarrowlength}
308 \pgftransformyscale{+.25\pgfarrowwidth}
309 \pgfpathmoveto{\pgfpointpolar{+\pgfarrowarc}{+1pt}\advance\pgf@y by1pt}
310 \pgfpatharc{\pgfarrowarc}{+-90}{+1pt}
311 \ifpgfarrowharpoon
312 \else
313 \pgfpatharc{+90}{+-\pgfarrowarc}{+1pt}
314 \fi
315 }
316 \ifpgfarrowharpoon\ifpgfarrowreversed
317 \pgfpathlineto{\pgfqpoint{\pgflinewidth}{0pt}}
318 \fi\fi
319 \pgfusepathqstroke
320 },
321 parameters = {
322 \the\pgfarrowlinewidth,%
323 \the\pgfarrowlength,%
324 \the\pgfarrowwidth,%
325 \pgfarrowarc,%
326 \ifpgfarrowharpoon h\fi%
327 \ifpgfarrowroundjoin j\fi%
328 \ifpgfarrowroundcap c\fi%
329 },
330 }%
331
332
333 \pgfdeclarearrow{
334 name = Arc Barb,
335 defaults = {
336 length = +1.5pt 2,
337 width' = +0pt 2,
338 line width = +0pt 1 1,
339 },
340 setup code = {
341 % Adjust arc:
342 \pgf@x\pgfarrowarc pt%
343 \[email protected]\pgf@x%
344 \edef\pgfarrowarc{\pgf@sys@tonumber\pgf@x}%
345 % The tips:
346 \pgfarrowssettipend{\pgfarrowlength}
347 \pgfarrowssetvisualbackend{\pgfarrowlength}
348 \pgfarrowssetlineend{\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth}
349 % The hull:
350 \pgfarrowsupperhullpoint{\pgfarrowlength}{.25\pgfarrowwidth}
351 \ifpgfarrowharpoon\pgfarrowshullpoint{\pgfarrowlength}{-.5\pgflinewidth}\fi
352 \pgfmathsincos@{\pgfarrowarc}%
353 \[email protected]\pgfarrowwidth%
354 \pgfarrowsupperhullpoint{\pgfmathresultx\pgfarrowlength}{\pgfmathresulty\pgf@xa}
355 \ifdim\pgfarrowarc pt>60pt
356 \pgfarrowsupperhullpoint{.5\pgfarrowlength}{\ifdim\pgfarrowarc pt<90pt\pgfmathresulty\pgf@xa\else.5\pgfarrowwidth\fi}
357 \fi
358 \ifdim\pgfarrowarc pt>90pt
359 \ifdim\pgfarrowarc pt<120pt
360 \pgfarrowsupperhullpoint{\pgfmathresultx\pgfarrowlength}{.5\pgfarrowwidth}
361 \else
362 \pgfarrowsupperhullpoint{-.5\pgfarrowlength}{.5\pgfarrowwidth}
363 \ifdim\pgfarrowarc pt>150pt
364 \pgfarrowsupperhullpoint{-\pgfarrowlength}{.25\pgfarrowwidth}
365 \fi
366 \fi
367 \fi
368 \pgfutil@tempswafalse
369 \ifdim\pgfarrowarc pt<90pt
370 \pgfutil@tempswatrue
371 \fi
372 \ifpgfarrowharpoon
373 \pgfutil@tempswatrue
374 \fi
375 \ifpgfutil@tempswa
376 \[email protected]\pgfarrowwidth\advance\pgf@xa by-\pgfarrowlinewidth%
377 \pgf@ya\pgfarrowlength\advance\pgf@ya by-\pgfarrowlinewidth%
378 \pgfarrowsupperhullpoint{\pgfmathresultx\pgf@ya}{\pgfmathresulty\pgf@xa}
379 \fi
380 % Compute back end
381 \ifpgfarrowroundcap
382 \pgf@y\pgfarrowlength
383 \advance\pgf@y by-.5\pgfarrowlinewidth
384 \pgf@x\pgfmathresultx\pgf@y%
385 \else
386 \ifdim\pgfarrowarc pt<90pt
387 \pgf@y\pgfarrowlength
388 \advance\pgf@y by-\pgfarrowlinewidth
389 \pgf@x\pgfmathresultx\pgf@y%
390 \else
391 \pgf@x\pgfmathresultx\pgfarrowlength%
392 \fi
393 \fi
394 \pgfarrowssetbackend{\pgf@x\ifpgfarrowroundcap\advance\pgf@x by-.5\pgfarrowlinewidth\fi}
395 % Adjust width and length: Take line thickness into account:
396 \advance\pgfarrowlength by-.5\pgfarrowlinewidth
397 \advance\pgfarrowwidth by-\pgfarrowlinewidth
398 % The following are needed in the code:
399 \pgfarrowssavethe\pgfarrowlinewidth
400 \pgfarrowssavethe\pgfarrowlength
401 \pgfarrowssavethe\pgfarrowwidth
402 \pgfarrowssave\pgfarrowarc
403 },
404 drawing code = {
405 \pgfsetdash{}{+0pt}
406 \ifpgfarrowroundcap\pgfsetroundcap\else\pgfsetbuttcap\fi
407 \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi
408 \ifdim\pgfarrowlinewidth=\pgflinewidth\else\pgfsetlinewidth{+\pgfarrowlinewidth}\fi
409 {%
410 \pgftransformxscale{+\pgfarrowlength}
411 \pgftransformyscale{+.5\pgfarrowwidth}
412 \pgfpathmoveto{\pgfpointpolar{+\pgfarrowarc}{+1pt}}
413 \ifpgfarrowharpoon
414 \pgfpatharc{+\pgfarrowarc}{0pt}{+1pt}
415 \else
416 \pgfpatharc{+\pgfarrowarc}{+-\pgfarrowarc}{+1pt}
417 \fi
418 }
419 \ifpgfarrowharpoon
420 \pgfpathlineto{\pgfqpoint{\pgfarrowlength\advance\pgf@x by\ifpgfarrowreversed\else-\fi.5\pgflinewidth}{0pt}}
421 \fi
422 \pgfusepathqstroke
423 },
424 parameters = {
425 \the\pgfarrowlinewidth,%
426 \the\pgfarrowlength,%
427 \the\pgfarrowwidth,%
428 \pgfarrowarc,%
429 \ifpgfarrowharpoon h\fi%
430 \ifpgfarrowroundcap c\fi%
431 \ifpgfarrowroundjoin j\fi%
432 },
433 }%
434
435
436
437 % Tee Barb are barb arrows heads that look like a T
438
439 \pgfdeclarearrow{
440 name = Tee Barb,
441 defaults = {
442 length = +1.5pt 2,
443 width = +3pt 4,
444 inset' = +0pt .5,
445 line width = +0pt 1 1,
446 },
447 bending mode=polar,
448 setup code = {
449 % Two useful numbers...
450 \pgfutil@tempswafalse%
451 \pgfutil@tempswbfalse%
452 \pgfutil@tempdima\pgfarrowlength\advance\pgfutil@tempdima by-\pgfarrowinset\ifdim\pgfutil@tempdima<.5\pgfarrowlinewidth\[email protected]\pgfarrowlinewidth\pgfutil@tempswatrue\fi%
453 \pgfutil@tempdimb-\pgfarrowinset\ifdim\pgfutil@tempdimb>-.5\pgfarrowlinewidth\[email protected]\pgfarrowlinewidth\pgfutil@tempswbtrue\fi
454 % The following are needed in the code:
455 \pgfarrowssavethe\pgfarrowwidth
456 \pgfarrowssavethe\pgfutil@tempdima
457 \pgfarrowssavethe\pgfutil@tempdimb
458 % Infos:
459 \pgfarrowssettipend{\pgfutil@tempdima\ifpgfarrowroundcap\ifpgfutil@tempswa\else\advance\pgf@x by.5\pgfarrowlinewidth\fi\fi}
460 \pgfarrowssetvisualbackend{.5\pgfarrowlinewidth}
461 \pgfarrowssetbackend{\pgfutil@tempdimb\ifpgfarrowroundcap\ifpgfutil@tempswb\else\advance\pgf@x by-.5\pgfarrowlinewidth\fi\fi}
462 \pgfarrowssetlineend{\ifpgfarrowreversed\else-\fi.25\pgfarrowlinewidth}%
463 % The hull:
464 \pgfarrowsupperhullpoint{\pgfutil@tempdima\ifpgfarrowroundcap\ifpgfutil@tempswa\else\advance\pgf@x by.5\pgfarrowlinewidth\fi\fi}{.5\pgfarrowwidth}%
465 \pgfarrowsupperhullpoint{\pgfutil@tempdimb\ifpgfarrowroundcap\ifpgfutil@tempswb\else\advance\pgf@x by-.5\pgfarrowlinewidth\fi\fi}{.5\pgfarrowwidth}%
466 \ifpgfarrowharpoon
467 \pgfarrowshullpoint{.5\pgfarrowlinewidth}{-.5\pgfarrowlinewidth}%
468 \fi
469 },
470 drawing code = {
471 \pgfsetdash{}{+0pt}
472 \pgf@yc\pgflinewidth% save...
473 \ifdim\pgflinewidth=\pgfarrowlinewidth\else\pgfsetlinewidth{+\pgfarrowlinewidth}\fi
474 \ifpgfarrowroundcap\pgfsetroundcap\else\pgfsetbuttcap\fi
475 \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi
476 \pgf@x\pgfutil@tempdima\advance\pgf@x by-.5\pgfarrowlinewidth%
477 \pgf@y\pgfutil@tempdimb\advance\pgf@y by.5\pgfarrowlinewidth%
478 % Case 1: No bar atop the I:
479 \ifdim\pgf@x=\pgf@y%
480 \pgfpathmoveto{\pgfqpoint{0pt}{.5\pgfarrowwidth}}
481 \pgfpathlineto{\pgfqpoint{0pt}{\ifpgfarrowharpoon-.5\pgfarrowlinewidth\else-.5\pgfarrowwidth\fi}}
482 \else
483 % Case 2: Bar, but only in one direction:
484 \ifdim\pgfutil@tempdima=.5\pgfarrowlinewidth%
485 \pgfpathmoveto{\pgfqpoint{\pgfutil@tempdimb}{.5\pgfarrowwidth\advance\pgf@y by-.5\pgfarrowlinewidth}}
486 \pgfpathlineto{\pgfqpoint{0pt}{.5\pgfarrowwidth\advance\pgf@y by-.5\pgfarrowlinewidth}}
487 \ifpgfarrowharpoon%
488 \pgfpathlineto{\pgfqpoint{0pt}{-.5\pgf@yc}}%
489 \else%
490 \pgfpathlineto{\pgfqpoint{0pt}{-.5\pgfarrowwidth\advance\pgf@y by.5\pgfarrowlinewidth}}
491 \pgfpathlineto{\pgfqpoint{\pgfutil@tempdimb}{-.5\pgfarrowwidth\advance\pgf@y by.5\pgfarrowlinewidth}}
492 \fi
493 \else% Case 3: Complete I:
494 \pgfpathmoveto{\pgfqpoint{\pgfutil@tempdimb}{.5\pgfarrowwidth\advance\pgf@y by-.5\pgfarrowlinewidth}}
495 \pgfpathlineto{\pgfqpoint{\pgfutil@tempdima}{.5\pgfarrowwidth\advance\pgf@y by-.5\pgfarrowlinewidth}}
496 \pgfpathmoveto{\pgfqpoint{0pt}{.5\pgfarrowwidth\advance\pgf@y by-.5\pgfarrowlinewidth}}
497 \ifpgfarrowharpoon%
498 \pgfpathlineto{\pgfqpoint{0pt}{-.5\pgf@yc}}%
499 \else%
500 \pgfpathlineto{\pgfqpoint{0pt}{-.5\pgfarrowwidth\advance\pgf@y by.5\pgfarrowlinewidth}}
501 \pgfpathmoveto{\pgfqpoint{\pgfutil@tempdimb}{-.5\pgfarrowwidth\advance\pgf@y by.5\pgfarrowlinewidth}}
502 \pgfpathlineto{\pgfqpoint{\pgfutil@tempdima}{-.5\pgfarrowwidth\advance\pgf@y by.5\pgfarrowlinewidth}}
503 \fi
504 \fi
505 \fi
506 \pgfusepathqstroke
507 },
508 parameters = {
509 \the\pgfarrowwidth,%
510 \the\pgfarrowlength,%
511 \the\pgfarrowinset,%
512 \the\pgfarrowlinewidth,%
513 \ifpgfarrowharpoon h\fi%
514 \ifpgfarrowroundjoin j\fi%
515 \ifpgfarrowroundcap c\fi%
516 },
517 }%
518
519
520 % Math barbs that resemble \rightarrow in different fonts:
521
522
523
524 % The original default arrow head used in TikZ. It is modeled on an
525 % old version of the \rightarrow head of the *old* Computer Modern
526 % fonts.
527
528 \pgfdeclarearrow{
529 name = Classical TikZ Rightarrow,
530 defaults = {
531 length = +1.05pt 1.925,
532 width' = +0pt 1.9237,
533 line width = 0pt 0.8 1,
534 round
535 },
536 setup code =
537 {
538 \ifpgfarrowharpoon\pgfarrowroundjointrue\fi
539 % inner length:
540 \pgfutil@tempdima\pgfarrowlength
541 \advance\pgfutil@tempdima by-\pgfarrowlinewidth
542 \pgfutil@tempdimb\pgfarrowwidth
543 \advance\pgfutil@tempdimb by-\pgfarrowlinewidth
544 \ifpgfarrowroundjoin%
545 \else%
546 \pgfmathdivide@{\pgf@sys@tonumber\pgfutil@tempdima}{\pgf@sys@tonumber\pgfutil@tempdimb}%
547 \let\pgf@temp@quot\pgfmathresult%
548 \pgf@x\pgfmathresult pt%
549 \pgf@x\pgfmathresult\pgf@x%
550 \[email protected]\pgf@x%
551 \advance\pgf@x by1pt% \pgflinewidth^2 + (6.4 \pgftempdim@a / \pgfutil@tempdimb) \pgflinewidth^2
552 \pgfmathsqrt@{\pgf@sys@tonumber\pgf@x}%
553 \pgf@xc\pgfmathresult\pgfarrowlinewidth% xc is front miter
554 \[email protected]\pgf@xc
555 \fi%
556 % The following are needed in the code:
557 \pgfarrowssavethe\pgfutil@tempdima
558 \pgfarrowssavethe\pgfutil@tempdimb
559 % The extend:
560 \pgfarrowssettipend{\pgfutil@tempdima\ifpgfarrowroundjoin\advance\pgf@x by.5\pgfarrowlinewidth\else\advance\pgf@x by\pgf@xc\fi}%
561 \pgfarrowssetvisualbackend{\pgfutil@tempdima\advance\pgf@x by.5\pgfarrowlinewidth}%
562 \ifpgfarrowreversed%
563 \ifpgfarrowharpoon%
564 % A reversed arrow needs a slightly different line end:
565 \pgfarrowssetlineend{\pgfutil@tempdima\advance\pgf@x by.5\pgflinewidth}%
566 \else%
567 % A reversed arrow needs a slightly different line end:
568 \pgfarrowssetlineend{\pgfutil@tempdima\advance\pgf@x by-.25\pgflinewidth}%
569 \fi%
570 \else%
571 \pgfarrowssetlineend{\pgfutil@tempdima\advance\pgf@x by-.6\pgflinewidth}%
572 \fi%
573 \pgfarrowssetbackend{-.5\pgfarrowlinewidth}%
574 % The hull:
575 % Tip:
576 \pgfarrowshullpoint{\pgfutil@tempdima\ifpgfarrowroundjoin\advance\pgf@x by.5\pgfarrowlinewidth\else\advance\pgf@x by\pgf@xc\fi}{.5\pgfarrowlinewidth}%
577 \pgfarrowshullpoint{\pgfutil@tempdima\ifpgfarrowroundjoin\advance\pgf@x by.5\pgfarrowlinewidth\else\advance\pgf@x by\pgf@xc\fi}{-.5\pgfarrowlinewidth}%
578 % Upper end:
579 \pgfarrowsupperhullpoint{.5\pgfarrowlinewidth}{.5\pgfutil@tempdimb\advance\pgf@y by.5\pgfarrowlinewidth}%
580 \pgfarrowsupperhullpoint{-.5\pgfarrowlinewidth}{.5\pgfutil@tempdimb\advance\pgf@y by.5\pgfarrowlinewidth}%
581 % Lower end:
582 \ifpgfarrowharpoon
583 \pgfarrowshullpoint{\pgfutil@tempdima\advance\pgf@x by-\pgflinewidth}{-.5\pgflinewidth}%
584 \pgfarrowshullpoint{-.5\pgfarrowlinewidth}{.5\pgfutil@tempdimb\advance\pgf@y by-.5\pgflinewidth}%
585 \fi
586 },
587 drawing code =
588 {
589 \pgfsetdash{}{+0pt}
590 \edef\pgf@orig@linewidth{\the\pgflinewidth}
591 \ifdim\pgfarrowlinewidth=\pgflinewidth\else\pgfsetlinewidth{+\pgfarrowlinewidth}\fi
592 \ifpgfarrowharpoon\pgfarrowroundjointrue\fi
593 \ifpgfarrowroundcap\pgfsetroundcap\else\pgfsetbuttcap\fi
594 \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi
595 \pgfpathmoveto
596 {\pgfqpoint{0pt}{.5\pgfutil@tempdimb}}
597 \ifpgfarrowharpoon
598 \pgf@arrows@old@tikz@harpoon
599 \else
600 \pgfpathcurveto
601 {\pgfqpoint{0.066666\pgfutil@tempdima}{0.3125\pgfutil@tempdimb}}
602 {\pgfqpoint{.8\pgfutil@tempdima}{0.03125\pgfutil@tempdimb}}
603 {\pgfqpoint{\pgfutil@tempdima}{0pt}}
604 \pgfpathcurveto
605 {\pgfqpoint{.8\pgfutil@tempdima}{-.03125\pgfutil@tempdimb}}
606 {\pgfqpoint{0.066666\pgfutil@tempdima}{-.3125\pgfutil@tempdimb}}
607 {\pgfqpoint{0pt}{-.5\pgfutil@tempdimb}}
608 \pgfsetlinewidth{+\pgfarrowlinewidth}
609 \pgfusepathqstroke
610 \fi
611 },
612 parameters = {
613 \the\pgfarrowlinewidth,%
614 \the\pgfarrowlength,%
615 \the\pgfarrowwidth,%
616 \ifpgfarrowharpoon h\fi%
617 \ifpgfarrowroundjoin j\fi%
618 \ifpgfarrowroundcap c\fi%
619 },
620 }%
621
622 \def\pgf@arrows@old@tikz@harpoon{
623 \ifpgfarrowreversed
624 \pgf@arrows@old@tikz@harpoon@reversed
625 \else
626 \pgfpathcurveto
627 {\pgfqpoint{0.066666\pgfutil@tempdima}{0.3125\pgfutil@tempdimb}}
628 {\pgfqpoint{.8\pgfutil@tempdima}{0.03125\pgfutil@tempdimb}}
629 {\pgfqpoint{\pgfutil@tempdima}{0pt}}
630 \pgfpathcurveto
631 {\pgfqpoint{0.95\pgfutil@tempdima}{-0.125\pgflinewidth}}
632 {\pgfqpoint{0.933333\pgfutil@tempdima}{-0.125\pgflinewidth}}
633 {\pgfqpoint{0.933333\pgfutil@tempdima}{-0.125\pgflinewidth}}
634 \pgfpathlineto
635 {\pgfqpoint{0.8\pgfutil@tempdima\advance\pgf@x by-.5\pgflinewidth}{-0.125\pgflinewidth}}
636 \pgfusepathqstroke
637 \fi
638 }%
639 \def\pgf@arrows@old@tikz@harpoon@reversed{
640 \pgfpathcurveto
641 {\pgfqpoint{0.066666\pgfutil@tempdima}{0.3125\pgfutil@tempdimb}}
642 {\pgfqpoint{.8\pgfutil@tempdima}{0.03125\pgfutil@tempdimb}}
643 {\pgfqpoint{\pgfutil@tempdima}{0.125\pgflinewidth}}
644 \pgfpathmoveto
645 {\pgfqpoint{0pt}{.5\pgfutil@tempdimb}}
646 \pgfpathcurveto
647 {\pgfqpoint{0.066666\pgfutil@tempdima}{0.3125\pgfutil@tempdimb}}
648 {\pgfqpoint{.8\pgfutil@tempdima}{0.03125\pgfutil@tempdimb}}
649 {\pgfqpoint{\pgfutil@tempdima}{-0.125\pgflinewidth}}
650 \pgfusepathqstroke
651 \pgfsetlinewidth{+\pgf@orig@linewidth}
652 \pgfsetroundcap
653 \pgfpathmoveto{\pgfqpoint{\pgfutil@tempdima\advance\pgf@x by0.6\pgflinewidth}{0pt}}
654 \pgfpathlineto{\pgfqpoint{\pgfutil@tempdima}{0pt}}
655 \pgfusepathqstroke
656 }%
657
658
659 % An approximation to the new (past 1992) Computer Modern math arrow
660 % heads. This would be a better version of "to", so consider saying
661 % to/.tips=Computer Modern Rightarrow
662
663 \pgfdeclarearrow{
664 name = Computer Modern Rightarrow,
665 defaults = {
666 length = +1.6pt 2.2, % 0pt 5.2
667 width' = +0pt 2.096774,
668 line width = 0pt 1 1,
669 round
670 },
671 setup code =
672 {
673 % inner length:
674 \pgfutil@tempdima\pgfarrowlength
675 \advance\pgfutil@tempdima by-\pgfarrowlinewidth
676 \pgfutil@tempdimb\pgfarrowwidth
677 \advance\pgfutil@tempdimb by-\pgfarrowlinewidth
678 % The following are needed in the code:
679 \pgfarrowssavethe\pgfutil@tempdima
680 \pgfarrowssavethe\pgfutil@tempdimb
681 % Front miter:
682 \ifpgfarrowroundjoin%
683 \else%
684 \pgfmathdivide@{\pgf@sys@tonumber\pgfutil@tempdima}{\pgf@sys@tonumber\pgfutil@tempdimb}%
685 \let\pgf@temp@quot\pgfmathresult%
686 \pgf@x\pgfmathresult pt%
687 \pgf@x\pgfmathresult\pgf@x%
688 \[email protected]\pgf@x%
689 \advance\pgf@x by1pt% \pgfarrowlinewidth^2 + (0.41019/0.0583333 \pgftempdim@a / \pgfutil@tempdimb) \pgfarrowlinewidth^2
690 \pgfmathsqrt@{\pgf@sys@tonumber\pgf@x}%
691 \pgf@xc\pgfmathresult\pgfarrowlinewidth% xc is front miter
692 \[email protected]\pgf@xc
693 \pgf@xa\pgf@temp@quot\pgfarrowlinewidth% xa is extra harpoon miter
694 \[email protected]\pgf@xa% xa is extra harpoon miter
695 \fi%
696 % The extend:
697 \pgfarrowssettipend{\ifpgfarrowroundjoin.5\pgfarrowlinewidth\else\pgf@xc\ifpgfarrowharpoon\advance\pgf@x by\pgf@xa\fi\fi}%
698 \pgfarrowssetvisualbackend{.5\pgfarrowlinewidth}%
699 \ifpgfarrowreversed%
700 \ifpgfarrowharpoon%
701 \pgfarrowssetlineend{.5\pgfarrowlinewidth}%
702 \else%
703 \pgfarrowssetlineend{-.5\pgfarrowlinewidth}%
704 \fi%
705 \else%
706 \pgfarrowssetlineend{-.5\pgfarrowlinewidth}%
707 \fi%
708 \pgfarrowssetbackend{-\pgfutil@tempdima\advance\pgf@x by-.5\pgfarrowlinewidth}%
709 % The hull:
710 % Tip:
711 \pgfarrowshullpoint{\ifpgfarrowroundjoin.5\pgfarrowlinewidth\else\pgf@xc\ifpgfarrowharpoon\advance\pgf@x by\pgf@xa\fi\fi}{.5\pgfarrowlinewidth}%
712 \pgfarrowshullpoint{\ifpgfarrowroundjoin.5\pgfarrowlinewidth\else\pgf@xc\ifpgfarrowharpoon\advance\pgf@x by\pgf@xa\fi\fi}{-.5\pgfarrowlinewidth}%
713 % Upper end:
714 \pgfarrowsupperhullpoint{-\pgfutil@tempdima\advance\pgf@x by.5\pgfarrowlinewidth}{.5\pgfutil@tempdimb\advance\pgf@y by.5\pgfarrowlinewidth}%
715 \pgfarrowsupperhullpoint{-\pgfutil@tempdima\advance\pgf@x by-.5\pgfarrowlinewidth}{.5\pgfutil@tempdimb\advance\pgf@y by.5\pgfarrowlinewidth}%
716 % Lower end:
717 \ifpgfarrowharpoon
718 \pgfarrowshullpoint{-\pgfarrowlinewidth}{-.5\pgfarrowlinewidth}%
719 \pgfarrowshullpoint{-\pgfutil@tempdima\advance\pgf@x by-.5\pgfarrowlinewidth}{.5\pgfutil@tempdimb\advance\pgf@y by-.5\pgfarrowlinewidth}%
720 \fi
721 },
722 drawing code =
723 {
724 \pgfsetdash{}{+0pt}
725 \ifpgfarrowroundcap\pgfsetroundcap\else\pgfsetbuttcap\fi
726 \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi
727 \ifdim\pgfarrowlinewidth=\pgflinewidth\else\pgfsetlinewidth{+\pgfarrowlinewidth}\fi
728 \pgfpathmoveto
729 {\pgfqpoint{-\pgfutil@tempdima}{.5\pgfutil@tempdimb}}
730 \pgfpathcurveto
731 {\pgfqpoint{-0.81731\pgfutil@tempdima}{.2\pgfutil@tempdimb}}
732 {\pgfqpoint{-0.41019\pgfutil@tempdima}{0.05833333\pgfutil@tempdimb}}
733 {\pgfpointorigin}
734 \ifpgfarrowharpoon
735 \pgfpathlineto
736 {\pgfqpoint{\ifpgfarrowreversed.5\else-\fi\pgfarrowlinewidth}{0pt}}
737 \else
738 \pgfpathcurveto
739 {\pgfqpoint{-0.41019\pgfutil@tempdima}{-0.05833333\pgfutil@tempdimb}}
740 {\pgfqpoint{-0.81731\pgfutil@tempdima}{-.2\pgfutil@tempdimb}}
741 {\pgfqpoint{-\pgfutil@tempdima}{-.5\pgfutil@tempdimb}}
742 \fi
743 \pgfusepathqstroke
744 },
745 parameters = {
746 \the\pgfarrowlinewidth,%
747 \the\pgfarrowlength,%
748 \the\pgfarrowwidth,%
749 \ifpgfarrowharpoon h\fi
750 \ifpgfarrowharpoon r\fi
751 \ifpgfarrowroundjoin j\fi%
752 \ifpgfarrowroundcap c\fi%
753 },
754 }%
755
756
757
758 % The arrow tip of an \implies arrow, to be used with an inner
759 % line. Cannot be configured otherwise.
760
761 \pgfdeclarearrow{
762 name = Implies,
763 setup code = {
764 \pgf@xa\pgfinnerlinewidth
765 \[email protected]\pgflinewidth
766 \advance\pgfutil@tempdima by.25\pgf@xa%
767 \[email protected]\pgflinewidth
768 \advance\pgfutil@tempdimb by-.5\pgf@xa%
769 \pgfarrowssettipend{2.06\pgfutil@tempdima\advance\pgf@x by.5\pgfutil@tempdimb}
770 \pgfarrowssetbackend{-1.36\pgfutil@tempdima\advance\pgf@x by.5\pgfutil@tempdimb}
771 \pgfarrowsupperhullpoint{-1.4\pgfutil@tempdima}{2.8\pgfutil@tempdima}
772 \pgfarrowsupperhullpoint{2\pgfutil@tempdima}{.5\pgfutil@tempdimb}
773 \pgfarrowssavethe\pgfutil@tempdima
774 \pgfarrowssavethe\pgfutil@tempdimb
775 },
776 drawing code = {
777 \pgftransformxshift{.06\pgfutil@tempdima}
778 \pgfsetlinewidth{\pgfutil@tempdimb}
779 \pgfsetdash{}{+0pt}
780 \pgfsetroundcap
781 \pgfsetroundjoin
782 \pgfpathmoveto{\pgfpoint{-1.4\pgfutil@tempdima}{2.65\pgfutil@tempdima}}
783 \pgfpathcurveto
784 {\pgfpoint{-0.75\pgfutil@tempdima}{1.25\pgfutil@tempdima}}
785 {\pgfpoint{1\pgfutil@tempdima}{0.05\pgfutil@tempdima}}
786 {\pgfpoint{2\pgfutil@tempdima}{0pt}}
787 \pgfpathcurveto
788 {\pgfpoint{1\pgfutil@tempdima}{-0.05\pgfutil@tempdima}}
789 {\pgfpoint{-.75\pgfutil@tempdima}{-1.25\pgfutil@tempdima}}
790 {\pgfpoint{-1.4\pgfutil@tempdima}{-2.65\pgfutil@tempdima}}
791 \pgfusepathqstroke
792 },
793 parameters = {\the\pgfarrowlength}
794 }%
795
796
797
798
799 %
800 %
801 % Geometric arrow tips
802 %
803 %
804
805
806 % Generic "latex-like" arrow tip. This is the basic arrow tip used in
807 % latex's picture environment. You can configure its length and width.
808
809 \pgfdeclarearrow{
810 name = Latex,
811 defaults = {
812 length = +3pt 4.5 .8,% +2.8pt 3 0.8,
813 width' = +0pt .75,
814 line width = +0pt 1 1,
815 },
816 setup code = {
817 % Cap the line width at 1/4th distance from inset to tip
818 \[email protected]\pgfarrowlength
819 \ifdim\pgf@x<\pgfarrowlinewidth
820 \pgfarrowlinewidth\pgf@x
821 \fi
822 \pgfarrowssavethe\pgfarrowlinewidth%
823 % Compute front miter length:
824 \pgfmathdivide@{\pgf@sys@tonumber\pgfarrowlength}{\pgf@sys@tonumber\pgfarrowwidth}%
825 \let\pgf@temp@quot\pgfmathresult%
826 \pgf@x\pgfmathresult pt%
827 \pgf@x\pgfmathresult\pgf@x%
828 \pgf@x9\pgf@x%
829 \advance\pgf@x by1pt%
830 \pgfmathsqrt@{\pgf@sys@tonumber\pgf@x}%
831 \pgf@xc\pgfmathresult\pgfarrowlinewidth%
832 \pgf@xa\pgf@temp@quot\pgfarrowlinewidth
833 % Inner length (pgfutil@tempdima) is now arrowlength - front miter
834 % - 0.5 linewidth (back thickness)
835 \pgfutil@tempdima\pgfarrowlength%
836 \advance\pgfutil@tempdima by-.5\pgf@xc%
837 \advance\pgfutil@tempdima by-.5\pgfarrowlinewidth%
838 % harpoon miter correction
839 \pgfarrowssetbackend{-.5\pgfarrowlinewidth}
840 \ifpgfarrowreversed
841 \ifdim\pgfinnerlinewidth>0pt
842 \pgfarrowssetlineend{0pt}
843 \else
844 \pgfarrowssetlineend{\pgfutil@tempdima\advance\pgf@x by-.5\pgflinewidth}
845 \fi
846 \else
847 \pgfarrowssetlineend{0pt}
848 \fi
849 \ifpgfarrowroundjoin
850 \pgfarrowssettipend{\pgfutil@tempdima\advance\pgf@x by.5\pgfarrowlinewidth}
851 \else
852 \pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth\ifpgfarrowharpoon\advance\pgf@x by1.5\pgf@xa\fi}
853 \fi
854 % The following are needed in the code:
855 \pgfarrowssavethe\pgfutil@tempdima
856 % Now, compute back tip miter limit:
857 \pgf@process{\pgfpointnormalised{\pgfqpoint{.3\pgfarrowlength}{.2333333\pgfarrowwidth}}}%
858 \advance\pgf@y by1pt%
859 \pgf@yc\pgf@y\pgf@xc\pgf@x%
860 \pgfmathdivide@{\pgf@sys@tonumber\pgf@yc}{\pgf@sys@tonumber\pgf@xc}%
861 \pgfutil@tempdimb\pgfmathresult\pgfarrowlinewidth%
862 \[email protected]\pgfutil@tempdimb%
863 \advance\pgfutil@tempdimb by.5\pgfarrowwidth%
864 \pgfarrowssavethe\pgfutil@tempdimb%
865 % The hull:
866 \pgfarrowshullpoint{\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth\ifpgfarrowroundjoin\else\ifpgfarrowharpoon\advance\pgf@x by1.5\pgf@xa\fi\fi}{\ifpgfarrowharpoon-.5\pgfarrowlinewidth\else0pt\fi}%
867 \pgfarrowshullpoint{-.5\pgfarrowlinewidth}{.5\pgfarrowwidth\ifpgfarrowharpoon\advance\pgf@y by-.5\pgfarrowlinewidth\fi}%
868 \pgfarrowshullpoint{-.5\pgfarrowlinewidth}{\ifpgfarrowharpoon-.5\pgfarrowlinewidth\else-.5\pgfarrowwidth\fi}%
869 },
870 drawing code = {
871 \pgfsetdash{}{+0pt}
872 \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi
873 \ifdim\pgfarrowlinewidth=\pgflinewidth\else\pgfsetlinewidth{+\pgfarrowlinewidth}\fi
874 \pgfpathmoveto {\pgfqpoint{\pgfutil@tempdima}{0pt}}
875 \pgfpathcurveto {\pgfqpoint{.877192\pgfutil@tempdima}{.077922\pgfutil@tempdimb}}
876 {\pgfqpoint{.337381\pgfutil@tempdima}{.519480\pgfutil@tempdimb}}
877 {\pgfqpoint{0pt}{\pgfutil@tempdimb}}
878 \ifpgfarrowharpoon
879 \pgfpathlineto {\pgfpointorigin}
880 \else
881 \pgfpathlineto {\pgfqpoint{0pt}{-\pgfutil@tempdimb}}
882 \pgfpathcurveto {\pgfqpoint{.337381\pgfutil@tempdima}{-.519480\pgfutil@tempdimb}}
883 {\pgfqpoint{.877192\pgfutil@tempdima}{-.077922\pgfutil@tempdimb}}
884 {\pgfqpoint{\pgfutil@tempdima}{0pt}}
885 \fi
886 \pgfpathclose
887 \ifpgfarrowopen\pgfusepathqstroke\else\ifdim\pgfarrowlinewidth>0pt\pgfusepathqfillstroke\else\pgfusepathqfill\fi\fi
888 },
889 parameters = {
890 \the\pgfarrowlinewidth,%
891 \the\pgfarrowlength,%
892 \the\pgfarrowwidth,%
893 \ifpgfarrowharpoon h\fi%
894 \ifpgfarrowopen o\fi%
895 \ifpgfarrowroundjoin j\fi%
896 },
897 }%
898
899
900
901 % A basic stealth-fighter-like pointed arrow
902
903 \pgfdeclarearrow{
904 name = Stealth,
905 defaults = {
906 length = +3pt 4.5 .8,
907 width' = +0pt .75,
908 inset' = +0pt 0.325,
909 line width = +0pt 1 1,
910 },
911 setup code = {
912 % Cap the line width at 1/4th distance from inset to tip
913 \pgf@x\pgfarrowlength
914 \advance\pgf@x by-\pgfarrowinset
915 \[email protected]\pgf@x
916 \ifdim\pgf@x<\pgfarrowlinewidth
917 \pgfarrowlinewidth\pgf@x
918 \fi
919 % Compute front miter length:
920 \pgfmathdivide@{\pgf@sys@tonumber\pgfarrowlength}{\pgf@sys@tonumber\pgfarrowwidth}%
921 \let\pgf@temp@quot\pgfmathresult%
922 \pgf@x\pgfmathresult pt%
923 \pgf@x\pgfmathresult\pgf@x%
924 \pgf@x4\pgf@x%
925 \advance\pgf@x by1pt%
926 \pgfmathsqrt@{\pgf@sys@tonumber\pgf@x}%
927 \pgf@xc\pgfmathresult\pgfarrowlinewidth% xc is front miter
928 \[email protected]\pgf@xc
929 \pgf@xa\pgf@temp@quot\pgfarrowlinewidth% xa is extra harpoon miter
930 % Compute back miter length:
931 \[email protected]\pgfarrowwidth%
932 \csname pgfmathatan2@\endcsname{\pgfmath@tonumber\pgfarrowlength}{\pgfmath@tonumber\pgf@ya}%
933 \pgf@yb\pgfmathresult pt%
934 \csname pgfmathatan2@\endcsname{\pgfmath@tonumber\pgfarrowinset}{\pgfmath@tonumber\pgf@ya}%
935 \pgf@ya\pgfmathresult pt%
936 \advance\pgf@yb by-\pgf@ya%
937 \[email protected]\pgf@yb% half angle in yb
938 \pgfmathtan@{\pgf@sys@tonumber\pgf@yb}%
939 \pgfmathreciprocal@{\pgfmathresult}%
940 \pgf@yc\pgfmathresult\pgfarrowlinewidth%
941 \[email protected]\pgf@yc%
942 \advance\pgf@ya by\pgf@yb%
943 \pgfmathsincos@{\pgf@sys@tonumber\pgf@ya}%
944 \pgf@ya\pgfmathresulty\pgf@yc% ya is the back miter
945 \pgf@yb\pgfmathresultx\pgf@yc% yb is the top miter
946 \ifdim\pgfarrowinset=0pt%
947 \[email protected]\pgfarrowlinewidth% easy: back miter is half linewidth
948 \fi
949 % Compute inset miter length:
950 \pgfmathdivide@{\pgf@sys@tonumber\pgfarrowinset}{\pgf@sys@tonumber\pgfarrowwidth}%
951 \let\pgf@temp@quot\pgfmathresult%
952 \pgf@x\pgfmathresult pt%
953 \pgf@x\pgfmathresult\pgf@x%
954 \pgf@x4\pgf@x%
955 \advance\pgf@x by1pt%
956 \pgfmathsqrt@{\pgf@sys@tonumber\pgf@x}%
957 \pgf@yc\pgfmathresult\pgfarrowlinewidth% yc is inset miter
958 \[email protected]\pgf@yc%
959 % Inner length (pgfutil@tempdima) is now arrowlength - front miter - back miter
960 \pgfutil@tempdima\pgfarrowlength%
961 \advance\pgfutil@tempdima by-\pgf@xc%
962 \advance\pgfutil@tempdima by-\pgf@ya%
963 \[email protected]\pgfarrowwidth%
964 \advance\pgfutil@tempdimb by-\pgf@yb%
965 % harpoon miter correction
966 \ifpgfarrowroundjoin
967 \pgfarrowssetbackend{\pgf@ya\advance\pgf@x by-.5\pgfarrowlinewidth}
968 \else
969 \pgfarrowssetbackend{0pt}
970 \fi
971 \ifpgfarrowharpoon
972 \pgfarrowssetlineend{\pgfarrowinset\advance\pgf@x
973 by\pgf@yc\advance\pgf@x by.5\pgfarrowlinewidth}
974 \else
975 \pgfarrowssetlineend{\pgfarrowinset\advance\pgf@x by\pgf@yc\advance\pgf@x by-.25\pgfarrowlinewidth}
976 \ifpgfarrowreversed
977 \ifdim\pgfinnerlinewidth>0pt
978 \pgfarrowssetlineend{\pgfarrowinset}
979 \else
980 \pgfarrowssetlineend{\pgfutil@tempdima\advance\pgf@x by\pgf@ya\advance\pgf@x by-.25\pgfarrowlinewidth}
981 \fi
982 \fi
983 \fi
984 \ifpgfarrowroundjoin
985 \pgfarrowssettipend{\pgfutil@tempdima\advance\pgf@x by\pgf@ya\advance\pgf@x by.5\pgfarrowlinewidth}
986 \else
987 \pgfarrowssettipend{\pgfarrowlength\ifpgfarrowharpoon\advance\pgf@x by\pgf@xa\fi}
988 \fi
989 % The hull:
990 \pgfarrowshullpoint{\pgfarrowlength\ifpgfarrowroundjoin\else\ifpgfarrowharpoon\advance\pgf@x by\pgf@xa\fi\fi}{\ifpgfarrowharpoon-.5\pgfarrowlinewidth\else0pt\fi}%
991 \pgfarrowsupperhullpoint{0pt}{.5\pgfarrowwidth}%
992 \pgfarrowshullpoint{\pgfarrowinset}{\ifpgfarrowharpoon-.5\pgfarrowlinewidth\else 0pt\fi}%
993 % Adjust inset
994 \pgfarrowssetvisualbackend{\pgfarrowinset}
995 \advance\pgfarrowinset by\pgf@yc%
996 % The following are needed in the code:
997 \pgfarrowssavethe\pgfutil@tempdima
998 \pgfarrowssavethe\pgfutil@tempdimb
999 \pgfarrowssavethe\pgfarrowlinewidth
1000 \pgfarrowssavethe\pgf@ya
1001 \pgfarrowssavethe\pgfarrowinset
1002 },
1003 drawing code = {
1004 \pgfsetdash{}{+0pt}
1005 \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi
1006 \ifdim\pgfarrowlinewidth=\pgflinewidth\else\pgfsetlinewidth{+\pgfarrowlinewidth}\fi
1007 \pgfpathmoveto{\pgfqpoint{\pgfutil@tempdima\advance\pgf@x by\pgf@ya}{0pt}}
1008 \pgfpathlineto{\pgfqpoint{\pgf@ya}{\pgfutil@tempdimb}}
1009 \pgfpathlineto{\pgfqpoint{\pgfarrowinset}{0pt}}
1010 \ifpgfarrowharpoon \else
1011 \pgfpathlineto{\pgfqpoint{\pgf@ya}{-\pgfutil@tempdimb}}
1012 \fi
1013 \pgfpathclose
1014 \ifpgfarrowopen\pgfusepathqstroke\else\ifdim\pgfarrowlinewidth>0pt\pgfusepathqfillstroke\else\pgfusepathqfill\fi\fi
1015 },
1016 parameters = {
1017 \the\pgfarrowlinewidth,%
1018 \the\pgfarrowlength,%
1019 \the\pgfarrowwidth,%
1020 \the\pgfarrowinset,%
1021 \ifpgfarrowharpoon h\fi%
1022 \ifpgfarrowopen o\fi%
1023 \ifpgfarrowroundjoin j\fi%
1024 },
1025 }%
1026
1027
1028
1029 % A Kite is like a Stealth, only the inset counts in the other direction
1030
1031 \pgfdeclarearrow{
1032 name = Kite,
1033 defaults = {
1034 length = +3.6pt +5.4,
1035 width' = +0pt +0.5,
1036 inset' = +0pt 0.25,
1037 line width = +0pt 1 1,
1038 },
1039 setup code = {
1040 % Cap the line width at 1/4th of the length
1041 \[email protected]\pgfarrowlength
1042 \ifdim\pgf@x<\pgfarrowlinewidth
1043 \pgfarrowlinewidth\pgf@x
1044 \fi
1045 \[email protected]\pgfarrowwidth
1046 \ifdim\pgf@x<\pgfarrowlinewidth
1047 \pgfarrowlinewidth\pgf@x
1048 \fi
1049 % Compute front miter length:
1050 \pgf@xa\pgfarrowlength%
1051 \advance\pgf@xa by-\pgfarrowinset%
1052 \pgfmathdivide@{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgfarrowwidth}%
1053 \let\pgf@temp@quot\pgfmathresult%
1054 \pgf@x\pgfmathresult pt%
1055 \pgf@x\pgfmathresult\pgf@x%
1056 \pgf@x4\pgf@x%
1057 \advance\pgf@x by1pt%
1058 \pgfmathsqrt@{\pgf@sys@tonumber\pgf@x}%
1059 \pgf@xc\pgfmathresult\pgfarrowlinewidth% xc is front miter
1060 \[email protected]\pgf@xc
1061 \pgf@xa\pgf@temp@quot\pgfarrowlinewidth% xa is extra harpoon miter
1062 % Compute back miter length:
1063 \pgfmathdivide@{\pgf@sys@tonumber\pgfarrowinset}{\pgf@sys@tonumber\pgfarrowwidth}%
1064 \let\pgf@temp@quot\pgfmathresult%
1065 \pgf@x\pgfmathresult pt%
1066 \pgf@x\pgfmathresult\pgf@x%
1067 \pgf@x4\pgf@x%
1068 \advance\pgf@x by1pt%
1069 \pgfmathsqrt@{\pgf@sys@tonumber\pgf@x}%
1070 \pgf@yc\pgfmathresult\pgfarrowlinewidth% yc is back miter
1071 \[email protected]\pgf@yc
1072 \pgf@ya\pgf@temp@quot\pgfarrowlinewidth% ya is extra harpoon miter
1073 % Compute top miter length:
1074 {%
1075 \[email protected]\pgfarrowwidth%
1076 \pgfutil@tempdima\pgfarrowlength\advance\pgfutil@tempdima by-\pgfarrowinset%
1077 \csname pgfmathatan2@\endcsname{\pgfmath@tonumber\pgfutil@tempdima}{\pgfmath@tonumber\pgfutil@tempdimb}%
1078 \pgf@yb\pgfmathresult pt%
1079 \csname pgfmathatan2@\endcsname{\pgfmath@tonumber\pgfarrowinset}{\pgfmath@tonumber\pgfutil@tempdimb}%
1080 \pgf@ya\pgfmathresult pt%
1081 \advance\pgf@yb by\pgf@ya%
1082 \[email protected]\pgf@yb% half angle in yb
1083 \ifdim\pgf@yb=45pt%
1084 \def\pgfmathresult{1.414213}%
1085 \else%
1086 \pgfmathsin@{\pgf@sys@tonumber\pgf@yb}%
1087 \pgfmathreciprocal@{\pgfmathresult}%
1088 \fi%
1089 \pgf@yc\pgfmathresult\pgfarrowlinewidth%
1090 \[email protected]\pgf@yc%
1091 \pgf@ya-\pgf@ya%
1092 \advance\pgf@ya by-90pt%
1093 \advance\pgf@ya by\pgf@yb%
1094 \pgfmathsincos@{\pgf@sys@tonumber\pgf@ya}%
1095 \pgf@xb\pgfmathresultx\pgf@yc% ya is the back miter
1096 \pgf@yb\pgfmathresulty\pgf@yc% yb is the top miter
1097 \expandafter\expandafter\expandafter%
1098 }\expandafter\expandafter\expandafter\pgf@xb\expandafter\the\expandafter\pgf@xb\expandafter\pgf@yb\the\pgf@yb%
1099 % Inner length (pgfutil@tempdima) is now arrowlength - front miter - back miter
1100 \pgfutil@tempdima\pgfarrowlength%
1101 \advance\pgfutil@tempdima by-\pgf@xc%
1102 \[email protected]\pgfarrowwidth%
1103 \advance\pgfutil@tempdimb by\pgf@yb%
1104 % Set back end
1105 \ifpgfarrowroundjoin
1106 \pgfarrowssetbackend{\pgf@ya\advance\pgf@x by-.5\pgfarrowlinewidth}
1107 \else
1108 \pgfarrowssetbackend{0pt}
1109 \fi
1110 % harpoon miter correction
1111 \ifpgfarrowreversed
1112 \pgfarrowssetlineend{\pgfutil@tempdima\advance\pgf@x by-\pgflinewidth\advance\pgf@x by\pgfarrowlinewidth}
1113 \else
1114 \pgfarrowssetlineend{\pgf@yc\advance\pgf@x by\pgflinewidth\advance\pgf@x by-\pgfarrowlinewidth}
1115 \fi
1116 \ifpgfarrowroundjoin
1117 \pgfarrowssettipend{\pgfutil@tempdima\advance\pgf@x by.5\pgfarrowlinewidth}
1118 \else
1119 \pgfarrowssettipend{\pgfarrowlength\ifpgfarrowharpoon\advance\pgf@x by\pgf@xa\fi}
1120 \fi
1121 % The hull:
1122 \pgfarrowshullpoint{\pgfarrowlength\ifpgfarrowroundjoin\else\ifpgfarrowharpoon\advance\pgf@x by\pgf@xa\fi\fi}{\ifpgfarrowharpoon-.5\pgfarrowlinewidth\else0pt\fi}%
1123 \pgfarrowsupperhullpoint{\pgfarrowinset}{.5\pgfarrowwidth}%
1124 \pgfarrowshullpoint{0pt}{\ifpgfarrowharpoon-.5\pgfarrowlinewidth\else0pt\fi}%
1125 % Adjust the inset:
1126 \advance\pgfarrowinset by\pgf@xb%
1127 % The following are needed in the code:
1128 \pgfarrowssavethe\pgfutil@tempdima
1129 \pgfarrowssavethe\pgfutil@tempdimb
1130 \pgfarrowssavethe\pgfarrowlinewidth
1131 \pgfarrowssavethe\pgf@yc
1132 \pgfarrowssavethe\pgfarrowinset
1133 },
1134 drawing code = {
1135 \pgfsetdash{}{+0pt}
1136 \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi
1137 \ifdim\pgfarrowlinewidth=\pgflinewidth\else\pgfsetlinewidth{\pgfarrowlinewidth}\fi
1138 \pgfpathmoveto{\pgfqpoint{\pgfutil@tempdima}{0pt}}
1139 \pgfpathlineto{\pgfqpoint{\pgfarrowinset}{\pgfutil@tempdimb}}
1140 \pgfpathlineto{\pgfqpoint{\pgf@yc}{0pt}}
1141 \ifpgfarrowharpoon \else
1142 \pgfpathlineto{\pgfqpoint{\pgfarrowinset}{-\pgfutil@tempdimb}}
1143 \fi
1144 \pgfpathclose
1145 \ifpgfarrowopen\pgfusepathqstroke\else\ifdim\pgfarrowlinewidth>0pt\pgfusepathqfillstroke\else\pgfusepathqfill\fi\fi
1146 },
1147 parameters = {
1148 \the\pgfarrowlinewidth,%
1149 \the\pgfarrowlength,%
1150 \the\pgfarrowwidth,%
1151 \the\pgfarrowinset,%
1152 \ifpgfarrowharpoon h\fi%
1153 \ifpgfarrowopen o\fi%
1154 \ifpgfarrowroundjoin j\fi%
1155 },
1156 }%
1157
1158
1159
1160
1161 % A simple rectangle shape
1162
1163 \pgfdeclarearrow{
1164 name = Square,
1165 defaults = {
1166 length = +2.12132pt +2.828427,
1167 width' = +0pt +1,
1168 line width = +0pt +1 +1,
1169 },
1170 setup code = {
1171 % Cap the line width at 1/2th of the length
1172 \[email protected]\pgfarrowlength
1173 \ifdim\pgf@x<\pgfarrowlinewidth
1174 \pgfarrowlinewidth\pgf@x
1175 \fi
1176 \ifpgfarrowreversed
1177 \pgfarrowssetlineend{\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth}
1178 \else
1179 \pgfarrowssetlineend{.5\pgfarrowlinewidth}
1180 \fi
1181 \pgfarrowssettipend{\pgfarrowlength}
1182 % The hull:
1183 \pgfarrowshullpoint{\pgfarrowlength}{.5\pgfarrowwidth}
1184 \pgfarrowshullpoint{0pt}{.5\pgfarrowwidth}
1185 \pgfarrowshullpoint{\pgfarrowlength}{\ifpgfarrowharpoon-.5\pgfarrowlinewidth\else-.5\pgfarrowwidth\fi}
1186 \pgfarrowshullpoint{0pt}{\ifpgfarrowharpoon-.5\pgfarrowlinewidth\else-.5\pgfarrowwidth\fi}
1187 % The following are needed in the code:
1188 \pgfarrowssavethe\pgfarrowlinewidth
1189 \pgfarrowssavethe\pgfarrowlength
1190 \pgfarrowssavethe\pgfarrowwidth
1191 },
1192 drawing code = {
1193 \pgfsetdash{}{+0pt}
1194 \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi
1195 \ifdim\pgfarrowlinewidth=\pgflinewidth\else\pgfsetlinewidth{+\pgfarrowlinewidth}\fi
1196 \pgfpathmoveto{\pgfqpoint{\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth}{.5\pgfarrowwidth\advance\pgf@y by-.5\pgfarrowlinewidth}}
1197 \pgfpathlineto{\pgfqpoint{.5\pgfarrowlinewidth}{.5\pgfarrowwidth\advance\pgf@y by-.5\pgfarrowlinewidth}}
1198 \pgfpathlineto{\pgfqpoint{.5\pgfarrowlinewidth}{\ifpgfarrowharpoon0pt\else-.5\pgfarrowwidth\advance\pgf@y by.5\pgfarrowlinewidth\fi}}
1199 \pgfpathlineto{\pgfqpoint{\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth}{\ifpgfarrowharpoon0pt\else-.5\pgfarrowwidth\advance\pgf@y by.5\pgfarrowlinewidth\fi}}
1200 \pgfpathclose
1201 \ifpgfarrowopen\pgfusepathqstroke\else\ifdim\pgfarrowlinewidth>0pt\pgfusepathqfillstroke\else\pgfusepathqfill\fi\fi
1202 },
1203 parameters = {
1204 \the\pgfarrowlinewidth,%
1205 \the\pgfarrowlength,%
1206 \the\pgfarrowwidth,%
1207 \ifpgfarrowharpoon h\fi%
1208 \ifpgfarrowopen o\fi%
1209 \ifpgfarrowroundjoin j\fi%
1210 },
1211 }%
1212
1213
1214 % A simple rectangle shape
1215
1216 \pgfdeclarearrow{
1217 name = Circle,
1218 defaults = {
1219 length = +2.39365pt +3.191538,
1220 width' = +0pt 1,
1221 line width = +0pt 1 1,
1222 },
1223 setup code = {
1224 % Cap the line width at 1/2th of the length
1225 \[email protected]\pgfarrowlength
1226 \ifdim\pgf@x<\pgfarrowlinewidth
1227 \pgfarrowlinewidth\pgf@x
1228 \fi
1229 \ifpgfarrowreversed
1230 \pgfarrowssetlineend{\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth}
1231 \else
1232 \pgfarrowssetlineend{.5\pgfarrowlinewidth}
1233 \fi
1234 \pgfarrowssettipend{\pgfarrowlength}
1235 % The hull:
1236 \pgfarrowsupperhullpoint{\pgfarrowlength}{.25\pgfarrowwidth}
1237 \pgfarrowsupperhullpoint{.75\pgfarrowlength}{.5\pgfarrowwidth}
1238 \pgfarrowsupperhullpoint{.25\pgfarrowlength}{.5\pgfarrowwidth}
1239 \pgfarrowsupperhullpoint{0pt}{.25\pgfarrowwidth}
1240 \ifpgfarrowharpoon%
1241 \pgfarrowshullpoint{0pt}{-.5\pgfarrowlinewidth}
1242 \pgfarrowshullpoint{\pgfarrowlength}{-.5\pgfarrowlinewidth}
1243 \fi%
1244 % The following are needed in the code:
1245 \pgfarrowssavethe\pgfarrowlinewidth
1246 \pgfarrowssavethe\pgfarrowlength
1247 \pgfarrowssavethe\pgfarrowwidth
1248 },
1249 drawing code = {
1250 \pgfsetdash{}{+0pt}
1251 \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi
1252 \ifdim\pgfarrowlinewidth=\pgflinewidth\else\pgfsetlinewidth{+\pgfarrowlinewidth}\fi
1253 \ifpgfarrowharpoon
1254 \pgfpathmoveto{\pgfqpoint{\pgfarrowlength\advance\pgf@x
1255 by-.5\pgfarrowlinewidth}{0pt}}
1256 {%
1257 \[email protected]\pgfarrowlength
1258 \advance\pgf@xa by-.5\pgfarrowlinewidth
1259 \pgftransformxscale{+\the\pgf@xa}
1260 \[email protected]\pgfarrowwidth
1261 \advance\pgf@xa by-.5\pgfarrowlinewidth
1262 \pgftransformyscale{+\the\pgf@xa}
1263 \pgfpatharc{0}{180}{1pt}
1264 }
1265 \pgfpathclose
1266 \else%
1267 \pgfpathellipse{\pgfqpoint{.5\pgfarrowlength}{0pt}}{\pgfqpoint{.5\pgfarrowlength\advance\pgf@x
1268 by-.5\pgfarrowlinewidth}{0pt}}{\pgfqpoint{0pt}{.5\pgfarrowwidth\advance\pgf@y
1269 by-.5\pgfarrowlinewidth}}
1270 \fi
1271 \ifpgfarrowopen\pgfusepathqstroke\else\ifdim\pgfarrowlinewidth>0pt\pgfusepathqfillstroke\else\pgfusepathqfill\fi\fi
1272 },
1273 parameters = {
1274 \the\pgfarrowlinewidth,%
1275 \the\pgfarrowlength,%
1276 \the\pgfarrowwidth,%
1277 \ifpgfarrowharpoon h\fi%
1278 \ifpgfarrowopen o\fi%
1279 \ifpgfarrowroundjoin j\fi%
1280 },
1281 }%
1282
1283 % Round cap
1284
1285 \pgfdeclarearrow{
1286 name = Round Cap,
1287 defaults = {
1288 length = +0pt .5
1289 },
1290 setup code = {
1291 \ifpgfarrowreversed
1292 \pgfarrowssettipend{\pgfarrowlength}
1293 \pgfarrowssetlineend{\pgfarrowlength\advance\pgf@x by.5\pgflinewidth}
1294 \else
1295 \pgfarrowssettipend{\pgfarrowlength}
1296 \pgfarrowssetlineend{-.5\pgflinewidth}
1297 \fi
1298 \pgfarrowssavethe\pgfarrowlength
1299 \pgfarrowsupperhullpoint{0pt}{.5\pgflinewidth}
1300 \pgfarrowsupperhullpoint{\pgfarrowlength}{.5\pgflinewidth}
1301 },
1302 drawing code = {
1303 \ifpgfarrowreversed
1304 \pgftransformxscale{-1}
1305 \pgftransformxshift{-\pgfarrowlength}
1306 \fi
1307 \[email protected]\pgflinewidth
1308 \pgfpathmoveto {\pgfqpoint{-0.75\pgflinewidth}{\pgfutil@tempdima}}
1309 \pgfpathlineto {\pgfqpoint{0pt}{\pgfutil@tempdima}}
1310 \ifpgfarrowreversed
1311 \pgfpathlineto {\pgfqpoint{\pgfarrowlength}{\pgfutil@tempdima}}
1312 \begingroup
1313 \pgftransformxshift{\pgfarrowlength}
1314 \pgftransformxscale{-1}
1315 \fi
1316 \pgfpathcurveto {\pgfqpoint{0.55228475\pgfarrowlength}{\pgfutil@tempdima}}
1317 {\pgfqpoint{\pgfarrowlength}{0.55228475\pgfutil@tempdima}}
1318 {\pgfqpoint{\pgfarrowlength}{0pt}}
1319 \pgfpathcurveto {\pgfqpoint{\pgfarrowlength}{-0.55228475\pgfutil@tempdima}}
1320 {\pgfqpoint{0.55228475\pgfarrowlength}{-\pgfutil@tempdima}}
1321 {\pgfqpoint{0pt}{-\pgfutil@tempdima}}
1322 \ifpgfarrowreversed
1323 \endgroup
1324 \fi
1325 \pgfpathlineto {\pgfqpoint{-.75\pgflinewidth}{-\pgfutil@tempdima}}
1326 \pgfpathclose
1327 \pgfusepathqfill
1328 },
1329 parameters = {\the\pgfarrowlength}
1330 }%
1331
1332
1333
1334 \pgfdeclarearrow{
1335 name = Butt Cap,
1336 defaults = {
1337 length = +0pt .5
1338 },
1339 setup code = {
1340 \pgfarrowssettipend{\pgfarrowlength}
1341 \pgfarrowssetlineend{-.5\pgflinewidth}
1342 \pgfarrowssavethe\pgfarrowlength
1343 \pgfarrowsupperhullpoint{0pt}{.5\pgflinewidth}
1344 \pgfarrowsupperhullpoint{\pgfarrowlength}{.5\pgflinewidth}
1345 },
1346 drawing code = {
1347 \[email protected]\pgflinewidth
1348 \pgfpathmoveto {\pgfqpoint{-0.75\pgflinewidth}{\pgfutil@tempdima}}
1349 \pgfpathlineto {\pgfqpoint{0pt}{\pgfutil@tempdima}}
1350 \pgfpathlineto {\pgfqpoint{\pgfarrowlength}{\pgfutil@tempdima}}
1351 \pgfpathlineto {\pgfqpoint{\pgfarrowlength}{-\pgfutil@tempdima}}
1352 \pgfpathlineto {\pgfqpoint{-.75\pgflinewidth}{-\pgfutil@tempdima}}
1353 \pgfpathclose
1354 \pgfusepathqfill
1355 },
1356 parameters = {\the\pgfarrowlength}
1357 }%
1358
1359
1360
1361 \pgfkeys{
1362 /pgf/arrow keys/.cd,
1363 cap angle/.code={%
1364 \pgfmathsetlength\pgf@x{#1}%
1365 \[email protected]\pgf@x
1366 \pgfmathtan@{\pgf@sys@tonumber\pgf@x}%
1367 \pgfmathreciprocal@{\pgfmathresult}%
1368 \pgf@x\pgfmathresult pt%
1369 \[email protected]\pgf@x%
1370 \edef\pgf@marshal{\noexpand\pgfarrowsaddtooptions{\noexpand\pgfarrowslinewidthdependent{+0pt}{\pgf@sys@tonumber\pgf@x}{0}\pgfarrowlength\pgf@x}}
1371 \pgf@marshal
1372 }
1373 }%
1374
1375
1376 \pgfdeclarearrow{
1377 name = Triangle Cap,
1378 defaults = {
1379 length = +0pt .5
1380 },
1381 setup code = {
1382 \ifpgfarrowreversed
1383 \pgfarrowssettipend{\pgfarrowlength}
1384 \pgfarrowssetlineend{\pgfarrowlength\advance\pgf@x by.5\pgflinewidth}
1385 \else
1386 \pgfarrowssettipend{\pgfarrowlength}
1387 \pgfarrowssetlineend{-.5\pgflinewidth}
1388 \fi
1389 \pgfarrowssavethe\pgfarrowlength
1390 \pgfarrowsupperhullpoint{0pt}{.5\pgflinewidth}
1391 \pgfarrowshullpoint{\pgfarrowlength}{0pt}
1392 },
1393 drawing code = {
1394 \ifpgfarrowreversed
1395 \pgftransformxscale{-1}
1396 \pgftransformxshift{-\pgfarrowlength}
1397 \fi
1398 \[email protected]\pgflinewidth
1399 \pgfpathmoveto {\pgfqpoint{-0.75\pgflinewidth}{\pgfutil@tempdima}}
1400 \pgfpathlineto {\pgfqpoint{0pt}{\pgfutil@tempdima}}
1401 \ifpgfarrowreversed
1402 \pgfpathlineto {\pgfqpoint{\pgfarrowlength}{\pgfutil@tempdima}}
1403 \begingroup
1404 \pgftransformxshift{\pgfarrowlength}
1405 \pgftransformxscale{-1}
1406 \fi
1407 \pgfpathlineto {\pgfqpoint{\pgfarrowlength}{0pt}}
1408 \ifpgfarrowreversed
1409 \endgroup
1410 \pgfpathlineto {\pgfqpoint{\pgfarrowlength}{-\pgfutil@tempdima}}
1411 \fi
1412 \pgfpathlineto {\pgfqpoint{0pt}{-\pgfutil@tempdima}}
1413 \pgfpathlineto {\pgfqpoint{-.75\pgflinewidth}{-\pgfutil@tempdima}}
1414 \pgfpathclose
1415 \pgfusepathqfill
1416 },
1417 parameters = {\the\pgfarrowlength}
1418 }%
1419
1420
1421
1422 \pgfdeclarearrow{
1423 name = Fast Triangle,
1424 defaults = {
1425 length = +0pt .5,
1426 inset = +0pt .5,
1427 },
1428 setup code = {
1429 \pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by\pgfarrowinset}
1430 \ifpgfarrowreversed\pgfarrowssetlineend{\pgfarrowlength\advance\pgf@x by\pgfarrowinset}\fi
1431 \pgfarrowssavethe\pgfarrowlength
1432 \pgfarrowssavethe\pgfarrowinset
1433 \pgfarrowsupperhullpoint{0pt}{.5\pgflinewidth}
1434 \pgfarrowsupperhullpoint{\pgfarrowinset}{.5\pgflinewidth}
1435 \pgfarrowshullpoint{\pgfarrowlength\advance\pgf@x by\pgfarrowinset}{0pt}
1436 },
1437 drawing code = {
1438 \[email protected]\pgflinewidth
1439 \pgfpathmoveto {\pgfqpoint{0pt}{\pgfutil@tempdima}}
1440 \pgfpathlineto {\pgfqpoint{\pgfarrowinset}{\pgfutil@tempdima}}
1441 \pgfpathlineto {\pgfqpoint{\pgfarrowinset\advance\pgf@x by\pgfarrowlength}{0pt}}
1442 \pgfpathlineto {\pgfqpoint{\pgfarrowinset}{-\pgfutil@tempdima}}
1443 \pgfpathlineto {\pgfqpoint{0pt}{-\pgfutil@tempdima}}
1444 \pgfpathlineto {\pgfqpoint{\pgfarrowlength}{0pt}}
1445 \pgfpathclose
1446 \pgfusepathqfill
1447 },
1448 parameters = {\the\pgfarrowlength,\the\pgfarrowinset}
1449 }%
1450
1451
1452 \pgfdeclarearrow{
1453 name = Fast Round,
1454 defaults = {
1455 length = +0pt .5,
1456 inset = +0pt .5,
1457 },
1458 setup code = {
1459 \pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by\pgfarrowinset}
1460 \ifpgfarrowreversed\pgfarrowssetlineend{\pgfarrowlength\advance\pgf@x by\pgfarrowinset}\fi
1461 \pgfarrowssavethe\pgfarrowlength
1462 \pgfarrowssavethe\pgfarrowinset
1463 \pgfarrowsupperhullpoint{0pt}{.5\pgflinewidth}
1464 \pgfarrowsupperhullpoint{\pgfarrowlength\advance\pgf@x by\pgfarrowinset}{.5\pgflinewidth}
1465 },
1466 drawing code = {
1467 \[email protected]\pgflinewidth
1468 \pgfpathmoveto {\pgfqpoint{0pt}{\pgfutil@tempdima}}
1469 \pgfpathlineto {\pgfqpoint{\pgfarrowinset}{\pgfutil@tempdima}}
1470 {
1471 \pgftransformxshift{\pgfarrowinset}
1472 \pgfpathcurveto{\pgfqpoint{0.55228475\pgfarrowlength}{\pgfutil@tempdima}}
1473 {\pgfqpoint{\pgfarrowlength}{0.55228475\pgfutil@tempdima}}
1474 {\pgfqpoint{\pgfarrowlength}{0pt}}
1475 \pgfpathcurveto{\pgfqpoint{\pgfarrowlength}{-0.55228475\pgfutil@tempdima}}
1476 {\pgfqpoint{0.55228475\pgfarrowlength}{-\pgfutil@tempdima}}
1477 {\pgfqpoint{0pt}{-\pgfutil@tempdima}}
1478 }
1479 \pgfpathlineto {\pgfqpoint{0pt}{-\pgfutil@tempdima}}
1480 \pgfpathcurveto {\pgfqpoint{0.55228475\pgfarrowlength}{-\pgfutil@tempdima}}
1481 {\pgfqpoint{\pgfarrowlength}{-0.55228475\pgfutil@tempdima}}
1482 {\pgfqpoint{\pgfarrowlength}{0pt}}
1483 \pgfpathcurveto {\pgfqpoint{\pgfarrowlength}{0.55228475\pgfutil@tempdima}}
1484 {\pgfqpoint{0.55228475\pgfarrowlength}{\pgfutil@tempdima}}
1485 {\pgfqpoint{0pt}{\pgfutil@tempdima}}
1486 \pgfpathclose
1487 \pgfusepathqfill
1488 },
1489 parameters = {\the\pgfarrowlength,\the\pgfarrowinset}
1490 }%
1491
1492
1493
1494
1495 %
1496 %
1497 % Other arrow tips.
1498 %
1499 %
1500
1501
1502 \pgfkeys{
1503 /pgf/arrow keys/.cd,
1504 n/.code={%
1505 \pgfmathparse{#1}%
1506 \expandafter\pgf@lib@meta@strip@dot\pgfmathresult.\relax%
1507 }
1508 }%
1509 \def\pgf@lib@meta@strip@dot#1.#2\relax{%
1510 \pgfarrowsaddtooptions{\def\pgfarrown{#1}}%
1511 }%
1512
1513 \def\pgfarrown{4}%
1514
1515 \pgfdeclarearrow{
1516 name = Rays,
1517 defaults = {
1518 length = +3pt 4,
1519 width' = +0pt 1,
1520 line width = +0pt 1 1,
1521 },
1522 setup code = {
1523 \pgfmathdivide@{360}{\pgfarrown}%
1524 \let\pgfarrow@inc\pgfmathresult%
1525 % Compute tips:
1526 \pgf@xa\pgfarrow@inc pt%
1527 \ifodd\pgfarrown\[email protected]\pgf@xa\else\[email protected]\pgf@xa\fi%
1528 \pgfmathsincos@{\pgf@sys@tonumber\pgf@ya}%
1529 \[email protected]\pgfarrowlength%
1530 \pgf@xa\pgfmathresultx\pgf@x%
1531 \ifpgfarrowroundcap
1532 \advance\pgf@xa by.5\pgfarrowlinewidth
1533 \else
1534 \pgf@process{\pgfpointnormalised{\pgfqpoint{\pgfmathresultx\pgfarrowlength}{\pgfmathresulty\pgfarrowwidth}}}%
1535 \[email protected]\pgfarrowlinewidth%
1536 \advance\pgf@xa by\pgf@sys@tonumber{\pgf@y}\pgf@x%
1537 \fi%
1538 \pgfarrowssettipend{\pgf@xa}
1539 \pgfarrowssetbackend{-\pgf@xa}
1540 % Hull is always 8-point hull, except for tip
1541 % The following are needed in the code:
1542 \pgfarrowsupperhullpoint{\pgf@xa}{.25\pgfarrowwidth}
1543 \pgfarrowsupperhullpoint{.25\pgfarrowlength}{.5\pgfarrowwidth\ifpgfarrowroundcap\advance\pgf@y by.5\pgfarrowlinewidth\fi}
1544 \pgfarrowsupperhullpoint{-.25\pgfarrowlength}{.5\pgfarrowwidth\ifpgfarrowroundcap\advance\pgf@y by.5\pgfarrowlinewidth\fi}
1545 \pgfarrowsupperhullpoint{-\pgf@xa}{.25\pgfarrowwidth}
1546 \ifpgfarrowharpoon
1547 \pgfarrowshullpoint{-.5\pgfarrowlength\ifpgfarrowroundcap\advance\pgf@x by-.5\pgfarrowlinewidth\fi}{-.5\pgfarrowlinewidth}
1548 \pgfarrowshullpoint{.5\pgfarrowlength\ifpgfarrowroundcap\advance\pgf@x by.5\pgfarrowlinewidth\fi}{-.5\pgfarrowlinewidth}
1549 \fi
1550 \pgfarrowssavethe\pgfarrowlinewidth
1551 \pgfarrowssavethe\pgfarrowlength
1552 \pgfarrowssavethe\pgfarrowwidth
1553 \pgfarrowssave\pgfarrow@inc
1554 \pgfarrowssave\pgfarrown
1555 },
1556 drawing code = {
1557 \pgfsetdash{}{+0pt}
1558 \ifpgfarrowroundcap\pgfsetroundcap\else\pgfsetbuttcap\fi
1559 \ifdim\pgfarrowlinewidth=\pgflinewidth\else\pgfsetlinewidth{+\pgfarrowlinewidth}\fi
1560 {%
1561 \pgfgettransform\pgf@temp@trans
1562 \pgftransformxscale{+.5\pgfarrowlength}
1563 \pgftransformyscale{+.5\pgfarrowwidth}
1564 \pgf@xa\pgfarrow@inc pt%
1565 \ifodd\pgfarrown\[email protected]\pgf@xa\else\[email protected]\pgf@xa\fi%
1566 \ifpgfarrowharpoon\pgf@yb180pt\else\pgf@yb360pt\fi
1567 \pgfutil@loop%
1568 \ifdim\pgf@ya<\pgf@yb%
1569 \pgfpathmoveto{\pgfpointpolar{+\pgf@ya}{+1pt}}
1570 \pgfpathlineto{\pgfpointorigin}
1571 \ifpgfarrowharpoon\ifdim\pgf@ya>\pgf@xa\else{\pgfsettransform\pgf@temp@trans\pgfpathlineto{\pgfqpoint{-.5\pgflinewidth}{0pt}}}\fi\fi
1572 \advance\pgf@ya by\pgf@xa\relax%
1573 \pgfutil@repeat%
1574 }
1575 \pgfusepathqstroke
1576 },
1577 parameters = {
1578 \the\pgfarrowlinewidth,%
1579 \the\pgfarrowlength,%
1580 \the\pgfarrowwidth,%
1581 \pgfarrown,%
1582 \ifpgfarrowharpoon h\fi%
1583 \ifpgfarrowroundcap c\fi%
1584 }
1585 }%
1586
1587
1588
1589 % Shorthands and Aliases:
1590
1591 \pgfkeys{
1592 LaTeX /.tip = {Latex},
1593 Triangle /.tip = {Stealth[inset=+0pt, angle=+60:+2.7pt +3.6]},
1594 Rectangle /.tip = {Square[length=+3pt +4.5,width'=+0pt +.5]},
1595 Ellipse /.tip = {Circle[length=+3.3pt +4.95, width'=+0pt +0.5]},
1596 Diamond /.tip = {Kite[inset'=+0pt .5]},
1597 Turned Square /.tip = {Kite[length=+3pt 4,width'= +0pt 1,inset'= +0pt 0.5]},
1598 To /.tip = {Computer Modern Rightarrow},
1599 Bar /.tip = {Tee Barb[length=+0pt]},
1600 Bracket /.tip = {Tee Barb[inset'=+0pt +1,length=+0.75pt +1]},
1601 Parenthesis /.tip = {Arc Barb[arc=+120,length=+1.725pt +2.3]}
1602 }%
1603
1604
1605
1606
1607 \endinput