[pstricks] Floating point calculations in LaTeX

Chris Sangwin sangwinc at for.mat.bham.ac.uk
Wed Feb 26 16:37:26 CET 2003


I've been a loyal PSTricks user for a number of years, and find myself
typesetting more and more complex figures.  As most of these are highly
mathematical, many of these now involve macros which require floating
point calculations.  This includes sin(x), exp(x), ln(x) etc.  For
example, if you scale part of the diagram, you might need to calculate
some other part using another function.  [See an attached example of a
logarithmic scale I typeset for a class on slide rules!] This is
"computational graphics" in an extreme but I think natural form.

I've taken a number approaches to this including

(1) writing C code to generate the PSTricks & LaTeX!
(2) importing the calculations and defining a stack in LaTeX to avoid
floating point calculations within LaTeX itself.

It occurs to me that the PSTricks package itself would really benefit from
some easily accessible floating point routines, to allow these
calculations to take place within LaTeX.  I've been using the fp package
to perform these calculations within LaTeX, but this clashes with multido,
and the syntax is a little hard to understand.

What other approaches have people taken to this problem?  

Can this be done using postscript?  If so, how does one access these
functions from within LaTeX - I know no PS at all.  Are there methods to
access them from within PSTricks?

Regards
Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: FPlinearDemo.ps
Type: application/postscript
Size: 75793 bytes
Desc: 
Url : http://tug.org/pipermail/pstricks/attachments/20030226/3b3341e0/attachment.ps 


More information about the PSTricks mailing list