[pstricks] perpendicular line similar to \Parallel (pst-optic)

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Sat Oct 23 21:47:20 CEST 2004


Patrick Drechsler wrote:

> After including your code into parts of my real document and
> reducing it there are 2 problems left (:
> 
> 1) The node output of your macro being created by
>    `\psperpendicularLine' is not correct (main problem).
> 
> 2) If `xunit' and `yunit' are not the same the result changes
>    (obviously... -- I don't even have the time to understand and
>    study your definition of \psperpendicularLine...)

try this one

Herbert


\makeatletter
\def\psperpendicularLine{\pst at object{psperpendicularLine}}
\def\psperpendicularLine at i(#1)(#2)#3#4{{
     \use at par
     \pnode(!
     tx at NodeDict begin
       /N@#1 load GetCenter
       \pst at number\psyunit div /YA exch def
       \pst at number\psxunit div /XA exch def
       /N@#2 load GetCenter
       \pst at number\psyunit div /YB exch def
       \pst at number\psxunit div /XB exch def
       YB YA sub #3 mul neg \pst at number\psyunit \pst at number\psxunit div 
mul XA add
       XB XA sub #3 mul \pst at number\psxunit \pst at number\psyunit div mul 
YA add
     end){#4}%
     \psline(#1)(#4)
   }\ignorespaces}
\makeatother





-- 
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes




More information about the PSTricks mailing list