diff options
author | Karl Berry <karl@freefriends.org> | 2010-10-29 00:31:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-10-29 00:31:31 +0000 |
commit | 6bc1f5497cfb2f56d65c80a4c36ea3bad6dc046c (patch) | |
tree | f7751da75030fb1e06653eeb44e579fcee09c65f /Master/texmf-dist/tex/generic/pgf/rendering/pgfrenderpoints.code.tex | |
parent | ed0c7c756e441b2d2ba3633da233fc24361ac0d3 (diff) |
pgf 2.10 (28oct10)
git-svn-id: svn://tug.org/texlive/trunk@20236 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/rendering/pgfrenderpoints.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/rendering/pgfrenderpoints.code.tex | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/rendering/pgfrenderpoints.code.tex b/Master/texmf-dist/tex/generic/pgf/rendering/pgfrenderpoints.code.tex new file mode 100644 index 00000000000..48d36bae8bf --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/rendering/pgfrenderpoints.code.tex @@ -0,0 +1,138 @@ +% Copyright 2006 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 $Header: /cvsroot/pgf/pgf/generic/pgf/rendering/pgfrenderpoints.code.tex,v 1.2 2007/03/09 17:49:33 tantau Exp $ + + + + + +% Create a 3D point +% +% #1 = macro name in which the point object should be stored +% #2 to #4 = x-, y- and z-coordinate of the point +% +% Note: +% +% The quick version does not call \setlength and is faster. +% +% Example: +% +% \pgfrenderpointcreate{\pgfpoint{2pt+3cm}{3cm}} + +\def\pgfrenderpointcreate#1#2#3#4{% + \pgfmathsetlength\pgf@xa{#2}% + \pgfmathsetlength\pgf@xb{#3}% + \pgfmathsetlength\pgf@xc{#4}% + \pgfqrenderpointcreate{\the\pgf@xa}{\the\pgf@xb}{\the\pgf@xc}% +} + +\def\pgfqrenderpointcreate#1#2#3#4{% + \edef#1{\pgf@xa=#2\relax\pgf@xb=#3\pgf@xc=#4\relax}% +} + +\def\pgf@render@unpack#1{% + #1% +} + + +% The origin point object +% +% Description: +% +% This object is always the origin. +% + +\pgfqrenderpointcreate\pgfrenderobjorigin{0pt}{0pt}{0pt} + + + + +% Add two 3D vectors +% +% #1 = name of new vector (may be one of the input) +% #2 = name of first vector +% #3 = name of second vector +% +% Description: +% +% The points #2 and #3 are added and the result is stored in #1. If #1 +% equals either #2 or #3, to point is overwritten. +% +% Example: +% +% \pgfrenderpointcreate{\myvec}{1cm}{2cm}{3cm} +% \pgfrenderpointcreate{\offset}{1cm}{0cm}{0cm} +% \pgfrenderpointadd{\myvec}{\myvec}{\offset} + +\def\pgfrenderpointadd#1#2#3{% + \pgf@render@unpack#2% + \pgf@ya=\pgf@xa% + \pgf@yb=\pgf@xb% + \pgf@yc=\pgf@xc% + \pgf@render@unpack#3% + \advance\pgf@xa by\pgf@ya% + \advance\pgf@xb by\pgf@yb% + \advance\pgf@xc by\pgf@yc% + \pgfqrenderpointcreate#1{\the\pgf@xa}{\the\pgf@xb}{\the\pgf@xc}% +} + + +% Scale a 3D vectors +% +% #1 = name of new vector (may be one of the input) +% #2 = scale +% #3 = name of vector to be scaled +% +% Description: +% +% Sets #1 := #2*#3. +% +% Example: +% +% \pgfrenderpointcreate{\myvec}{1cm}{2cm}{3cm} +% \pgfrenderpointscale{\myvec}{2}{\myvec} + +\def\pgfrenderpointscale#1#2#3{% + \pgf@render@unpack#3% + \pgf@xa=#2\pgf@xa% + \pgf@xb=#2\pgf@xb% + \pgf@xc=#2\pgf@xc% + \pgfqrenderpointcreate#1{\the\pgf@xa}{\the\pgf@xb}{\the\pgf@xc}% +} + + + + +% Project a 3D point to 2D +% +% #1 = 3D point object +% +% Description: +% +% This command takes a 3D point object and sets \pgf@x to the x-value +% of the point and \pgf@y to the y-value. +% +% Example: +% +% \pgfpointprojection{\mypoint} + +\def\pgfpointprojection#1{% + \pgf@render@unpack{#1}% + \pgf@x=\pgf@xa% + \pgf@y=\pgf@ya% +} + + + + + + + +\endinput |