summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex417
1 files changed, 208 insertions, 209 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
index b546d5df40f..57db0d20ba2 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepoints.code.tex,v 1.27 2013/10/07 15:51:46 tantau Exp $
+\ProvidesFileRCS{pgfcorepoints.code.tex}
\newdimen\pgf@picminx
\newdimen\pgf@picmaxx
@@ -34,18 +34,18 @@
% \pgfextract@process\myarcpoint{\pgfpointpolar{30}{5cm and 2cm}}
\def\pgfextract@process#1#2{%
- \pgf@process{#2}%
- \edef#1{\noexpand\pgf@x=\the\pgf@x\noexpand\relax\noexpand\pgf@y=\the\pgf@y\noexpand\relax}%
+ \pgf@process{#2}%
+ \edef#1{\noexpand\global\pgf@x=\the\pgf@x\noexpand\relax\noexpand\global\pgf@y=\the\pgf@y\noexpand\relax}%
}
% This needed until old shapes code changed.
\let\pgfsavepgf@process\pgfextract@process%
% Return a point
-%
-% #1 = x-coordinate of the point
-% #2 = y-coordinate of the point
-%
+%
+% #1 = x-coordinate of the point
+% #2 = y-coordinate of the point
+%
% x = #1
% y = #2
%
@@ -59,10 +59,10 @@
% Quickly a point
-%
+%
% #1 = x-coordinate of the point (no calculations done)
% #2 = y-coordinate of the point (no calculations done)
-%
+%
% x = #1
% y = #2
%
@@ -70,12 +70,12 @@
%
% \pgfpathmoveto{\pgfqpoint{2pt}{3cm}}
-\def\pgfqpoint#1#2{\pgf@x=#1\pgf@y=#2}
+\def\pgfqpoint#1#2{\global\pgf@x=#1\relax\global\pgf@y=#2\relax}
% Return the origin.
-%
+%
% x = 0
% y = 0
%
@@ -83,12 +83,12 @@
%
% \pgfpathmoveto{\pgfpointorigin}
-\def\pgfpointorigin{\pgf@x=0pt\pgf@y=\pgf@x\ignorespaces}
+\def\pgfpointorigin{\global\pgf@x=0pt \global\pgf@y=\pgf@x\ignorespaces}
% Return a transformed point
-%
+%
% #1 = a point
%
% Description:
@@ -108,18 +108,18 @@
\def\pgfpointtransformed#1{%
\pgf@process{%
#1%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
}%
}
% Return the difference vector of two points.
-%
-% #1 = start of vector
-% #2 = end of vector
-%
-% x = x-component of difference
-% y = y-component of difference
+%
+% #1 = start of vector
+% #2 = end of vector
+%
+% x = x-component of difference
+% y = y-component of difference
%
% Example:
%
@@ -130,14 +130,14 @@
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\pgf@process{#2}%
- \advance\pgf@x by-\pgf@xa\relax%
- \advance\pgf@y by-\pgf@ya\relax\ignorespaces}
-
-% Add two vectors.
-%
-% #1 = first vector
-% #2 = second vector
-%
+ \global\advance\pgf@x by-\pgf@xa\relax%
+ \global\advance\pgf@y by-\pgf@ya\relax\ignorespaces}
+
+% Add two vectors.
+%
+% #1 = first vector
+% #2 = second vector
+%
% x = x-component of addition
% y = y-component of addition
%
@@ -150,15 +150,15 @@
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\pgf@process{#2}%
- \advance\pgf@x by\pgf@xa%
- \advance\pgf@y by\pgf@ya}
+ \global\advance\pgf@x by\pgf@xa%
+ \global\advance\pgf@y by\pgf@ya}
% Multiply a vector by a factor.
-%
-% #1 = factor
-% #2 = vector
+%
+% #1 = factor
+% #2 = vector
%
% Example:
%
@@ -167,20 +167,20 @@
\def\pgfpointscale#1#2{%
\pgf@process{#2}%
\pgfmathparse{#1}%
- \pgf@x=\pgfmathresult\pgf@x%
- \pgf@y=\pgfmathresult\pgf@y%
+ \global\pgf@x=\pgfmathresult\pgf@x%
+ \global\pgf@y=\pgfmathresult\pgf@y%
}
% A "quick" variant of \pgfpointscale which doesn't invoke the math parser for '#1'.
% #1 must be a number without units, no registers are accepted.
\def\pgfqpointscale#1#2{%
\pgf@process{#2}%
- \pgf@x=#1\pgf@x%
- \pgf@y=#1\pgf@y%
+ \global\pgf@x=#1\pgf@x%
+ \global\pgf@y=#1\pgf@y%
}
% The intersection of two lines
-%
+%
% #1 = point on first line
% #2 = another point on first line
% #3 = point on second line
@@ -196,9 +196,9 @@
\def\pgfpointintersectionoflines#1#2#3#4{%
{%
- %
+ %
% Compute orthogonal vector to #1--#2
- %
+ %
\pgf@process{#2}%
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
@@ -226,12 +226,12 @@
%
\pgf@xc=\pgf@sys@tonumber{\pgf@ya}\pgf@x%
\advance\pgf@xc by\pgf@sys@tonumber{\pgf@xa}\pgf@y%
- %
+ %
% The orthogonal vector is (\pgf@ya,\pgf@xa)
- %
- %
+ %
+ %
% Compute orthogonal vector to #3--#4
- %
+ %
\pgf@process{#4}%
\pgf@xb=\pgf@x%
\pgf@yb=\pgf@y%
@@ -259,12 +259,12 @@
%
\pgf@yc=\pgf@sys@tonumber{\pgf@yb}\pgf@x%
\advance\pgf@yc by\pgf@sys@tonumber{\pgf@xb}\pgf@y%
- %
+ %
% The orthogonal vector is (\pgf@yb,\pgf@xb)
- %
- % Setup transformation matrx (this is just to use the matrix
+ %
+ % Setup transformation matrix (this is just to use the matrix
% inversion)
- %
+ %
\pgfsettransform{{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@yb}{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@xb}{0pt}{0pt}}%
\pgftransforminvert%
\pgf@process{\pgfpointtransformed{\pgfpoint{\pgf@xc}{\pgf@yc}}}%
@@ -273,7 +273,7 @@
% The intersection of two circles
-%
+%
% #1 = center of first circle
% #2 = center of second circle
% #3 = radius of first circle
@@ -404,7 +404,7 @@
\pgf@xb=\pgf@sys@tonumber{\dimen0}\dimen9%
\pgf@xb=-\pgf@xb%
\advance\pgf@y by\pgf@xb\relax%
- \else%
+ \else%
% x = a + ek/p - (f/p)sqrt(r^2 - k^2)
\pgf@x=\pgf@xa%
\advance\pgf@x by\pgf@sys@tonumber{\dimen0}\dimen8\relax%
@@ -426,13 +426,13 @@
% Returns point on a line from #2 to #3 at time #1.
-%
+%
% #1 = a time, where 0 is the start and 1 is the end
% #2 = start point
-% #3 = end point
-%
+% #3 = end point
+%
% x = x-component of #1*start + (1-#1)*end
-% y = y-component of #1*start + (1-#1)*end
+% y = y-component of #1*start + (1-#1)*end
% xa/ya = #1*start + (1-#1)*end
% xb/yb = start point
% xc/yc = end point
@@ -454,21 +454,21 @@
\pgfmathsetmacro\pgf@temp{#1}%
\advance\pgf@xa by-\pgf@x%
\advance\pgf@ya by-\pgf@y%
- \advance\pgf@x by\pgf@temp\pgf@xa%
- \advance\pgf@y by\pgf@temp\pgf@ya%
+ \global\advance\pgf@x by\pgf@temp\pgf@xa%
+ \global\advance\pgf@y by\pgf@temp\pgf@ya%
}
% Move point #2 #1 many units in the direction of #3.
-%
+%
% #1 = a distance
% #2 = start point
-% #3 = end point
+% #3 = end point
%
% Description:
%
% Computes
-%
+%
% x/y = start + #1*(normalise(end-start))
%
% and additionally
@@ -490,27 +490,27 @@
\pgf@process{#3}%
\pgf@xc\pgf@x%
\pgf@yc\pgf@y%
- \advance\pgf@x by-\pgf@xb\relax%
- \advance\pgf@y by-\pgf@yb\relax%
+ \global\advance\pgf@x by-\pgf@xb\relax%
+ \global\advance\pgf@y by-\pgf@yb\relax%
\pgf@process{\pgfpointnormalised{}}% x/y = normalised vector
\pgf@ya=\pgf@xa\relax%
\pgf@xa=\pgf@sys@tonumber{\pgf@x}\pgf@xa%
\pgf@ya=\pgf@sys@tonumber{\pgf@y}\pgf@ya%
- \pgf@x=\pgf@xb\relax%
- \pgf@y=\pgf@yb\relax%
- \advance\pgf@x by\pgf@xa\relax%
- \advance\pgf@y by\pgf@ya\relax%
+ \global\pgf@x=\pgf@xb\relax%
+ \global\pgf@y=\pgf@yb\relax%
+ \global\advance\pgf@x by\pgf@xa\relax%
+ \global\advance\pgf@y by\pgf@ya\relax%
}
% Returns point on a curve from #2 to #5 with controls #3 and #4 at time #1.
-%
+%
% #1 = a time
% #2 = start point
% #3 = first control point
% #4 = second control point
-% #5 = end point
-%
+% #5 = end point
+%
% x = x-component of place on the curve at time t
% y = y-component of place on the curve at time t
%
@@ -528,8 +528,8 @@
\def\pgfpointcurveattime#1#2#3#4#5{%
\pgfmathparse{#1}%
\let\pgf@time@s=\pgfmathresult%
- \pgf@x=\pgfmathresult pt%
- \pgf@x=-\pgf@x%
+ \global\pgf@x=\pgfmathresult pt%
+ \global\pgf@x=-\pgf@x%
\advance\pgf@x by 1pt%
\edef\pgf@time@t{\pgf@sys@tonumber{\pgf@x}}%
\pgf@process{#5}%
@@ -543,30 +543,30 @@
\pgf@ya=\pgf@y%
\pgf@process{#2}%
% First iteration:
- \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa%
- \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya%
+ \global\pgf@x=\pgf@time@t\pgf@x\global\advance\pgf@x by\pgf@time@s\pgf@xa%
+ \global\pgf@y=\pgf@time@t\pgf@y\global\advance\pgf@y by\pgf@time@s\pgf@ya%
\pgf@xa=\pgf@time@t\pgf@xa\advance\pgf@xa by\pgf@time@s\pgf@xb%
\pgf@ya=\pgf@time@t\pgf@ya\advance\pgf@ya by\pgf@time@s\pgf@yb%
\pgf@xb=\pgf@time@t\pgf@xb\advance\pgf@xb by\pgf@time@s\pgf@xc%
\pgf@yb=\pgf@time@t\pgf@yb\advance\pgf@yb by\pgf@time@s\pgf@yc%
% Second iteration:
- \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa%
- \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya%
+ \global\pgf@x=\pgf@time@t\pgf@x\global\advance\pgf@x by\pgf@time@s\pgf@xa%
+ \global\pgf@y=\pgf@time@t\pgf@y\global\advance\pgf@y by\pgf@time@s\pgf@ya%
\pgf@xa=\pgf@time@t\pgf@xa\advance\pgf@xa by\pgf@time@s\pgf@xb%
\pgf@ya=\pgf@time@t\pgf@ya\advance\pgf@ya by\pgf@time@s\pgf@yb%
% Save x/y
\pgf@xb=\pgf@x%
\pgf@yb=\pgf@y%
% Third iteration:
- \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa%
- \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya%
+ \global\pgf@x=\pgf@time@t\pgf@x\global\advance\pgf@x by\pgf@time@s\pgf@xa%
+ \global\pgf@y=\pgf@time@t\pgf@y\global\advance\pgf@y by\pgf@time@s\pgf@ya%
}
% Returns point on an arc at a certain "time"
-%
-% #1 = a time
+%
+% #1 = a time
% #2 = center of a ellipse
% #3 = 0-degree exis of the ellipse
% #4 = 90-degree exis of the ellipse
@@ -589,8 +589,8 @@
\pgfmathsetmacro\pgf@angle@start{#5}%
\pgfmathsetmacro\pgf@angle@end{#6}%
\pgfmathparse{#1}%
- \pgf@x=\pgfmathresult pt%
- \pgf@x=-\pgf@x%
+ \global\pgf@x=\pgfmathresult pt%
+ \global\pgf@x=-\pgf@x%
\advance\pgf@x by 1pt%
\pgfmathsetmacro\pgf@angle@mid{\pgf@angle@end*\pgfmathresult+\pgf@angle@start*\pgf@sys@tonumber{\pgf@x}}%
\pgfmathcos@{\pgf@angle@mid}%
@@ -605,11 +605,11 @@
\pgf@process{\pgfpointadd{\pgfpointscale{\pgf@angle@sin}{\pgf@angle@zero@axis}}%
{\pgfpointscale{-\pgf@angle@cos}{\pgf@angle@ninety@axis}}}%
\ifdim\pgf@angle@start pt>\pgf@angle@end pt%
- \pgf@xa=\pgf@x%
- \pgf@ya=\pgf@y%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
\else%
- \pgf@xa=-\pgf@x%
- \pgf@ya=-\pgf@y%
+ \pgf@xa=-\pgf@x%
+ \pgf@ya=-\pgf@y%
\fi%
% Compute position
\pgf@process{\pgfpointadd{#2}{%
@@ -632,12 +632,12 @@
% A polar coordinate
%
% #1 = a degree
-% #2 = a radius -- either a dimension or two dimensions separated by
-% " and ".
+% #2 = a radius -- either a dimension or two dimensions separated by
+% " and ".
%
% x = (first dimension in #2) * cos(#1)
% y = (second dimension in #2) * sin(#2)
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfpointpolar{30}{1cm}}
@@ -649,29 +649,29 @@
\pgf@polar@#2\@@%
\else%
\pgf@polar@#2 and #2\@@%
- \fi%
+ \fi%
\pgfmathparse{#1}%
\let\pgfpoint@angle=\pgfmathresult%
\pgfmathcos@{\pgfpoint@angle}%
- \pgf@x=\pgfmathresult\pgf@x%
+ \global\pgf@x=\pgfmathresult\pgf@x%
\pgfmathsin@{\pgfpoint@angle}%
- \pgf@y=\pgfmathresult\pgf@y%
+ \global\pgf@y=\pgfmathresult\pgf@y%
}
\def\pgf@polar@#1and #2\@@{%
\pgfmathsetlength{\pgf@y}{#2}%
- \pgfmathsetlength{\pgf@x}{#1}%
+ \pgfmathsetlength{\pgf@x}{#1}%
}
% Quick version of the polar coordinate method
\def\pgfqpointpolar#1#2{%
- \pgf@x=#2%
- \pgf@y=\pgf@x%
+ \global\pgf@x=#2%
+ \global\pgf@y=\pgf@x%
\pgfmathcos@{#1}%
- \pgf@x=\pgfmathresult\pgf@x%
+ \global\pgf@x=\pgfmathresult\pgf@x%
\pgfmathsin@{#1}%
- \pgf@y=\pgfmathresult\pgf@y\relax%
+ \global\pgf@y=\pgfmathresult\pgf@y\relax%
}
@@ -680,11 +680,11 @@
% A polar coordinate in the xy plane.
%
% #1 = a degree
-% #2 = a radius given as a number or two radi
+% #2 = a radius given as a number or two radii
%
% result = (first dim in #2) * x-vector * cos(#1) +
% (second dim in #2) * y-vector * sin(#1)
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfpointpolarxy{30}{2}}
@@ -695,17 +695,17 @@
\pgf@polarxy@#2\@@%
\else%
\pgf@polarxy@#2and #2\@@%
- \fi%
+ \fi%
\pgfmathparse{#1}%
\let\pgfpoint@angle=\pgfmathresult%
\pgfmathcos@{\pgfpoint@angle}%
\pgf@xa=\pgfmathresult\pgf@xa%
\pgfmathsin@{\pgfpoint@angle}%
\pgf@ya=\pgfmathresult\pgf@ya%
- \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@xx%
- \advance\pgf@x by \pgf@sys@tonumber{\pgf@ya}\pgf@yx%
- \pgf@y=\pgf@sys@tonumber{\pgf@xa}\pgf@xy%
- \advance\pgf@y by \pgf@sys@tonumber{\pgf@ya}\pgf@yy}
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@xx%
+ \global\advance\pgf@x by \pgf@sys@tonumber{\pgf@ya}\pgf@yx%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xa}\pgf@xy%
+ \global\advance\pgf@y by \pgf@sys@tonumber{\pgf@ya}\pgf@yy}
\def\pgf@polarxy@#1and #2\@@{%
\pgfmathsetlength{\pgf@xa}{#1}%
@@ -721,7 +721,7 @@
% #3 = a height given as a number
%
% result = #2*(x-vector * cos(#1) + y-vector * sin(#1)) + #3*z-vector
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfpointcylindrical{30}{2}{1}}
@@ -729,8 +729,8 @@
\def\pgfpointcylindrical#1#2#3{%
\pgfpointpolarxy{#1}{#2}%
\pgfmathparse{#3}%
- \advance\pgf@x by \pgfmathresult\pgf@zx%
- \advance\pgf@y by \pgfmathresult\pgf@zy}
+ \global\advance\pgf@x by \pgfmathresult\pgf@zx%
+ \global\advance\pgf@y by \pgfmathresult\pgf@zy}
% A spherical coordinate.
@@ -740,7 +740,7 @@
% #3 = a radius
%
% result = #3*(cos(#2)*(x-vector * cos(#1) + y-vector * sin(#1)) + sin(#2)*z-vector)
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfpointspherical{30}{30}{2}}
@@ -764,33 +764,33 @@
\advance\pgf@xc by \pgfmathresult\pgf@zx%
\advance\pgf@yc by \pgfmathresult\pgf@zy%
\pgfmathparse{#3}%
- \pgf@x=\pgfmathresult\pgf@xc%
- \pgf@y=\pgfmathresult\pgf@yc\relax%
+ \global\pgf@x=\pgfmathresult\pgf@xc%
+ \global\pgf@y=\pgfmathresult\pgf@yc\relax%
}
% Store the vector #1 * x-vec + #2 * y-vec
%
% #1 = a factor for the x-vector
-% #2 = a factor fot the y-vector
+% #2 = a factor for the y-vector
%
% x = x-component of result vector
% y = y-component of result vector
%
% Description:
-%
+%
% This command can be used to create a new coordinate system
% without using the rotate/translate/scale commands. This
% may be useful, if you do not want arrows and line width to
% be scaled/transformed together with the coordinate system.
-%
+%
% Example:
%
% % Create a slanted rectangle
%
% \pgfsetxvec{\pgfpoint{1cm}{1cm}}
% \pgfsetyvec{\pgfpoint{0cm}{1cm}}
-%
+%
% \pgfpathmoveto{\pgfpointxy{0}{0}}
% \pgfpathlineto{\pgfpointxy{1}{0}}
% \pgfpathlineto{\pgfpointxy{1}{1}}
@@ -802,40 +802,40 @@
\let\pgftemp@x=\pgfmathresult%
\pgfmathparse{#2}%
\let\pgftemp@y=\pgfmathresult%
- \pgf@x=\pgftemp@x\pgf@xx%
- \advance\pgf@x by \pgftemp@y\pgf@yx%
- \pgf@y=\pgftemp@x\pgf@xy%
- \advance\pgf@y by \pgftemp@y\pgf@yy}
+ \global\pgf@x=\pgftemp@x\pgf@xx%
+ \global\advance\pgf@x by \pgftemp@y\pgf@yx%
+ \global\pgf@y=\pgftemp@x\pgf@xy%
+ \global\advance\pgf@y by \pgftemp@y\pgf@yy}
% "Quick" variant for \pgfpointxy.
%
% Only numbers without unit are allowed here.
\def\pgfqpointxy#1#2{%
- \pgf@x=#1\pgf@xx%
- \advance\pgf@x by #2\pgf@yx%
- \pgf@y=#1\pgf@xy%
- \advance\pgf@y by #2\pgf@yy}
+ \global\pgf@x=#1\pgf@xx%
+ \global\advance\pgf@x by #2\pgf@yx%
+ \global\pgf@y=#1\pgf@xy%
+ \global\advance\pgf@y by #2\pgf@yy}
% Store the vector #1 * x-vec + #2 * y-vec + #3 * z-vec
%
% #1 = a factor for the x-vector
-% #2 = a factor fot the y-vector
-% #3 = a factor fot the z-vector
+% #2 = a factor for the y-vector
+% #3 = a factor for the z-vector
%
% x = x-component of result vector
% y = y-component of result vector
%
%
% Description:
-%
+%
% This command allows you to use a 3d coordinate system.
-%
+%
%
% Example:
%
% % Draw a cubus
-%
+%
% \pgfline{\pgfpointxyz{0}{0}{0}}{\pgfpointxyz{0}{0}{1}}
% \pgfline{\pgfpointxyz{0}{1}{0}}{\pgfpointxyz{0}{1}{1}}
% \pgfline{\pgfpointxyz{1}{0}{0}}{\pgfpointxyz{1}{0}{1}}
@@ -856,23 +856,23 @@
\let\pgftemp@y=\pgfmathresult%
\pgfmathparse{#3}%
\let\pgftemp@z=\pgfmathresult%
- \pgf@x=\pgftemp@x\pgf@xx%
- \advance\pgf@x by \pgftemp@y\pgf@yx%
- \advance\pgf@x by \pgftemp@z\pgf@zx%
- \pgf@y=\pgftemp@x\pgf@xy%
- \advance\pgf@y by \pgftemp@y\pgf@yy%
- \advance\pgf@y by \pgftemp@z\pgf@zy}
+ \global\pgf@x=\pgftemp@x\pgf@xx%
+ \global\advance\pgf@x by \pgftemp@y\pgf@yx%
+ \global\advance\pgf@x by \pgftemp@z\pgf@zx%
+ \global\pgf@y=\pgftemp@x\pgf@xy%
+ \global\advance\pgf@y by \pgftemp@y\pgf@yy%
+ \global\advance\pgf@y by \pgftemp@z\pgf@zy}
% "Quick" variant for \pgfpointxyz.
%
% Only numbers without unit are allowed.
\def\pgfqpointxyz#1#2#3{%
- \pgf@x=#1\pgf@xx%
- \advance\pgf@x by #2\pgf@yx%
- \advance\pgf@x by #3\pgf@zx%
- \pgf@y=#1\pgf@xy%
- \advance\pgf@y by #2\pgf@yy%
- \advance\pgf@y by #3\pgf@zy}
+ \global\pgf@x=#1\pgf@xx%
+ \global\advance\pgf@x by #2\pgf@yx%
+ \global\advance\pgf@x by #3\pgf@zx%
+ \global\pgf@y=#1\pgf@xy%
+ \global\advance\pgf@y by #2\pgf@yy%
+ \global\advance\pgf@y by #3\pgf@zy}
@@ -946,7 +946,7 @@
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\ifdim\pgf@x<0pt\relax% move into first quadrant
- \pgf@x=-\pgf@x%
+ \global\pgf@x=-\pgf@x%
\fi%
\ifdim\pgf@y<0pt\relax%
\pgf@y=-\pgf@y%
@@ -958,29 +958,29 @@
\ifnum\c@pgf@counta=0\relax%
\c@pgf@counta=1\relax%
\fi%
- \divide\pgf@x by\c@pgf@counta%
- \divide\pgf@y by\c@pgf@counta%
+ \global\divide\pgf@x by\c@pgf@counta%
+ \global\divide\pgf@y by\c@pgf@counta%
\divide\pgf@xa by\c@pgf@counta%
\divide\pgf@ya by\c@pgf@counta%
% ok.
- \pgf@x=.125\pgf@x%
- \pgf@y=.125\pgf@y%
+ \global\pgf@x=.125\pgf@x%
+ \global\pgf@y=.125\pgf@y%
\c@pgf@counta=\pgf@x%
\c@pgf@countb=\pgf@y%
\multiply\c@pgf@countb by 100%
\ifnum\c@pgf@counta<64\relax%
- \pgf@x=1pt\relax%
- \pgf@y=0pt\relax%
+ \global\pgf@x=1pt\relax%
+ \global\pgf@y=0pt\relax%
\else%
\divide\c@pgf@countb by \c@pgf@counta%
- \pgf@x=\csname pgf@cosfrac\the\c@pgf@countb\endcsname pt%
+ \global\pgf@x=\csname pgf@cosfrac\the\c@pgf@countb\endcsname pt%
\pgf@xc=8192pt%
\divide\pgf@xc by\c@pgf@counta%
- \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@ya%
- \pgf@y=\pgf@sys@tonumber{\pgf@x}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@ya%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@x}\pgf@y%
\fi%
\ifdim\pgf@xa<0pt%
- \pgf@x=-\pgf@x%
+ \global\pgf@x=-\pgf@x%
\fi%
\else% x <= y
% make point small
@@ -989,29 +989,29 @@
\ifnum\c@pgf@counta=0\relax%
\c@pgf@counta=1\relax%
\fi%
- \divide\pgf@x by\c@pgf@counta%
- \divide\pgf@y by\c@pgf@counta%
+ \global\divide\pgf@x by\c@pgf@counta%
+ \global\divide\pgf@y by\c@pgf@counta%
\divide\pgf@xa by\c@pgf@counta%
\divide\pgf@ya by\c@pgf@counta%
% ok.
- \pgf@x=.125\pgf@x%
- \pgf@y=.125\pgf@y%
+ \global\pgf@x=.125\pgf@x%
+ \global\pgf@y=.125\pgf@y%
\c@pgf@counta=\pgf@y%
\c@pgf@countb=\pgf@x%
\multiply\c@pgf@countb by 100%
\ifnum\c@pgf@counta<64\relax%
- \pgf@y=1pt\relax%
- \pgf@x=0pt\relax%
+ \global\pgf@y=1pt\relax%
+ \global\pgf@x=0pt\relax%
\else%
\divide\c@pgf@countb by \c@pgf@counta%
- \pgf@y=\csname pgfmath@cosfrac@\the\c@pgf@countb\endcsname pt%
+ \global\pgf@y=\csname pgfmath@cosfrac@\the\c@pgf@countb\endcsname pt%
\pgf@xc=8192pt%
\divide\pgf@xc by\c@pgf@counta%
- \pgf@x=\pgf@sys@tonumber{\pgf@xc}\pgf@xa%
- \pgf@x=\pgf@sys@tonumber{\pgf@y}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xc}\pgf@xa%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@y}\pgf@x%
\fi%
\ifdim\pgf@ya<0pt%
- \pgf@y=-\pgf@y%
+ \global\pgf@y=-\pgf@y%
\fi%
\fi\ignorespaces%
}
@@ -1043,10 +1043,10 @@
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\ifnum\pgf@xa<0\relax% move into first quadrant
- \pgf@x=-\pgf@x%
+ \global\pgf@x=-\pgf@x%
\fi%
\ifnum\pgf@ya<0\relax%
- \pgf@y=-\pgf@y%
+ \global\pgf@y=-\pgf@y%
\fi%
\pgf@xc=.125\pgf@x%
\pgf@yc=.125\pgf@y%
@@ -1054,62 +1054,62 @@
\c@pgf@countb=\pgf@yc%
\ifnum\c@pgf@countb<\c@pgf@counta%
\ifnum\c@pgf@counta<255\relax%
- \pgf@y=\pgf@yb\relax%
- \pgf@x=0pt\relax%
+ \global\pgf@y=\pgf@yb\relax%
+ \global\pgf@x=0pt\relax%
\else%
\pgf@xc=8192pt%
\divide\pgf@xc by\c@pgf@counta% \pgf@xc = 1/\pgf@x
- \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
- \pgf@y=\pgf@sys@tonumber{\pgf@xb}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xb}\pgf@y%
\ifnum\pgf@y<\pgf@yb%
- \pgf@x=\pgf@xb%
+ \global\pgf@x=\pgf@xb%
\else% rats, calculate intersection on upper side
\ifnum\c@pgf@countb<255\relax%
- \pgf@x=\pgf@xb\relax%
- \pgf@y=0pt\relax%
+ \global\pgf@x=\pgf@xb\relax%
+ \global\pgf@y=0pt\relax%
\else%
\pgf@yc=8192pt%
\divide\pgf@yc by\c@pgf@countb% \pgf@xc = 1/\pgf@x
- \pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
- \pgf@x=\pgf@sys@tonumber{\pgf@yb}\pgf@x%
- \pgf@y=\pgf@yb%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@yb}\pgf@x%
+ \global\pgf@y=\pgf@yb%
\fi%
- \fi%
+ \fi%
\fi%
\else%
\ifnum\c@pgf@countb<255\relax%
- \pgf@x=\pgf@xb\relax%
- \pgf@y=0pt\relax%
+ \global\pgf@x=\pgf@xb\relax%
+ \global\pgf@y=0pt\relax%
\else%
\pgf@yc=8192pt%
\divide\pgf@yc by\c@pgf@countb% \pgf@xc = 1/\pgf@x
- \pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
- \pgf@x=\pgf@sys@tonumber{\pgf@yb}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@yb}\pgf@x%
\ifnum\pgf@x<\pgf@xb%
- \pgf@y=\pgf@yb%
+ \global\pgf@y=\pgf@yb%
\else%
\ifnum\c@pgf@counta<255\relax%
- \pgf@y=\pgf@yb\relax%
- \pgf@x=0pt\relax%
+ \global\pgf@y=\pgf@yb\relax%
+ \global\pgf@x=0pt\relax%
\else%
\pgf@xc=8192pt%
\divide\pgf@xc by\c@pgf@counta% \pgf@xc = 1/\pgf@x
- \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
- \pgf@y=\pgf@sys@tonumber{\pgf@xb}\pgf@y%
- \pgf@x=\pgf@xb%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xb}\pgf@y%
+ \global\pgf@x=\pgf@xb%
\fi%
- \fi%
+ \fi%
\fi%
- \fi%
- \ifnum\pgf@xa<0\relax\pgf@x=-\pgf@x\fi%
- \ifnum\pgf@ya<0\relax\pgf@y=-\pgf@y\fi%
+ \fi%
+ \ifnum\pgf@xa<0\relax\global\pgf@x=-\pgf@x\fi%
+ \ifnum\pgf@ya<0\relax\global\pgf@y=-\pgf@y\fi%
}
% An approximation to a point on an ellipse in a certain
-% direction. Will be exact only if the ellipse is a circle.
+% direction. Will be exact only if the ellipse is a circle.
%
% #1 = a point pointing in some direction
% #2 = upper right corner of a bounding box for the ellipse
@@ -1128,44 +1128,44 @@
\pgf@ya=\pgf@y%
\ifdim\pgf@xa=\pgf@ya% circle. that's easy!
\pgf@process{\pgfpointnormalised{#1}}%
- \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
- \pgf@y=\pgf@sys@tonumber{\pgf@xa}\pgf@y%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xa}\pgf@y%
\else%
\ifdim\pgf@xa<\pgf@ya%
% Ok, first, let's compute x/y:
\c@pgf@countb=\pgf@ya%
\divide\c@pgf@countb by65536\relax%
- \divide\pgf@x by\c@pgf@countb%
- \divide\pgf@y by\c@pgf@countb%
+ \global\divide\pgf@x by\c@pgf@countb%
+ \global\divide\pgf@y by\c@pgf@countb%
\pgf@xc=\pgf@x%
\pgf@yc=8192pt%
- \pgf@y=.125\pgf@y%
+ \global\pgf@y=.125\pgf@y%
\c@pgf@countb=\pgf@y%
\divide\pgf@yc by\c@pgf@countb%
\pgf@process{#1}%
- \pgf@y=\pgf@sys@tonumber{\pgf@yc}\pgf@y%
- \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@yc}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
\pgf@process{\pgfpointnormalised{}}%
- \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
- \pgf@y=\pgf@sys@tonumber{\pgf@ya}\pgf@y%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@ya}\pgf@y%
\else%
% Ok, now let's compute y/x:
\c@pgf@countb=\pgf@xa%
\divide\c@pgf@countb by65536\relax%
- \divide\pgf@x by\c@pgf@countb%
- \divide\pgf@y by\c@pgf@countb%
+ \global\divide\pgf@x by\c@pgf@countb%
+ \global\divide\pgf@y by\c@pgf@countb%
\pgf@yc=\pgf@y%
\pgf@xc=8192pt%
- \pgf@x=.125\pgf@x%
+ \global\pgf@x=.125\pgf@x%
\c@pgf@countb=\pgf@x%
\divide\pgf@xc by\c@pgf@countb%
\pgf@process{#1}%
- \pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
- \pgf@x=\pgf@sys@tonumber{\pgf@xc}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xc}\pgf@x%
\pgf@process{\pgfpointnormalised{}}%
- \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
- \pgf@y=\pgf@sys@tonumber{\pgf@ya}\pgf@y%
- \fi%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@ya}\pgf@y%
+ \fi%
\fi%
}
@@ -1174,7 +1174,7 @@
% Extract the x-coordinate of a point to a dimensions
-%
+%
% #1 = a TeX dimension
% #2 = a point
%
@@ -1190,7 +1190,7 @@
% Extract the y-coordinate of a point to a dimensions
-%
+%
% #1 = a TeX dimension
% #2 = a point
%
@@ -1205,11 +1205,10 @@
#1=\pgf@y\relax}
-% Stores the most recently used (x,y) coordinates into two macros, #1
-% and #2.
+% Stores the most recently used (x,y) coordinates into two macros, #1 and #2.
\def\pgfgetlastxy#1#2{%
- \edef#1{\the\pgf@x}%
- \edef#2{\the\pgf@y}%
+ \edef#1{\the\pgf@x}%
+ \edef#2{\the\pgf@y}%
}%