diff options
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.tex | 123 |
1 files changed, 98 insertions, 25 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 79cb3a06f77..b546d5df40f 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.20 2010/04/09 08:53:45 ludewich Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepoints.code.tex,v 1.27 2013/10/07 15:51:46 tantau Exp $ \newdimen\pgf@picminx \newdimen\pgf@picmaxx @@ -99,10 +99,6 @@ % point yourself. In the below example, this command is used for a low level % coordinate system shift. % -% In addition to applying the transformation matrix to the given -% point, this function also applies the pre- and post-morphing -% macros. -% % Example: % % \begin{pgflowleveltransformshiftscope}{\pgfpointtransformed{\pgfpointorigin}} @@ -112,9 +108,7 @@ \def\pgfpointtransformed#1{% \pgf@process{% #1% - \pgfmorph@prelist% \pgf@pos@transform{\pgf@x}{\pgf@y}% - \pgfmorph@postlist% }% } @@ -201,7 +195,7 @@ % \pgfpointintersectionoflines{\pgfpointxy{0}{1}}{\pgfpointxy{1}{0}}{\pgfpointxy{2}{2}}{\pgfpointxy{3}{4}} \def\pgfpointintersectionoflines#1#2#3#4{% - { + {% % % Compute orthogonal vector to #1--#2 % @@ -439,6 +433,9 @@ % % x = x-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 % % Example: % @@ -447,14 +444,19 @@ \def\pgfpointlineattime#1#2#3{% \pgf@process{#3}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% + \pgf@xa\pgf@x% + \pgf@ya\pgf@y% + \pgf@xc\pgf@x% + \pgf@yc\pgf@y% \pgf@process{#2}% - \advance\pgf@xa by-\pgf@x\relax% - \advance\pgf@ya by-\pgf@y\relax% - \advance\pgf@x by #1\pgf@xa\relax% - \advance\pgf@y by #1\pgf@ya\relax% - \ignorespaces} + \pgf@xb\pgf@x% + \pgf@yb\pgf@y% + \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% +} % Move point #2 #1 many units in the direction of #3. @@ -462,27 +464,35 @@ % #1 = a distance % #2 = start point % #3 = end point +% +% Description: +% +% Computes % -% x = x-component of start + #1*(normalise(end-start)) -% y = y-component of start + #1*(normalise(end-start)) -% xa = #1*(normalise(end-start)) -% ya = #1*(normalise(end-start)) +% x/y = start + #1*(normalise(end-start)) % -% Example: +% and additionally % +% xa/ya = #1*(normalise(end-start)) +% xb/yb = start +% xc/yc = end +% +% Example: % % \pgfpathmoveto{\pgfpointlineatdistance{2pt}{\pgfpointxy{0}{1}}{\pgfpointxy{2}{3}}} % \pgfpathlineto{\pgfpointlineatdistance{3pt}{\pgfpointxy{2}{3}}{\pgfpointxy{0}{1}}} \def\pgfpointlineatdistance#1#2#3{% + \pgfmathsetlength\pgf@xa{#1}% \pgf@process{#2}% - \pgf@xb=\pgf@x\relax% xb/yb = start point - \pgf@yb=\pgf@y\relax% + \pgf@xb\pgf@x% xb/yb = start point + \pgf@yb\pgf@y% \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% \pgf@process{\pgfpointnormalised{}}% x/y = normalised vector - \pgfmathsetlength\pgf@xa{#1}% \pgf@ya=\pgf@xa\relax% \pgf@xa=\pgf@sys@tonumber{\pgf@x}\pgf@xa% \pgf@ya=\pgf@sys@tonumber{\pgf@y}\pgf@ya% @@ -490,7 +500,7 @@ \pgf@y=\pgf@yb\relax% \advance\pgf@x by\pgf@xa\relax% \advance\pgf@y by\pgf@ya\relax% - \ignorespaces} +} % Returns point on a curve from #2 to #5 with controls #3 and #4 at time #1. @@ -506,7 +516,9 @@ % % Additionally, (\pgf@xa,\pgf@ya) and (\pgf@xb,\pgf@yb) will be on a % tangent to the point on the curve (this can be useful for computing -% a label rotation). +% a label rotation). (\pgf@xc,\pgf@yc) will be equal to the end +% point. \pgf@time@s will equal the value of #1 and \pgf@time@t will +% equal 1-#1. % % Example: % @@ -552,6 +564,58 @@ +% Returns point on an arc at a certain "time" +% +% #1 = a time +% #2 = center of a ellipse +% #3 = 0-degree exis of the ellipse +% #4 = 90-degree exis of the ellipse +% #5 = start angle of an arc on the ellipse +% #6 = end angle of an arc on the ellipse +% +% Result: +% +% \pgf@x = x-component of place on the arc at time t +% \pgf@y = y-component of place on the arc at time t +% +% Additionally, (\pgf@xa,\pgf@ya) will be a tangent to the +% point on the arc (this can be useful for computing a label rotation). +% +% Example: +% +% \pgfpointarcaxesattime{0.25}{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{0cm}}{\pgfpoint{0cm}{1cm}}{1cm}{30}{40} + +\def\pgfpointarcaxesattime#1#2#3#4#5#6{% + \pgfmathsetmacro\pgf@angle@start{#5}% + \pgfmathsetmacro\pgf@angle@end{#6}% + \pgfmathparse{#1}% + \pgf@x=\pgfmathresult pt% + \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}% + \let\pgf@angle@cos\pgfmathresult% + \pgfmathsin@{\pgf@angle@mid}% + \let\pgf@angle@sin\pgfmathresult% + \pgf@process{#3}% + \edef\pgf@angle@zero@axis{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}} + \pgf@process{#4}% + \edef\pgf@angle@ninety@axis{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}} + % Compute tangent + \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% + \else% + \pgf@xa=-\pgf@x% + \pgf@ya=-\pgf@y% + \fi% + % Compute position + \pgf@process{\pgfpointadd{#2}{% + \pgfpointadd{\pgfpointscale{\pgf@angle@cos}{\pgf@angle@zero@axis}}% + {\pgfpointscale{\pgf@angle@sin}{\pgf@angle@ninety@axis}}}}% +} @@ -1202,4 +1266,13 @@ \pgf@def{cosfrac}{97}{0.717792} \pgf@def{cosfrac}{98}{0.714213} \pgf@def{cosfrac}{99}{0.710651} \pgf@def{cosfrac}{100}{0.707107} + + + +% Forward declarations for nonlinear stuff (have no effect till module +% nonlineartransformations is loaded) + +\let\pgfpointtransformednonlinear\pgfpointtransformed + + \endinput |