[pstricks] \psLCNode variant
Michael Sharpe
msharpe at ucsd.edu
Thu Oct 2 05:54:33 CEST 2008
Herbert,
Here is a small variant of your \psLCNode macro from pstricks-add. I
have found it useful because it allows the coefficients in the linear
combination (#3) to be specified in any manner acceptable as
\SpecialCoor coordinates. (The Postscript form is especially useful
in practice.)
\makeatletter
% build the linear combination #3[1]]*#1+#3[[2]]*#2=#4
\def\psLCNodeVar(#1)(#2)(#3)#4{%
\pst at getcoor{#1}\pst at tempA%
\pst at getcoor{#2}\pst at tempB%
\pnode(#3){tmpn at de}
\pnode(!%
\pst at tempA /YA exch \pst at number\psyunit div def
/XA exch \pst at number\psxunit div def
\pst at tempB /YB exch \pst at number\psyunit div def
/XB exch \pst at number\psxunit div def %stack now empty
\psGetNodeCenter{tmpn at de}\space tmpn at de.x tmpn at de.y
XA tmpn at de.x mul XB tmpn at de.y mul add
YA tmpn at de.x mul YB tmpn at de.y mul add){#4}%
}
\makeatother
Michael
More information about the PSTricks
mailing list