[pstricks] basic arithmetics in pstricks without defining nodes
Juergen Gilg
gilg at acrotex.net
Fri Nov 9 09:20:11 CET 2007
Hi Patrick,
another possible approach just came into my mind. Using the 'fp-package'.
Some easy arithmetic operations are possible.
\documentclass{article}
\usepackage{pstricks,pstricks-add}
\usepackage[nomessages]{fp}
\begin{document}
\def\MyRadius{0.7}
\FPmul{\MyDiameter}{\MyRadius}{2}
\begin{pspicture}(-4,-4)(4,4)
\psset{unit=1cm}
\SpecialCoor
\psline(\MyRadius,0)(\MyDiameter,0)
\end{pspicture}
\end{document}
Regards,
Juergen
Patrick Drechsler wrote:
> Hi,
>
> how do I do simple arithmetics in tex and use them in pstricks?
>
> I am thinking along the lines of:
>
> \SpecialCoor%
> \def\MyRadius{0.7cm}%
> \def\MyDiameter{! \MyRadius 2 mul}%
> %
> \psline(\MyRadius,0)(\MyDiameter,0)
>
> I know this will not work. I am wondering what the correct approach
> would look like...
>
> TIA,
>
> Patrick
>
--
jürgen gilg
austr. 59
70376 stuttgart
tel 0711-59 27 88
e-mail gilg at acrotex.net
website www.acrotex.net
www.gilligan-online.de
www.brueckenkurs-physik.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/pstricks/attachments/20071109/22e12469/attachment.html
More information about the PSTricks
mailing list