[pstricks] pst-3d and fp

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Wed Apr 14 15:32:40 CEST 2004


Chris Sangwin wrote:

> I really do need to perform the floating point calculations within the
> LaTeX document, which is of course very much in the spirit of
> computational graphics!
> 
> I'd be happy to change to another package other than fp, but I do need
> sin, cos, exp, log etc so that fltpoint and realcalc don't seem to offer
> me a solution.

try the follwing solution, which works

Herbert


\documentclass[a4paper]{article}
\usepackage{pst-3d}
\usepackage{multido}
%April 1, 2002
% Avec les remarques et les modifications de Denis Girou de 27 mars 2002
%
% Hack for `fp' / `multido' clash when using \n.. multido indices
\makeatletter
\let\FPaddMultiDo\FPadd
\let\FPsubMultiDo\FPsub
\def\multido at init@n#1#2#3{%
   \edef#3{#1}%
   \ifnum\multido at count<\z@
     \expandafter\FPsubMultiDo%
   \else\expandafter
     \FPaddMultiDo%
   \fi
   {0}{#2}\multido at temp
   \multido at addtostep{\do\FPaddMultiDo{\do#3}{\multido at temp}{\do#3}}}
\makeatother

\usepackage[nomessages]{fp}

\pagestyle{empty}
\begin{document}

\begin{pspicture*}(\linewidth,2)
\def\Bar{\psframe(0,0)(0.25,2)}
\multido{\nA=10+10}{17}{\rput(0.5\linewidth,0){\psTilt{\nA}{\Bar}}}
\end{pspicture*}

\end{document}



-- 
http://TeXnik.de/
http://PSTricks.de/
http://perce.de/LaTeX/math/Mathmode-TeX.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