Node Operations

Denis Girou Denis.Girou at idris.fr
Mon Jan 25 19:28:14 CET 1999


-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

>>>>> "S.Kundu" == SLK  <nasipuri at giascl01.vsnl.net.in> writes:

    S.Kundu> I have drawn a rectangular node. Is it possible to draw a line [without
    S.Kundu> specifying coordinates] which will snap to one of the specified corner
    S.Kundu> points of the rectangle?

  This is an interesting point. The answer is yes. Look at the following
example and see also the paragraph 34 of the documentation (Special
coordinates), page 72. Nodes with special coordinates is a powerful mechanism,
but I agree that documentation is rather short and lack of more examples.

  If you need to make the computations inside the code, you can compute the
arctangent values using the `fp' package (perhaps other ones too).

\documentclass{article}

\usepackage{pstcol}
\usepackage{pst-node}

\pagestyle{empty}

\begin{document}

\psset{dimen=middle,subgriddiv=0,griddots=5}

\SpecialCoor

\begin{pspicture}(7,7)\psgrid
  \fnode[framesize=2 4,linecolor=red](2,3){X}
  \rput(X){\qdisk(0,0){0.2}}
  \rput([angle=-116.565]X){\LARGE a} % t=atan(2/4)=26.565 ; -90-t
  \rput([angle=116.565]X){\LARGE b}  % 90+t
  \rput([angle=63.435]X){\LARGE c}   % 90-t
  \rput([angle=-63.435]X){\LARGE d}  % -90+t
%
  \fnode[framesize=2 2,linecolor=cyan](5,5){Y}
  \rput([angle=-135]Y){\LARGE A}     % t=atan(2/2)=45 ; -90-t
  \rput([angle=135]Y){\LARGE B}      % 90+t
  \rput([angle=45]Y){\LARGE C}       % 90-t
  \rput([angle=-45]Y){\LARGE D}      % -90+t
%
  \fnode[framesize=2 1,linecolor=green](5,1){Z}
  \rput([angle=-153.435]Z){\LARGE\textcolor{red}{$\bullet$}}
                                     % t=atan(2/1)=63.435 ; -90-t
  \rput([angle=153.435]Z){\LARGE\textcolor{blue}{$\bullet$}}   % 90+t
  \rput([angle=26.565]Z){\LARGE\textcolor{magenta}{$\bullet$}} % 90-t
  \rput([angle=-26.565]Z){\LARGE\textcolor{yellow}{$\bullet$}} % -90+t
%
  \psline{->}(1,0)([angle=-26.565]Z)
  \psline[linewidth=0.1]{<->}([angle=153.435]Z)([angle=-45]Y)
\end{pspicture}

\end{document}

Denis Girou
--
---------------------------------------------------------------------------
Institut du De'veloppement et des Ressources en Informatique Scientifique |
Centre National de la Recherche Scientifique                              |
Ba^timent 506 - B.P. 167 - 91403 Orsay Cedex - France                     |
---------------------------------------------------------------------------

-----------------------------------------------------------------------------
The list interface (subscription, information, access to the archives) is on:
http://www.tug.org/cgi-bin/lwgate/pstricks
Otherway to unsubscribe, send mail to pstricks-request at mail.tug.org
with a blank subject and in body the line unsubscribe <email-address>
-----------------------------------------------------------------------------



More information about the PSTricks mailing list