[pstricks] perpendicular line similar to \Parallel (pst-optic)
Patrick Drechsler
patrick.drechsler at gmx.net
Sat Oct 23 20:37:05 CEST 2004
Hi Herbert!
Patrick Drechsler wrote on 23 Oct 2004 18:10:47 MET:
> Herbert Voss wrote on 23 Oct 2004 17:57:19 MET:
>
>> Patrick Drechsler wrote:
>>
>>> is there a function similar to `\Parallel' from the package
>>> pst-optic for drawing perpendicular lines at a choosen position?
>>> Something like:
>>> \Perpendicular[<Options>](nodeA)(nodeB)(Start Node){Endnode}
>>
>> I did it with
>>
>> \psperpendicularLine[<Options>](nodeA)(nodeB){length}{Endnode}
>
> [snipped working code]
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...)
Am I using your macro incorrectly?
A longer example:
--8<------------------------schnipp------------------------->8---
\listfiles
\documentclass{article}%{beamer}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ngerman}
\usepackage{pst-node}
\usepackage{pst-optic}
% Herberts Loesung fuer Normalengeraden:
\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\space div /YA exch def
\pst at number\psxunit\space div /XA exch def
/N@#2 load GetCenter
\pst at number\psyunit\space div /YB exch def
\pst at number\psxunit\space div /XB exch def
YB YA sub #3 mul neg XA add
XB XA sub #3 mul YA add
end){#4}%
\psline(#1)(#4)
}\ignorespaces}
\makeatother
\begin{document}
%% Stroemungsprofil an Platte
{\centering%
%% NO SCALING: Endnode Fn is wrong
{\psset{unit=7cm}
%% SCALING: ...
% {\psset{xunit=.8\linewidth,yunit=.8\textheight}
\begin{pspicture}(1,1)\psgrid
%% Knoten:
\pnode(.3,.35){Vk}
\pnode(.375,.35){D}
%% Druckseitentangente:
\pnode(0,.4){DST1}
\pnode(1,.18){DST2}
%%
\psline(DST1)(DST2)
%% Anströmrichtung:
\pnode(0,.1){A1}
\pnode(1,.31){A1}
%%
% \psline(A1)(A2)
\ncline{-}{A1}{A2}
\ncput{\small Anströmrichtung $v_{\infty}$}
%% Schnittpunkt = Profil Hinterkante (Hk):
\ABinterCD(A1)(A2)(DST1)(DST2){Hk}
%% FlügelProfil:
\pscurve(Hk)(.4,.38)(Vk)(.36,.33)(.5,.32)(Hk)
%% Tangentialkraft F_T (Endpunkt FtE):
\Parallel[linecolor=red,length=.1,arrows=->,arrowscale=2](Vk)(Hk)(D){FtE}
\rput(FtE){$F_{\mathrm{T}}$}
%% Normalkraft F_N:
%% Herberts Lösung:
%% \psperpendicularLine[<Options>](nodeA)(nodeB){length}{Endnode}
\psperpendicularLine[linecolor=magenta,arrows=->,arrowscale=2](D)(FtE){4}{Fn}
%% Parallele zu F_T: (Fnr1==Fnr2)
\Parallel[linestyle=dashed,length=.1](D)(FtE)(Fn){Fnr1}
%% Parallele zu F_N:
\Parallel[linestyle=dashed,length=.1](D)(Fn)(FtE){Fnr2}
\end{pspicture}
% }%
}
\end{document}
--8<------------------------schnapp------------------------->8---
Gruss
Patrick
,----
| *File List*
| stroemung2.tex
| article.cls 2001/04/21 v1.4e Standard LaTeX document class
| size10.clo 2001/04/21 v1.4e Standard LaTeX file (size option)
| inputenc.sty 2001/07/10 v0.99a Input encoding file
| latin1.def 2001/07/10 v0.99a Input encoding file
| fontenc.sty
| t1enc.def 2001/06/05 v1.94 Standard LaTeX file
| ngerman.sty 1998/07/08 v2.5e Support for writing german texts (br)
| pst-node.sty 2004/07/15 package wrapper for pst-node.tex
| pstricks.sty 2004/05/12 v0.2l LaTeX wrapper for `PSTricks' (RN,HV)
| pstricks.tex 2004/06/22 v1.04 `PSTricks' (tvz)
| xcolor.sty 2004/07/04 v2.00 LaTeX color extensions (UK)
| color.cfg 2001/08/31 v1.1 color configuration of teTeX/TeXLive
| dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
| pst-node.tex 2000/11/09 97 patch 11 `pst-node' (tvz)
| pst-optic.sty 2004/10/18 package wrapper for pst-optic.tex (hv)
| pst-optic.tex 2004/10/23 v0.91 `PST-optic' (hv)
`----
--
Millions long for immortality who do not know what to do with
themselves on a rainy Sunday afternoon.
-- Susan Ertz
More information about the PSTricks
mailing list