summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/tex/pgfcorepathconstruct.code.tex
blob: cafc532938143d4e4a352e7540c6cff2a02f42af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
% Copyright 2019 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.

\ProvidesFileRCS{pgfcorepathconstruct.code.tex}


\newdimen\pgf@path@lastx
\newdimen\pgf@path@lasty

\let\pgfgetpath=\pgfsyssoftpath@getcurrentpath
\let\pgfsetpath=\pgfsyssoftpath@setcurrentpath



% Replace corners by arcs.
%
% #1 = in-size of arc
% #2 = out-size of arc
%
% Description:
%
% This command influences path construction command like
% \pgfpathlineto or \pgfpatharc. It will cause the corners at the end
% of these commands to be replaced by little arcs. If the
% corner is a 90 degrees corner and if #1=#2, a quarter-circle of
% radius #1 is put in place of the corner. If #1 and #2 are different,
% the quarter circle will instead by a quarter ellipse. If the angle
% is different from 90 degrees, a deformed quarter circle will
% result, which may or may not be desirable. For a ``perfect'' arc you
% must use the \pgfpatharc command.
%
%
% Example: One rounded corner.
%
% \pgfpathmoveto{\pgfpointxy{0}{0}}
% \pgfsetcornersarced{4pt}{4pt}
% \pgfpathlineto{\pgfpointxy{0}{1}}
% \pgfpathlineto{\pgfpointxy{1}{1}}
% \pgfstroke
%
% Example: A rounded rectangle
%
% \pgfsetcornersarced{4pt}{4pt}
% \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}
% \pgfstroke
%
% Example: A rounded triangles
%
% \pgfsetcornersarced{4pt}{4pt}
% \pgfpathmoveto{\pgfpointorigin}
% \pgfpathlineto{\pgfpoint{1cm}{0cm}}
% \pgfpathlineto{\pgfpoint{1cm}{1cm}}
% \pgfpathclose
% \pgfstroke

\newif\ifpgf@arccorners

\def\pgfsetcornersarced#1{%
  \pgf@process{#1}%
  \edef\pgf@corner@arc{{\the\pgf@x}{\the\pgf@y}}%
  \pgf@arccornerstrue%
  \ifdim\pgf@x=0pt%
    \ifdim\pgf@y=0pt\relax%
      \pgf@arccornersfalse%
    \fi%
  \fi%
}

\def\pgf@roundcornerifneeded{%
  \ifpgf@arccorners\expandafter\pgfsyssoftpath@specialround\pgf@corner@arc\fi%
}



% The following protocol the passed sizes and all the corresponding
% softpath commands. The nonlinear transformation (nlt) module
% overwrites these commands.

\def\pgf@lt@moveto#1#2{%
  \pgf@protocolsizes{#1}{#2}%
  \pgfsyssoftpath@moveto{\the#1}{\the#2}%
}
\def\pgf@lt@lineto#1#2{%
  \pgf@protocolsizes{#1}{#2}%
  \pgfsyssoftpath@lineto{\the#1}{\the#2}%
}
\def\pgf@lt@curveto#1#2#3#4#5#6{%
  \pgf@protocolsizes{#1}{#2}%
  \pgf@protocolsizes{#3}{#4}%
  \pgf@protocolsizes{#5}{#6}%
  \pgfsyssoftpath@curveto{\the#1}{\the#2}{\the#3}{\the#4}{\the#5}{\the#6}%
}

\let\pgf@lt@closepath\pgfsyssoftpath@closepath

\let\pgf@nlt@moveto\pgf@lt@moveto
\let\pgf@nlt@lineto\pgf@lt@lineto
\let\pgf@nlt@curveto\pgf@lt@curveto
\let\pgf@nlt@closepath\pgf@lt@closepath

\let\pgf@nlt@list\pgfutil@empty % If non-empty, the nlt module is active


% Move current point to #1.
%
% #1 = new current point
%
% Example:
%
% \pgfpathmoveto{\pgfxy(0,0)}
% \pgfpathlineto{\pgfxy(0,1)}
% \pgfstroke

\def\pgfpathmoveto#1{%
  \pgfpointtransformed{#1}%
  \pgf@nlt@moveto{\pgf@x}{\pgf@y}%
  \global\pgf@path@lastx=\pgf@x%
  \global\pgf@path@lasty=\pgf@y%
}

\def\pgf@protocolsizes#1#2{%
  \ifpgf@relevantforpicturesize%
    \ifdim#1<\pgf@picminx\global\pgf@picminx#1\fi%
    \ifdim#1>\pgf@picmaxx\global\pgf@picmaxx#1\fi%
    \ifdim#2<\pgf@picminy\global\pgf@picminy#2\fi%
    \ifdim#2>\pgf@picmaxy\global\pgf@picmaxy#2\fi%
    \ifpgf@size@hooked%
      \let\pgf@size@hook@x#1\let\pgf@size@hook@y#2\pgf@path@size@hook%
    \fi%
  \fi%
  \ifdim#1<\pgf@pathminx\global\pgf@pathminx#1\fi%
  \ifdim#1>\pgf@pathmaxx\global\pgf@pathmaxx#1\fi%
  \ifdim#2<\pgf@pathminy\global\pgf@pathminy#2\fi%
  \ifdim#2>\pgf@pathmaxy\global\pgf@pathmaxy#2\fi%
}
\newif\ifpgf@size@hooked
\let\pgf@path@size@hook=\pgfutil@empty%

\def\pgf@resetpathsizes{%
  \global\pgf@pathmaxx=-16000pt\relax%
  \global\pgf@pathminx=16000pt\relax%
  \global\pgf@pathmaxy=-16000pt\relax%
  \global\pgf@pathminy=16000pt\relax%
}

\def\pgf@getpathsizes#1{%
  \edef#1{{\the\pgf@pathmaxx}{\the\pgf@pathminx}{\the\pgf@pathmaxy}{\the\pgf@pathminy}}%
}
\def\pgf@setpathsizes#1{%
  \expandafter\pgf@@setpathsizes#1%
}
\def\pgf@@setpathsizes#1#2#3#4{%
  \global\pgf@pathmaxx=#1\relax%
  \global\pgf@pathminx=#2\relax%
  \global\pgf@pathmaxy=#3\relax%
  \global\pgf@pathminy=#4\relax%
}





% Append a line from the current point to #1 to the current path.
%
% #1 = end of line
%
% Example:
%
% \pgfpathmoveto{\pgfxy(0,0)}
% \pgfpathlineto{\pgfxy(0,1)}
% \pgfstroke

\def\pgfpathlineto#1{%
  \pgfpointtransformed{#1}%
  \pgf@roundcornerifneeded%
  \pgf@nlt@lineto{\pgf@x}{\pgf@y}%
  \global\pgf@path@lastx=\pgf@x%
  \global\pgf@path@lasty=\pgf@y%
}



% Close the current path.
%
% Example:
%
% % Draws two triangles
% \pgfpathmoveto{\pgfxy(0,0)}
% \pgfpathlineto{\pgfxy(0,1)}
% \pgfpathlineto{\pgfxy(1,0)}
% \pgfclosepath
% \pgfpathmoveto{\pgfxy(2,0)}
% \pgfpathlineto{\pgfxy(2,1)}
% \pgfpathlineto{\pgfxy(3,0)}
% \pgfpathclose
% \pgfstroke

\def\pgfpathclose{%
  \pgf@roundcornerifneeded%
  \pgf@nlt@closepath%
}


% Append a cubic bezier spline from the current point to #3 with control
% points #1 and #2 to the current path.
%
% #1 = first control point
% #2 = second control point
% #3 = end point
%
% Example:
%
% \pgfpathmoveto{\pgfpointxy{0}{0}}
% \pgfpathcurveto{\pgfpointxy{0}{1}}{\pgfpointxy{1}{1}}{\pgfpointxy{1}{2}}
% \pgfstroke

\def\pgfpathcurveto#1#2#3{%
  \pgfpointtransformed{#3}%
  \pgf@xb=\pgf@x%
  \pgf@yb=\pgf@y%
  \pgfpointtransformed{#2}%
  \pgf@xa=\pgf@x%
  \pgf@ya=\pgf@y%
  \pgfpointtransformed{#1}%
  \pgf@roundcornerifneeded%
  \pgf@nlt@curveto{\pgf@x}{\pgf@y}{\pgf@xa}{\pgf@ya}{\pgf@xb}{\pgf@yb}%
  \global\pgf@path@lastx=\pgf@xb%
  \global\pgf@path@lasty=\pgf@yb%
}



% Append a quadratic bezier spline from the current point to #2 with
% control point #1 to the current path.
%
% #1 = control point
% #2 = end point
%
% Example:
%
% \pgfpathmoveto{\pgfpointxy{0}{0}}
% \pgfpathquadraticcurveto{\pgfpointxy{1}{1}}{\pgfpointxy{2}{0}}
% \pgfstroke

\def\pgfpathquadraticcurveto#1#2{%
  \pgfpointtransformed{#2}%
  \pgf@xb=\pgf@x%
  \pgf@yb=\pgf@y%
  \pgfpointtransformed{#1}%
  \pgf@xc=.6666666\pgf@x%
  \pgf@yc=.6666666\pgf@y%
  % compute second control point:
  \pgf@xa=.33333333\pgf@xb%
  \pgf@ya=.33333333\pgf@yb%
  \advance\pgf@xa by\pgf@xc%
  \advance\pgf@ya by\pgf@yc%
  % compute first control point
  \advance\pgf@xc by.3333333\pgf@path@lastx%
  \advance\pgf@yc by.3333333\pgf@path@lasty%
  \pgf@roundcornerifneeded%
  \pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@xa}{\pgf@ya}{\pgf@xb}{\pgf@yb}%
  \global\pgf@path@lastx=\pgf@xb%
  \global\pgf@path@lasty=\pgf@yb%
}




% Append an arc to the current point, where the current point is at
% angle #1 and the end is at angle #2. If #2 > #1, the arc is drawn
% counter-clockwise, otherwise it is clockwise.
%
% #1 = angle of first point
% #2 = angle of second point
% #3 = radius or x-radius/y-radius
%
% Example:
%
% \pgfpathmoveto{\pgfxy(0,0)}
% \pgfpatharc{0}{90}{2cm}
% \pgfstroke

\def\pgfpatharc#1#2#3{%
  {%
    \pgfmathparse{#1}\let\pgf@temp@a=\pgfmathresult%
    \pgfmathparse{#2}\let\pgf@temp@b=\pgfmathresult%
    \pgfutil@in@{and }{#3}%
    \ifpgfutil@in@%
      \pgf@arc@get@radii#3\pgf@arc@stop%
    \else
      \pgf@arc@get@radii#3and #3\pgf@arc@stop%
    \fi%
    \pgf@arc@local@angle@a=\pgf@temp@a pt%
    \pgf@arc@local@angle@b=\pgf@temp@b pt%
    \loop%
      \pgfutil@tempdima=\pgf@arc@local@angle@a%
      \advance\pgfutil@tempdima by-\pgf@arc@local@angle@b\relax%
      \ifdim\pgfutil@tempdima<0pt\relax%
        \pgfutil@tempdima=-\pgfutil@tempdima\relax%
      \fi%
    \ifdim\pgfutil@tempdima>90pt\relax%
      \ifdim\pgfutil@tempdima>115pt\relax%
        \pgf@arc@temp=90pt% big skip
      \else%
        \pgf@arc@temp=60pt% smaller skip to ensure wide segments
                          % (important shortened end segments because
                          % of arrow tips)
      \fi%
      \ifdim\pgf@arc@local@angle@b>\pgf@arc@local@angle@a\relax%
        {%
          \pgf@arc@local@angle@b=\pgf@arc@local@angle@a\relax%
          \advance\pgf@arc@local@angle@b by\pgf@arc@temp\relax%
          \pgf@arc%
        }
        \advance\pgf@arc@local@angle@a by\pgf@arc@temp\relax%
      \else
        {%
          \pgf@arc@local@angle@b=\pgf@arc@local@angle@a\relax%
          \advance\pgf@arc@local@angle@b by-\pgf@arc@temp\relax%
          \pgf@arc%
        }%
        \advance\pgf@arc@local@angle@a by-\pgf@arc@temp\relax%
      \fi%
    \repeat%
    \pgf@roundcornerifneeded%
    \pgf@arc%
  }%
}
\dimendef\pgf@arc@local@angle@a=0
\dimendef\pgf@arc@local@angle@b=1
\dimendef\pgf@arc@temp=2

\def\pgf@arc@get@radii#1and #2\pgf@arc@stop{%
  \pgfmathparse{#1}\let\pgf@arc@radius@a=\pgfmathresult%
  \pgfmathparse{#2}\let\pgf@arc@radius@b=\pgfmathresult%
}


\def\pgf@arc{%
  {%
  \pgfutil@tempdima=\pgf@arc@radius@a pt%
  \pgfutil@tempdimb=\pgf@arc@radius@b pt%
  %
  \pgf@xa=\pgf@arc@local@angle@a\relax%
  \pgf@xb=\pgf@arc@local@angle@b\relax%
  \advance\pgf@xb by-\pgf@xa\relax%
  \ifdim\pgf@xb<0pt\relax%
    \pgf@xb=-\pgf@xb\relax%
  \fi%
  \ifdim\pgf@xb=90.0pt%
    \def\pgfmathresult{0.55228475}%
  \else%
    \pgfmathparse{1.333333333*tan(.25*\pgf@sys@tonumber{\pgf@xb})}% many thanks to Ken Starks
  \fi%
  \pgfutil@tempdima=\pgfmathresult\pgfutil@tempdima%
  \pgfutil@tempdimb=\pgfmathresult\pgfutil@tempdimb%
  %.. controls +(\pgf@xa+90:\pgfutil@tempdima) and +(\pgf@xb-90:\pgfutil@tempdima) .. +(-(#1:#3)+(#2:#3))%
  % store first support vector in xa/ya:
  \pgf@xa=\pgf@arc@local@angle@a\relax%
  \ifdim\pgf@arc@local@angle@b>\pgf@arc@local@angle@a\relax%
    \advance\pgf@xa by 90pt\relax%
  \else%
    \advance\pgf@xa by -90pt\relax%
  \fi%
  \edef\pgf@arc@angle{\pgf@sys@tonumber{\pgf@xa}}%
  \pgfpointtransformed{\pgfpointpolar{\pgf@arc@angle}{\pgfutil@tempdima and \pgfutil@tempdimb}}%
  \advance\pgf@x by-\pgf@pt@x%
  \advance\pgf@y by-\pgf@pt@y%
  \pgf@xa=\pgf@path@lastx%
  \pgf@ya=\pgf@path@lasty%
  \advance\pgf@xa by \pgf@x%
  \advance\pgf@ya by \pgf@y%
  % store target in xb/yb:
  \pgfpointtransformed{\pgfpointpolar{\pgf@sys@tonumber{\pgf@arc@local@angle@a}}{\pgf@arc@radius@a pt and \pgf@arc@radius@b pt}}%
  \pgf@xb=\pgf@path@lastx%
  \pgf@yb=\pgf@path@lasty%
  \advance\pgf@xb by -\pgf@x%
  \advance\pgf@yb by -\pgf@y%
  \pgfpointtransformed{\pgfpointpolar{\pgf@sys@tonumber{\pgf@arc@local@angle@b}}{\pgf@arc@radius@a pt and \pgf@arc@radius@b pt}}%
  \advance\pgf@xb by \pgf@x%
  \advance\pgf@yb by \pgf@y%
  % store second support xc/yc:
  \ifdim\pgf@arc@local@angle@b>\pgf@arc@local@angle@a\relax%
    \advance\pgf@arc@local@angle@b by -90pt\relax%
  \else%
    \advance\pgf@arc@local@angle@b by 90pt\relax%
  \fi%
  \pgfpointtransformed{\pgfpointpolar{\pgf@sys@tonumber{\pgf@arc@local@angle@b}}{\pgfutil@tempdima and \pgfutil@tempdimb}}%
  \advance\pgf@x by-\pgf@pt@x%
  \advance\pgf@y by-\pgf@pt@y%
  \pgf@xc=\pgf@xb\relax%
  \pgf@yc=\pgf@yb\relax%
  \advance \pgf@xc by \pgf@x\relax%
  \advance \pgf@yc by \pgf@y\relax%
  \pgf@nlt@curveto{\pgf@xa}{\pgf@ya}{\pgf@xc}{\pgf@yc}{\pgf@xb}{\pgf@yb}%
  \global\pgf@path@lastx=\pgf@xb%
  \global\pgf@path@lasty=\pgf@yb%
  }%
}


% Append an arc to the current point, where the arc is on an ellipse
% given by two axis vectors.
%
% #1 = angle of first point
% #2 = angle of second point
% #3 = first axis
% #4 = second axis
%
% Example:
%
% \pgfpathmoveto{\pgfxy(0,0)}
% \pgfpatharcaxes{0}{90}{\pgfpointxy{2}{0}}{\pgfpointxy{0}{2}}
% \pgfstroke

\def\pgfpatharcaxes#1#2#3#4{%
  {%
    \pgftransformtriangle{\pgfpointorigin}{#3}{#4}%
    \pgfpatharc{#1}{#2}{1pt}%
  }%
}



% Append an arc to the current point that ends at a given position.
%
% #1 = x-radius
% #2 = y-radius
% #3 = x-axis-rotation (in degrees)
% #4 = large-arc-sweep-flag (0 or 1)
% #5 = sweep-flag (0 or 1)
% #6 = target point
%
% Description:
%
% This command implements an arc drawing where a given target
% coordinate (#6) is given and the task is to draw an arc of an
% ellipse with the given radii. The center point of the ellipse is not
% give, but computed automatically.
%
% This kind of "endpoint parameterization" of an arc is exactly the
% same as the one specified by the SVG-specification for the "A" and
% "a" path commands. Please see the SVG-specification for details.
%
% Note that the problem is internally converted to drawing an arc
% using \pgfpatharc. This means that there may be a heavy loss of
% accuracy.
%
% Example:
%
% \pgfpathmoveto{\pgfpoint{1cm}{1cm}}
% \pgfpatharcto{1cm}{1cm}{0}{0}{0}{\pgfpoint{0cm}{2cm}}

\def\pgfpatharcto#1#2#3#4#5#6{%
  {%
    % The following code is based on the transformation described in svg
    % 1.1 specification Section F.6.5
    %
    % Step 1: store the simple parameters (xa=x1 since TeX does not
    % allow numbers in names)
    %
    \pgfmathsetmacro\pgf@arcto@rx{abs(#1)}%
    \pgfmathsetmacro\pgf@arcto@ry{abs(#2)}%
    \ifdim\pgf@arcto@rx pt=0pt% special rule: zero radius=straight line
      \gdef\pgf@marshal{\pgfpathlineto{#6}}%
    \else
    \ifdim\pgf@arcto@ry pt=0pt% special rule: zero radius=straight line
      \gdef\pgf@marshal{\pgfpathlineto{#6}}%
    \else
    \pgfmathsetmacro\pgf@arcto@phi{#3}%
    \pgfmathsetmacro\pgf@arcto@fA{#4}%
    \ifdim\pgf@arcto@fA pt=0pt
    \else
      \pgfmathsetmacro\pgf@arcto@fA{1.0} % Special rule: every non-zero value is 1.
    \fi
    \pgfmathsetmacro\pgf@arcto@fS{#5}%
    \ifdim\pgf@arcto@fS pt=0pt
    \else
      \pgfmathsetmacro\pgf@arcto@fS{1.0} % Special rule: every non-zero value is 1.
    \fi
    \pgf@process{#6}
    \edef\pgf@arcto@xb{\the\pgf@x}%
    \edef\pgf@arcto@yb{\the\pgf@y}%
    %
    % Step 2: x1,y1 is more complicated to compute: It is given by lastx
    % and lasty, but these are transformed coordinates, we need the
    % untransformed ones. So, we inverse the transformation (arghh...)
    %
    \pgftransforminvert%
    \pgf@process{\pgfpointtransformed{\pgfqpoint{\pgf@path@lastx}{\pgf@path@lasty}}}
    \edef\pgf@arcto@xa{\the\pgf@x}
    \edef\pgf@arcto@ya{\the\pgf@y}
    \edef\pgf@temp@a{\pgf@arcto@xa,\pgf@arcto@ya}
    \edef\pgf@temp@b{\pgf@arcto@xb,\pgf@arcto@yb}
    \ifx\pgf@temp@a\pgf@temp@b% special rule: skip!
      \global\let\pgf@marshal\pgfutil@empty
    \else
    %
    % Ok, now we got all the parameters setup. Now comes the
    % computation...
    %
    %
    % Step 3: Start with a new coordinate system and rotate everything
    % by the negated phi.
    %
    \pgftransformreset
    \pgftransformrotate{-\pgf@arcto@phi}
    % Ok, using \pgfpointtransformed we now get transformed points...
    %
    % Step 4: Compute x1' and y1' (xaprime and yaprime)
    %
    \pgf@process{
      \pgfpointtransformed{\pgfpointscale{.5}{\pgfpointdiff
          {\pgfqpoint{\pgf@arcto@xb}{\pgf@arcto@yb}}
          {\pgfqpoint{\pgf@arcto@xa}{\pgf@arcto@ya}}
        }
      }
    }
    \edef\pgf@arcto@xaprime{\pgf@sys@tonumber\pgf@x}
    \edef\pgf@arcto@yaprime{\pgf@sys@tonumber\pgf@y}
    %
    % Compute Lambda
    %
    \pgfmathsetmacro\pgf@arcto@frac@x{\pgf@arcto@xaprime/\pgf@arcto@rx}
    \pgfmathsetmacro\pgf@arcto@frac@y{\pgf@arcto@yaprime/\pgf@arcto@ry}
    \pgfmathsetmacro\pgf@arcto@lambda{
      \pgf@arcto@frac@x*\pgf@arcto@frac@x+\pgf@arcto@frac@y*\pgf@arcto@frac@y
    }
    \ifdim\pgf@arcto@lambda pt>1pt%
      \pgfmathsetmacro\pgf@arcto@sqrt@lambda{sqrt(\pgf@arcto@lambda)}
      \pgfmathsetmacro\pgf@arcto@rx{\pgf@arcto@sqrt@lambda*\pgf@arcto@rx}
      \pgfmathsetmacro\pgf@arcto@ry{\pgf@arcto@sqrt@lambda*\pgf@arcto@ry}
    \fi
    %
    % Do some scaling
    %
    \pgfmathsetmacro\pgf@arcto@xaprime@abs{abs(\pgf@arcto@xaprime)}
    \pgfmathsetmacro\pgf@arcto@yaprime@abs{abs(\pgf@arcto@yaprime)}
    \pgfmathmax@{\pgf@arcto@rx,\pgf@arcto@ry,\pgf@arcto@xaprime@abs,\pgf@arcto@yaprime@abs}
    \pgfmathsetmacro\pgf@arcto@scaling{20/\pgfmathresult}
    \pgfmathsetmacro\pgf@arcto@rx@scaled{\pgf@arcto@scaling*\pgf@arcto@rx}
    \pgfmathsetmacro\pgf@arcto@ry@scaled{\pgf@arcto@scaling*\pgf@arcto@ry}
    \pgfmathsetmacro\pgf@arcto@xaprime@scaled{\pgf@arcto@scaling*\pgf@arcto@xaprime}
    \pgfmathsetmacro\pgf@arcto@yaprime@scaled{\pgf@arcto@scaling*\pgf@arcto@yaprime}
    %
    % Step 5: Now comes the messy computation of c1' and c2'.
    %
    \ifdim\pgf@arcto@rx pt>\pgf@arcto@ry pt%
      \pgfmathsetmacro\pgf@arcto@rx@over@ry{\pgf@arcto@rx/\pgf@arcto@ry}
      \pgfmathsetmacro\pgf@arcto@ry@over@rx{\pgf@arcto@ry/\pgf@arcto@rx}
      \pgfmathsetmacro\pgf@arcto@temp{\pgf@arcto@ry@over@rx*\pgf@arcto@xaprime@scaled}
      \pgfmathsetmacro\pgf@arcto@numerator{
        \pgf@arcto@ry@scaled*\pgf@arcto@ry@scaled-
        \pgf@arcto@yaprime@scaled*\pgf@arcto@yaprime@scaled-
        \pgf@arcto@temp*\pgf@arcto@temp
      }
      \pgfmathsetmacro\pgf@arcto@denominator{
        \pgf@arcto@yaprime@scaled*\pgf@arcto@yaprime@scaled+
        \pgf@arcto@temp*\pgf@arcto@temp
      }
    \else
      \pgfmathsetmacro\pgf@arcto@rx@over@ry{\pgf@arcto@rx/\pgf@arcto@ry}
      \pgfmathsetmacro\pgf@arcto@ry@over@rx{\pgf@arcto@ry/\pgf@arcto@rx}
      \pgfmathsetmacro\pgf@arcto@temp{\pgf@arcto@rx@over@ry*\pgf@arcto@yaprime@scaled}
      \pgfmathsetmacro\pgf@arcto@numerator{
        \pgf@arcto@rx@scaled*\pgf@arcto@rx@scaled-
        \pgf@arcto@xaprime@scaled*\pgf@arcto@xaprime@scaled-
        \pgf@arcto@temp*\pgf@arcto@temp
      }
      \pgfmathsetmacro\pgf@arcto@denominator{
        \pgf@arcto@xaprime@scaled*\pgf@arcto@xaprime@scaled+
        \pgf@arcto@temp*\pgf@arcto@temp
      }
    \fi
    \pgfmathsetmacro\pgf@arcto@frac{
      \pgf@arcto@numerator/\pgf@arcto@denominator
    }
    \ifdim\pgf@arcto@frac pt<0pt
      \pgfmathsetmacro\pgf@arcto@factor{0}
    \else
      \pgfmathsetmacro\pgf@arcto@factor{sqrt(\pgf@arcto@frac)}
    \fi
    \ifx\pgf@arcto@fA\pgf@arcto@fS
      \pgfmathsetmacro\pgf@arcto@factor{-\pgf@arcto@factor}
    \fi
    \pgfmathsetmacro\pgf@arcto@cxprime{
      \pgf@arcto@factor*\pgf@arcto@rx@over@ry*\pgf@arcto@yaprime
    }
    \pgfmathsetmacro\pgf@arcto@cyprime{
      -\pgf@arcto@factor*\pgf@arcto@ry@over@rx*\pgf@arcto@xaprime
    }
    %
    % Step 6: Ok, now compute cx,cy
    %
    \pgftransformreset
    \pgftransformrotate{\pgf@arcto@phi}
    \pgf@process{
      \pgfpointtransformed{\pgfqpoint{\pgf@arcto@cxprime pt}{\pgf@arcto@cyprime pt}}
    }
    \edef\pgf@arcto@temp{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
    \pgf@process{\pgfpointadd{\pgf@arcto@temp}{
        \pgfpointscale{.5}{
          \pgfpointadd
          {\pgfqpoint{\pgf@arcto@xa}{\pgf@arcto@ya}}
          {\pgfqpoint{\pgf@arcto@xb}{\pgf@arcto@yb}}        }
      }
    }
    \edef\pgf@arcto@cx{\the\pgf@x}
    \edef\pgf@arcto@cy{\the\pgf@y}
    %
    % Step 7: Compute start angle:
    %
    \pgfmathsetmacro\pgf@arcto@vec@x{(\pgf@arcto@xaprime-\pgf@arcto@cxprime)/\pgf@arcto@rx}
    \pgfmathsetmacro\pgf@arcto@vec@y{(\pgf@arcto@yaprime-\pgf@arcto@cyprime)/\pgf@arcto@ry}
    \pgfmathsetmacro\pgf@arcto@denominator{veclen(\pgf@arcto@vec@x,\pgf@arcto@vec@y)}
    \pgfmathsetmacro\pgf@arcto@frac{\pgf@arcto@vec@x/\pgf@arcto@denominator}
    \pgfmathsetmacro\pgf@arcto@theta@start{acos(\pgf@arcto@frac)}
    \ifdim\pgf@arcto@vec@y pt<0pt
      \pgfmathsetmacro\pgf@arcto@theta@start{-\pgf@arcto@theta@start}
    \fi
    %
    % Step 8: Compute end angle:
    %
    \pgfmathsetmacro\pgf@arcto@vec@x{(-\pgf@arcto@xaprime-\pgf@arcto@cxprime)/\pgf@arcto@rx}
    \pgfmathsetmacro\pgf@arcto@vec@y{(-\pgf@arcto@yaprime-\pgf@arcto@cyprime)/\pgf@arcto@ry}
    \pgfmathsetmacro\pgf@arcto@denominator{veclen(\pgf@arcto@vec@x,\pgf@arcto@vec@y)}
    \pgfmathsetmacro\pgf@arcto@frac{\pgf@arcto@vec@x/\pgf@arcto@denominator}
    \pgfmathsetmacro\pgf@arcto@theta@end{acos(\pgf@arcto@frac)}
    \ifdim\pgf@arcto@vec@y pt<0pt
      \pgfmathsetmacro\pgf@arcto@theta@end{-\pgf@arcto@theta@end}
    \fi
    \pgfmathsetmacro\pgf@arcto@delta@theta{abs(\pgf@arcto@theta@start-\pgf@arcto@theta@end)}
    \ifdim\pgf@arcto@fA pt=0pt%
      \ifdim\pgf@arcto@delta@theta pt>180pt%
        % Ok, we need to adjust the angle!
        \ifdim\pgf@arcto@theta@end pt>\pgf@arcto@theta@start pt
          \pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end-360}
        \else
          \pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end+360}
        \fi
      \fi
    \else
      \ifdim\pgf@arcto@delta@theta pt<180pt%
        % Ok, we need to adjust the angle!
        \ifdim\pgf@arcto@theta@end pt>\pgf@arcto@theta@start pt
          \pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end-360}
        \else
          \pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end+360}
        \fi
      \fi
    \fi
    \xdef\pgf@marshal{\noexpand
      \pgfpatharcaxes{\pgf@arcto@theta@start}{\pgf@arcto@theta@end}
      {\noexpand\pgfpointpolar{\pgf@arcto@phi}{\pgf@arcto@rx}}
      {\noexpand\pgfpointpolar{\pgf@arcto@phi+90}{\pgf@arcto@ry}}
    }
    \fi\fi\fi
  }
  \pgf@marshal
}



% the quality of arc approximation by means of Bezier splines is
% controlled by a mesh width.
%
% The mesh width is provided in (full!) degrees. The smaller the mesh
% width, the more precise the arc approximation.
%
% Use an empty value to disable spline approximation (uses a single
% cubic polynomial for the complete arc).
%
% The value must be an integer!
\def\pgfpatharctomaxstepsize{45}

% A specialized arc operation for an arc on an (axis--parallel) ellipse.
%
% In contrast to \pgfpatharc, it explicitly interpolates start- and end points.
%
% In contrast to \pgfpatharcto, this routine is numerically stable and
% quite fast since it relies on a lot of precomputed information.
%
% #1 center of ellipse
% #2 angle of last path position inside of the ellipse
% #3 end angle
% #4 end point (a \pgfpoint)
% #5 xradius
% #6 yradius
% #7 the ratio xradius/yradius of the ellipse
% #8 the ratio yradius/xradius of the ellipse
% Example:
%    \def\cx{1cm}% center x
%    \def\cy{1cm}% center y
%    \def\startangle{0}%
%    \def\endangle{45}%
%    \def\a{5cm}% xradius
%    \def\b{10cm}% yradius
%    \pgfmathparse{\a/\b}\let\abratio=\pgfmathresult
%    \pgfmathparse{\b/\a}\let\baratio=\pgfmathresult
%
% \pgfpathmoveto{\pgfpoint{\cx+\a*cos(\startangle)}{\cy+\b*sin(\startangle)}}%
% \pgfpatharctoprecomputed
%    {\pgfpoint{\cx}{\cy}}
%    {\startangle}
%    {\endangle}
%    {\pgfpoint{\cx+\a*cos(\endangle)}{\cy+\b*sin(\endangle)}}%
%    {\a}
%    {\b}
%    {\abratio}
%    {\baratio}
%
\def\pgfpatharctoprecomputed#1#2#3#4#5#6#7#8{%
    \begingroup
    % Implementation idea:
    %
    % let
    %   m = center (#1)
    %   \gamma_0 = start angle
    %   \gamma_1 = end angle
    %   a = x radius
    %   b = y radius
    %
    % an axis parallel ellipse is parameterized by
    % C(\gamma) = m + ( a cos(\gamma), b sin(\gamma) ), \gamma in [0,360].
    %
    % Now, consider the segment \gamma(t),
    %   \gamma:[0,1] -> [\gamma_0,\gamma_1],
    %            t   ->  \gamma_0 + t(\gamma_1 - \gamma_0)
    % and
    %   C(\gamma(t)) which is defined on [0,1].
    %
    % I'd like to approximate the arc by one or more cubic bezier
    % splines which interpolate through the last and first provided
    % points.
    %
    % In general, a Bezier spline C:[0,1] -> \R of order n fulfills
    % C'(0) = n ( P_1 - P_0 ),
    % C'(1) = n ( P_n - P_{n-1} ).
    % For n=3 and given P_0 and P_3, I can directly compute P_1 and P_2 once I know
    % the derivatives at t=0 and t=1.
    %
    % The derivatives in our case are
    %   ( C \circ \gamma )'(t) = C'[\gamma(t)] * \gamma'(t)
    %       = ( -a pi/180 sin(\gamma(t)),  b pi/180 cos(\gamma(t)) ) * (\gamma_1 - \gamma_0).
    % The pi/180 comes into play since we are working with degrees.
    %
    % Expression (C\circ\gamma)'(0) using P_0 and (C \circ \gamma)'(1)
    % using P_3 yields the expressions
    %   (C \circ \gamma)'(0) =
    %       pi/180 * (\gamma_1 - \gamma_0)* [ - a/b(P_0^y - my), b/a (P_0^x - mx) ]
    %   (C \circ \gamma)'(1) =
    %       pi/180 * (\gamma_1 - \gamma_0)* [ - a/b(P_3^y - my), b/a (P_3^x - mx) ]
    %
    % defining
    %  scaleA = a/b * pi / (3*180) * (\gamma_1 - \gamma_0)
    % and
    %  scaleB = b/a * pi / (3*180) * (\gamma_1 - \gamma_0)
    % yields the direct expressions for the intermediate bezier
    % control points
    %
    % P_1 = [
    %   P_0^x - scaleA* ( P_0^y -my),
    %   P_0^y + scaleB* ( P_0^x -mx) ]
    % and
    % P_2 = [
    %   P_3^x + scaleA* ( P_3^y -my),
    %   P_3^y - scaleB* ( P_3^x -mx) ].
    %
    % This works fast, with few operations, if
    % - a/b and b/a are known in advance
    % - P_0 and P_3 are known in advance
    % - \gamma_0 and \gamma_1 are known.
    %
    % It is also reliable if (\gamma_1 - \gamma_0) is small
    %
    \pgf@process{#1}%
    \edef\pgfpath@center@x{\the\pgf@x}%
    \edef\pgfpath@center@y{\the\pgf@y}%
    \def\pgfpath@completearcend{#4}%
    % compute scale (#3-#2) * pi/(3*180) = (#3 - #2) * pi/27 * 1/20
    % splitting pi/(3*180) into two scales has higher TeX accuracy
    \pgf@xa=#2pt
    \pgf@xb=#3pt
    \edef\pgfpath@startangle{#2pt}%
    \edef\pgfpath@endangle{\pgf@sys@tonumber\pgf@xb}%
    %
    \pgf@ya=\pgf@xb
    \advance\pgf@ya by-\pgf@xa
    %
    \ifx\pgfpatharctomaxstepsize\pgfutil@empty
        \def\pgfpath@N{1}%
        \pgf@xc=\pgf@ya
    \else
        \pgf@xc=\pgf@ya% compute N = floor((gamma_1 - gamma_0) / max) +1
        \ifdim\pgf@xc<0pt
            \multiply\pgf@xc by-1
        \fi
        \divide\pgf@xc by\pgfpatharctomaxstepsize\relax
        \afterassignment\pgfutil@gobble@until@relax
        \c@pgf@counta=\the\pgf@xc\relax
        \advance\c@pgf@counta by1
        \edef\pgfpath@N{\the\c@pgf@counta}%
        %
        \pgf@xc=\pgf@ya
        \divide\pgf@xc by\c@pgf@counta
    \fi
    %
    \edef\pgfpath@h{\pgf@sys@tonumber\pgf@xc}%
    %
%\message{pgfpathellipse: using N =\pgfpath@N\space spline points y0 = \pgfpath@startangle, y0+i*h, yN=\pgfpath@endangle, i=1,...,(\pgfpath@N-1), with h=\pgfpath@h\space mesh width (total arc angle \pgf@sys@tonumber\pgf@ya).}%
    %
    %
    \pgf@xc=0.116355283466289\pgf@xc % pi/27
    \divide\pgf@xc by20
    \pgf@xa=#7\pgf@xc
    \edef\pgfpath@scale@A{\pgf@sys@tonumber\pgf@xa}%
    \pgf@xa=#8\pgf@xc
    \edef\pgfpath@scale@B{\pgf@sys@tonumber\pgf@xa}%
    %
    % compute intermediate spline segments for
    %  i = 1,...,N-1
    % this is a no-op for N=1.
    \c@pgf@countd=1
    \pgfutil@loop
    \ifnum\c@pgf@countd<\pgfpath@N\relax
        %
        \pgf@xa=\pgfpath@startangle % compute \pgf@xa = y_0 + i*h
        \pgf@xb=\pgfpath@h pt
        \multiply\pgf@xb by\c@pgf@countd
        \advance\pgf@xa by\pgf@xb
        \edef\pgfpath@angle@i{\pgf@sys@tonumber\pgf@xa}%
%\message{angle \the\c@pgf@countd: \pgfpath@angle@i...}%
        %
        \pgfpatharcofellipse@{%
            \pgfpoint
                {\pgfpath@center@x + #5*cos(\pgfpath@angle@i)}
                {\pgfpath@center@y + #6*sin(\pgfpath@angle@i)}%
        }%
        %
        \advance\c@pgf@countd by1
    \pgfutil@repeat
    %
    % compute final spline segment. It only differs insofar as the
    % final point is already known explicitly and should be
    % interpolated without additional math error.
%\message{angle \pgfpath@N: \pgfpath@endangle...}%
    \pgfpatharcofellipse@{\pgfpath@completearcend}%
    \endgroup
}%
\def\pgfpatharcofellipse@#1{%
    \begingroup
    \pgf@process{#1}%
    \edef\pgfpath@endpt{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}%
    %
    \pgfpathcurveto{
        \begingroup
        \global\pgf@x=\pgf@path@lastx
        \global\pgf@y=\pgf@path@lasty
        \pgf@xa=\pgf@x \advance\pgf@xa by-\pgfpath@center@x
        \pgf@ya=\pgf@y \advance\pgf@ya by-\pgfpath@center@y
        \global\advance\pgf@x by-\pgfpath@scale@A\pgf@ya
        \global\advance\pgf@y by \pgfpath@scale@B\pgf@xa
        \endgroup
    }{%
        \begingroup
        \pgfpath@endpt
        \pgf@xa=\pgf@x \advance\pgf@xa by-\pgfpath@center@x
        \pgf@ya=\pgf@y \advance\pgf@ya by-\pgfpath@center@y
        \global\advance\pgf@x by \pgfpath@scale@A\pgf@ya
        \global\advance\pgf@y by-\pgfpath@scale@B\pgf@xa
        \endgroup
    }{%
        \pgfpath@endpt
    }%
    \endgroup
}









% Append  an ellipse to the current path.
%
% #1 = center
% #2 = first axis
% #3 = second axis
%
% Example:
%
% % Add a circle of radius 3cm around the origin
% \pgfpathellipse{\pgforigin}{\pgfxy(2,0)}{\pgfxy(0,1)}
%
% % Draw a non-filled circle of radius 1cm around the point (1,1)
% \pgfpathellipse{\pgfxy(1,1)}{\pgfxy(1,1)}{\pgfxy(-2,2)}
% \pgfstroke

\def\pgfpathellipse#1#2#3{%
  \pgfpointtransformed{#1}% store center in xc/yc
  \pgf@xc=\pgf@x%
  \pgf@yc=\pgf@y%
  \pgfpointtransformed{#2}%
  \pgf@xa=\pgf@x% store first axis in xa/ya
  \pgf@ya=\pgf@y%
  \advance\pgf@xa by-\pgf@pt@x%
  \advance\pgf@ya by-\pgf@pt@y%
  \pgfpointtransformed{#3}%
  \pgf@xb=\pgf@x% store second axis in xb/yb
  \pgf@yb=\pgf@y%
  \advance\pgf@xb by-\pgf@pt@x%
  \advance\pgf@yb by-\pgf@pt@y%
  {%
    \advance\pgf@xa by\pgf@xc%
    \advance\pgf@ya by\pgf@yc%
    \pgf@nlt@moveto{\pgf@xa}{\pgf@ya}%
  }%
  \pgf@x=0.55228475\pgf@xb% first arc
  \pgf@y=0.55228475\pgf@yb%
  \advance\pgf@x by\pgf@xa%
  \advance\pgf@y by\pgf@ya%
  \advance\pgf@x by\pgf@xc%
  \advance\pgf@y by\pgf@yc%
  \edef\pgf@temp{\pgf@xc\the\pgf@x\pgf@yc\the\pgf@y}%
  \pgf@x=0.55228475\pgf@xa%
  \pgf@y=0.55228475\pgf@ya%
  \advance\pgf@x by\pgf@xb%
  \advance\pgf@y by\pgf@yb%
  {%
    \advance\pgf@x by\pgf@xc%
    \advance\pgf@y by\pgf@yc%
    \advance\pgf@xb by\pgf@xc%
    \advance\pgf@yb by\pgf@yc%
    \pgf@temp%
    \pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@x}{\pgf@y}{\pgf@xb}{\pgf@yb}%
  }%
  \pgf@xa=-\pgf@xa% flip first axis
  \pgf@ya=-\pgf@ya%
  \pgf@x=0.55228475\pgf@xa% second arc
  \pgf@y=0.55228475\pgf@ya%
  \advance\pgf@x by\pgf@xb%
  \advance\pgf@y by\pgf@yb%
  \advance\pgf@x by\pgf@xc%
  \advance\pgf@y by\pgf@yc%
  \edef\pgf@temp{\pgf@xc\the\pgf@x\pgf@yc\the\pgf@y}%
  \pgf@x=0.55228475\pgf@xb%
  \pgf@y=0.55228475\pgf@yb%
  \advance\pgf@x by\pgf@xa%
  \advance\pgf@y by\pgf@ya%
  {%
    \advance\pgf@x by\pgf@xc%
    \advance\pgf@y by\pgf@yc%
    \advance\pgf@xa by\pgf@xc%
    \advance\pgf@ya by\pgf@yc%
    \pgf@temp%
    \pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@x}{\pgf@y}{\pgf@xa}{\pgf@ya}%
  }%
  \pgf@xb=-\pgf@xb% flip second axis
  \pgf@yb=-\pgf@yb%
  \pgf@x=0.55228475\pgf@xb% third arc
  \pgf@y=0.55228475\pgf@yb%
  \advance\pgf@x by\pgf@xa%
  \advance\pgf@y by\pgf@ya%
  \advance\pgf@x by\pgf@xc%
  \advance\pgf@y by\pgf@yc%
  \edef\pgf@temp{\pgf@xc\the\pgf@x\pgf@yc\the\pgf@y}%
  \pgf@x=0.55228475\pgf@xa%
  \pgf@y=0.55228475\pgf@ya%
  \advance\pgf@x by\pgf@xb%
  \advance\pgf@y by\pgf@yb%
  {%
    \advance\pgf@x by\pgf@xc%
    \advance\pgf@y by\pgf@yc%
    \advance\pgf@xb by\pgf@xc%
    \advance\pgf@yb by\pgf@yc%
    \pgf@temp%
    \pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@x}{\pgf@y}{\pgf@xb}{\pgf@yb}%
  }%
  \pgf@xa=-\pgf@xa% flip first axis once more
  \pgf@ya=-\pgf@ya%
  \pgf@x=0.55228475\pgf@xa% fourth arc
  \pgf@y=0.55228475\pgf@ya%
  \advance\pgf@x by\pgf@xb%
  \advance\pgf@y by\pgf@yb%
  \advance\pgf@x by\pgf@xc%
  \advance\pgf@y by\pgf@yc%
  \edef\pgf@temp{\pgf@xc\the\pgf@x\pgf@yc\the\pgf@y}%
  \pgf@x=0.55228475\pgf@xb%
  \pgf@y=0.55228475\pgf@yb%
  \advance\pgf@x by\pgf@xa%
  \advance\pgf@y by\pgf@ya%
  {%
    \advance\pgf@x by\pgf@xc%
    \advance\pgf@y by\pgf@yc%
    \advance\pgf@xa by\pgf@xc%
    \advance\pgf@ya by\pgf@yc%
    \pgf@temp%
    \pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@x}{\pgf@y}{\pgf@xa}{\pgf@ya}%
  }%
  \pgf@nlt@closepath%
  \pgf@nlt@moveto{\pgf@xc}{\pgf@yc}%
}



% Append a circle to the current path
%
% #1 = center
% #2 = radius
%
% Example:
%
% % Append a circle of radius 3cm around the point (1,1)
% \pgfpathcircle{\pgxy(1,1)}{3cm}

\def\pgfpathcircle#1#2{\pgfpathellipse{#1}{\pgfpoint{#2}{0pt}}{\pgfpoint{0pt}{#2}}}




% Append a rectangle to the current path
%
% #1 = lower left corner point of rectangle
% #2 = width and height vector
%
% Example:
%
% % A rectangle with corners (2,2) and (3,3)
% \pgfpathrectangle{\pgfpointxy{2}{2}}{\pgfpointxy{1}{1}}

\def\pgfpathrectangle{%
  \let\pgfrect@next=\pgf@specialrect%
  \ifpgf@pt@identity%
    \ifpgf@arccorners%
    \else%
      \ifx\pgf@nlt@list\pgfutil@empty%
        \let\pgfrect@next=\pgf@normalrect%
      \fi%
    \fi%
  \fi%
  \pgfrect@next%
}

\def\pgf@normalrect#1#2{%
  \pgf@process{#2}%
  \pgf@xa=\pgf@x%
  \pgf@ya=\pgf@y%
  \pgfpointtransformed{#1}%
  \pgfsyssoftpath@rect{\the\pgf@x}{\the\pgf@y}{\the\pgf@xa}{\the\pgf@ya}%
  \pgf@protocolsizes{\pgf@x}{\pgf@y}%
  \advance\pgf@x by\pgf@xa\relax%
  \advance\pgf@y by\pgf@ya\relax%
  \pgf@protocolsizes{\pgf@x}{\pgf@y}%
}

\def\pgf@specialrect#1#2{%
  \pgf@process{#2}%
  \pgf@xa=\pgf@x%
  \pgf@ya=\pgf@y%
  \pgf@process{#1}%
  \pgf@xb=\pgf@x%
  \pgf@yb=\pgf@y%
  \advance\pgf@xa by\pgf@xb%
  \advance\pgf@ya by\pgf@yb%
  \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
  \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@ya}}%
  \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}%
  \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}%
  \pgfpathclose%
  \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yb}}%
}

% Append a rectangle to the current path
%
% #1 = one corner of the rectangle
% #2 = opposite corner of the rectangle
%
% Example:
%
% % A rectangle with corners (2,2) and (3,3)
% \pgfpathrectanglecorners{\pgfpointxy{2}{2}}{\pgfpointxy{3}{3}}

\def\pgfpathrectanglecorners#1#2{%
  \pgf@process{#2}%
  \pgf@xc=\pgf@x%
  \pgf@yc=\pgf@y%
  \pgf@process{#1}%
  \advance\pgf@xc by-\pgf@x%
  \advance\pgf@yc by-\pgf@y%
  \pgfpathrectangle{#1}{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
}


% Append a grid to the current path.
%
% #1 = first corner point of grid
% #2 = second corner point of grid
%
% Options:
%
% stepx = x-step dimension (default 1cm)
% stepy = y-step dimension (default 1cm)
% step  = dimension vector
%
% Example:
%
% \pgfsetlinewidth{0.8pt}
% \pgfgrid{\pgfxy(0,0)}{\pgfxy(3,2)}
% \pgfsetlinewidth{0.4pt}
% \pgfgrid[stepx=1cm,stepy=1cm]{\pgfxy(0,0)}{\pgfxy(3,2)}

\pgfkeys{
  /pgf/stepx/.initial=1cm,
  /pgf/stepy/.initial=1cm,
  /pgf/step/.code={\pgf@process{#1}\pgfkeysalso{/pgf/stepx/.expanded=\the\pgf@x,/pgf/stepy/.expanded=\the\pgf@y}},
  /pgf/step/.value required
}

\def\pgfpathgrid{\pgfutil@ifnextchar[{\pgf@pathgrid}{\pgf@pathgrid[]}}
\def\pgf@pathgrid[#1]#2#3{%
  \pgfset{#1}%
  \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/stepx}}%
  \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/stepy}}%
  \pgf@process{#3}%
  \pgf@xb=\pgf@x%
  \pgf@yb=\pgf@y%
  \pgf@process{#2}%
  \pgf@xa=\pgf@x%
  \pgf@ya=\pgf@y%
  % Swap coordinates if one of them is smaller than the other:
  \ifdim\pgf@xa>\pgf@xb%
    \pgf@x=\pgf@xb%
    \pgf@xb=\pgf@xa%
    \pgf@xa=\pgf@x%
  \fi%
  \ifdim\pgf@ya>\pgf@yb%
    \pgf@y=\pgf@yb%
    \pgf@yb=\pgf@ya%
    \pgf@ya=\pgf@y%
  \fi%
  \ifdim \pgf@yc > .01pt\relax% if to draw horizontal lines
    \c@pgf@counta=\pgf@ya\relax%
    \c@pgf@countb=\pgf@yc\relax%
    \divide\c@pgf@counta by\c@pgf@countb\relax%
    \pgfutil@tempdima=\c@pgf@counta\pgf@yc\relax%
    \ifdim\pgfutil@tempdima<\pgf@ya%
      \advance\pgfutil@tempdima by\pgf@yc%
    \fi%
    \pgfutil@tempdimb\pgf@x
    \pgfutil@loop% horizontal lines
      {%
        \pgf@xa=\pgfutil@tempdimb%
        \pgf@ya=\pgfutil@tempdima%
        \pgf@pos@transform{\pgf@xa}{\pgf@ya}
        \pgf@nlt@moveto{\pgf@xa}{\pgf@ya}%
        \pgf@xa=\pgf@xb%
        \pgf@ya=\pgfutil@tempdima%
        \pgf@pos@transform{\pgf@xa}{\pgf@ya}
        \pgf@nlt@lineto{\pgf@xa}{\pgf@ya}%
      }%
    \advance\pgfutil@tempdima by\pgf@yc%
    \ifdim\pgfutil@tempdima<\pgf@yb%
    \pgfutil@repeat%
    \advance\pgfutil@tempdima by-0.01pt\relax%
    \ifdim\pgfutil@tempdima<\pgf@yb%
      {%
        \pgf@xa=\pgfutil@tempdimb%
        \pgf@ya=\pgfutil@tempdima%
        \pgf@pos@transform{\pgf@xa}{\pgf@ya}
        \pgf@nlt@moveto{\pgf@xa}{\pgf@ya}%
        \pgf@xa=\pgf@xb%
        \pgf@ya=\pgfutil@tempdima%
        \pgf@pos@transform{\pgf@xa}{\pgf@ya}
        \pgf@nlt@lineto{\pgf@xa}{\pgf@ya}%
      }%
    \fi%
  \fi%
  \ifdim \pgf@xc > .01pt\relax% if to draw vertical lines
    \c@pgf@counta=\pgf@xa\relax%
    \c@pgf@countb=\pgf@xc\relax%
    \divide\c@pgf@counta by\c@pgf@countb\relax%
    \pgfutil@tempdimb=\c@pgf@counta\pgf@xc\relax%
    \ifdim\pgfutil@tempdimb<\pgf@xa%
      \advance\pgfutil@tempdimb by\pgf@xc%
    \fi%
    \pgfutil@loop% vertical lines
      {%
        \pgf@xc=\pgfutil@tempdimb%
        \pgf@yc=\pgf@ya%
        \pgf@pos@transform{\pgf@xc}{\pgf@yc}
        \pgf@nlt@moveto{\pgf@xc}{\pgf@yc}%
        \pgf@xc=\pgfutil@tempdimb%
        \pgf@yc=\pgf@yb%
        \pgf@pos@transform{\pgf@xc}{\pgf@yc}
        \pgf@nlt@lineto{\pgf@xc}{\pgf@yc}%
      }%
      \advance\pgfutil@tempdimb by\pgf@xc%
    \ifdim\pgfutil@tempdimb<\pgf@xb%
    \pgfutil@repeat%
    \advance\pgfutil@tempdimb by-0.01pt\relax%
    \ifdim\pgfutil@tempdimb<\pgf@xb%
      {%
        \pgf@xc=\pgfutil@tempdimb%
        \pgf@yc=\pgf@ya%
        \pgf@pos@transform{\pgf@xc}{\pgf@yc}
        \pgf@nlt@moveto{\pgf@xc}{\pgf@yc}%
        \pgf@xc=\pgfutil@tempdimb%
        \pgf@yc=\pgf@yb%
        \pgf@pos@transform{\pgf@xc}{\pgf@yc}
        \pgf@nlt@lineto{\pgf@xc}{\pgf@yc}%
      }%
    \fi%
  \fi%
  \pgf@process{#3}%
  \pgf@pos@transform{\pgf@x}{\pgf@y}%
  \pgf@nlt@moveto{\pgf@x}{\pgf@y}%
}



% Append two half-parabolas to the path
%
% #1 = bend (relative to current point)
% #2 = end point (relative to bend point)
%
% Description:
%
% This command appends a half-parabola that starts at the current point
% and has its bend at #1+current point. Then, a second parabola is
% appended that starts at #1+current point, where it also has its
% minimum/maximum, and ends at #1+current point+#2, which becomes the
% new current point.
%
% By setting #2 = (0,0) you draw only a half parabola that goes from the
% current point to the bend; by setting #1 = (0,0)
% you draw a half parabola that going to current point + #2 and has its
% bend at the current point.
%
% Examples:
%
% % Half-parabola going ``up and right''
% \pgfpathmoveto{\pgfpointorigin}
% \pgfpathparabola{\pgfpointorigin}{\pgfpoint{2cm}{4cm}}
%
% % Half-parabola going ``down and right''
% \pgfpathmoveto{\pgfpointorigin}
% \pgfpathparabola{\pgfpoint{-2cm}{4cm}}}{\pgfpointorigin}
%
% % Full parabola
% \pgfpathmoveto{\pgfpointorigin}
% \pgfpathparabola{\pgfpoint{-2cm}{4cm}}{\pgfpoint{2cm}{4cm}}

\def\pgfpathparabola#1#2{%
  {%
    \pgf@process{#2}% untransformed
    \pgf@xb=\pgf@x%
    \pgf@yb=\pgf@y%
    \pgf@process{#1}% untransformed
    \pgf@xc=\pgf@x%
    \pgf@yc=\pgf@y%
    \pgfutil@tempswatrue%
    \ifdim\pgf@xb=0pt\relax%
      \ifdim\pgf@yb=0pt\relax%
        \pgfutil@tempswafalse%
      \fi%
    \fi%
    {%
      \ifpgfutil@tempswa%
        \pgf@arccornersfalse
      \else%
      \fi%
      \pgfutil@tempswatrue%
      \ifdim\pgf@xc=0pt\relax%
        \ifdim\pgf@yc=0pt\relax%
          \pgfutil@tempswafalse%
        \fi%
      \fi%
      \ifpgfutil@tempswa
      {%
        \pgf@pt@x=\pgf@path@lastx%
        \pgf@pt@y=\pgf@path@lasty%
        \pgfpathcurveto%
          {\pgfqpoint{.1125\pgf@xc}{.225\pgf@yc}}% found by trial and error
          {\pgfqpoint{.5\pgf@xc}{\pgf@yc}}% found by trial and error
          {\pgfqpoint{\pgf@xc}{\pgf@yc}}%
      }%
      \fi%
    }%
    \ifpgfutil@tempswa%
      \pgf@xc=\pgf@xb%
      \pgf@yc=\pgf@yb%
      {%
        \pgf@pt@x=\pgf@path@lastx%
        \pgf@pt@y=\pgf@path@lasty%
        \pgfpathcurveto%
          {\pgfqpoint{.5\pgf@xc}{0\pgf@yc}}% found by trial and error
          {\pgfqpoint{.8875\pgf@xc}{.775\pgf@yc}}% found by trial and error
          {\pgfqpoint{\pgf@xc}{\pgf@yc}}%
      }%
    \fi%
  }%
}




% Append a sine curve between 0 and \pi/2 to the path.
%
% #1 = vector, describing the width and height of the curve
%
% Description:
%
% This command appends a sine curve in the interval 0 and \pi/2 to the
% current path. The sine curve ends at currentpoint+#1.
%
% Examples:
%
% % One complete sine in the interval [0,\pi]
% \pgfpathmoveto{\pgfpointorigin}
% \pgfpathsine{\pgfpoint{1.57cm}{1cm}}
% \pgfpathcosine{\pgfpoint{3.141cm}{0cm}}

\def\pgfpathsine#1{%
  {%
    \pgf@process{#1}% untransformed
    \pgf@xc=\pgf@x%
    \pgf@yc=\pgf@y%
    \pgf@pt@x=\pgf@path@lastx% evil trickery to transform to the last point
    \pgf@pt@y=\pgf@path@lasty%
    \pgfpathcurveto%
      {\pgfqpoint{.3260\pgf@xc}{.5120\pgf@yc}}%
      {\pgfqpoint{.6380\pgf@xc}{\pgf@yc}}%
      {\pgfqpoint{\pgf@xc}{\pgf@yc}}%
  }%
}

% Append a cosine curve between 0 and \pi/2 to the path.
%
% #1 = vector, describing the width and height of the curve
%
% Examples:
%
% % One complete sine in the interval [0,\pi]
% \pgfpathmoveto{\pgfpointorigin}
% \pgfpathsine{\pgfpoint{1.57cm}{1cm}}
% \pgfpathcosine{\pgfpoint{3.141cm}{0cm}}

\def\pgfpathcosine#1{%
  {%
    \pgf@process{#1}% untransformed
    \pgf@xc=\pgf@x%
    \pgf@yc=\pgf@y%
    \pgf@pt@x=\pgf@path@lastx% evil trickery to transform to the last point
    \pgf@pt@y=\pgf@path@lasty%
    \pgfpathcurveto%
      {\pgfqpoint{.3620\pgf@xc}{0pt}}%
      {\pgfqpoint{.6740\pgf@xc}{.4880\pgf@yc}}%
      {\pgfqpoint{\pgf@xc}{\pgf@yc}}%
  }%
}



% Draw part of a curve between two specified times s and t.
%
% #1 - a start time s.
% #2 - an end time t.
% #3 - start point of the curve
% #4 - first control
% #5 - second control
% #6 - end point of the curve
%
% There are two versions, \pgfpathcurvebetweentime and
% \pgfpathcurvebetweentimecontinue. The latter does not insert a
% moveto to the first point.
%
\def\pgfpathcurvebetweentime{\pgf@ignoremovetofalse\pgf@@pathcurvebetweentime}
\def\pgfpathcurvebetweentimecontinue{\pgf@ignoremovetotrue\pgf@@pathcurvebetweentime}
\newif\ifpgf@ignoremoveto

\def\pgf@@pathcurvebetweentime#1#2#3#4#5#6{%
  \pgfmathparse{#1}%
  \let\pgf@time@s=\pgfmathresult%
  \pgfmathparse{#2}%
  \let\pgf@time@t=\pgfmathresult%
  \ifdim\pgf@time@s pt>\pgf@time@t pt\relax%
    \pgfmathsetmacro\pgf@time@s{1-#1}%
    \pgfmathsetmacro\pgf@time@t{1-#2}%
    \pgf@@@pathcurvebetweentime{\pgf@time@t}{#6}{#5}{#4}{#3}%
  \else%
    \pgf@@@pathcurvebetweentime{\pgf@time@t}{#3}{#4}{#5}{#6}%
  \fi%
}

\def\pgf@@@pathcurvebetweentime#1#2#3#4#5{%
  % Q1 = P1.
  \pgf@process{#2}%
  \pgf@xc=\pgf@x%
  \pgf@yc=\pgf@y%
  % Q2 = P1 + t*(P2-P1).
  \pgf@process{%
    \pgf@process{#3}%
    \pgf@xa=#1\pgf@x%
    \pgf@ya=#1\pgf@y%
    \pgf@process{#2}%
    \pgf@xb=\pgf@x%
    \pgf@yb=\pgf@y%
    \advance\pgf@x by-#1\pgf@xb%
    \advance\pgf@y by-#1\pgf@yb%
    \advance\pgf@x by\pgf@xa%
    \advance\pgf@y by\pgf@ya%
  }%
  \pgf@xb=\pgf@x%
  \pgf@yb=\pgf@y%
  % Q3 = Q2 + t*((P2 + t*(P3-P2)) - Q2).
  \pgf@process{%
    \pgf@process{#4}%
    \pgf@xa=#1\pgf@x%
    \pgf@ya=#1\pgf@y%
    %
    \pgf@process{#3}%
    \pgf@xc=\pgf@x%
    \pgf@yc=\pgf@y%
    \advance\pgf@xc by-#1\pgf@x%
    \advance\pgf@yc by-#1\pgf@y%
    %
    \pgf@x=\pgf@xb%
    \pgf@y=\pgf@yb%
    \advance\pgf@x by#1\pgf@xa%
    \advance\pgf@y by#1\pgf@ya%
    \advance\pgf@x by-#1\pgf@xb%
    \advance\pgf@y by-#1\pgf@yb%
    \advance\pgf@x by#1\pgf@xc%
    \advance\pgf@y by#1\pgf@yc%
  }%
  \pgf@xa=\pgf@x%
  \pgf@ya=\pgf@y%
  % Q4 = (1-t)^3*P1 + 3*t(1-t)^2*P2 + 3*t^2(1-t)*P3 + t^3*P4.
  \pgf@process{\pgfpointcurveattime{#1}{#2}{#3}{#4}{#5}}%
  \ifx#1\pgf@time@t%
    % First time round...
    \pgfmathdivide@{\pgf@time@s}{\pgf@time@t}%
    \pgfmathadd@{-\pgfmathresult}{1}%
    \let\pgf@time@s=\pgfmathresult%
    \edef\pgf@marshal{%
      \noexpand\pgf@@@pathcurvebetweentime{\noexpand\pgf@time@s}%
        {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
        {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
    }%
  \else%
    % ...second time round.
    \ifpgf@ignoremoveto%
      \edef\pgf@marshal{%
        \noexpand\pgfpathcurveto{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
          {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
      }%
    \else%
      \edef\pgf@marshal{%
        \noexpand\pgfpathmoveto{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
        \noexpand\pgfpathcurveto{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
          {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
      }%
    \fi%
  \fi%
  \pgf@marshal%
}


\endinput