[texhax] A PSTricks question

Ian Collier imc at comlab.ox.ac.uk
Tue Sep 9 14:29:53 CEST 2003


P.Taylor at rhul.ac.uk writes:
>Looks as if I didn't do the inverse functions after all; here is
>what I did come up with (circa 1991) which may at least serve
>as a starting point ...

>	ftp://ftp.sunsite.auc.dk/disk2/ctan/macros/latex209/contrib/misc/trigonometry.tex

It occurs to me that since TeX is of limited precision anyway, you might
as well just do something of the form:

 \catcode`\@=11 {\catcode`\p=12 \catcode`\t=12 \gdef\n at dimen#1pt{#1}}
 \dimendef\tmp at a=0 \dimendef\tmp at b=2
 \def\Sin#1{\begingroup
  \edef\xval{#1}\tmp at a=\xval pt% value of x
  \tmp at b=\xval\tmp at a \edef\xsquared{\expandafter\n at dimen\the\tmp at b}% x^2
  \tmp at b=0.99999\tmp at a
  \tmp at a=\xsquared\tmp at a
  \advance\tmp at b by -0.166657\tmp at a
  \tmp at a=\xsquared\tmp at a
  \advance\tmp at b by 0.008313\tmp at a
  \tmp at a=\xsquared\tmp at a
  \advance\tmp at b by -0.000185\tmp at a
  \xdef\sine{\expandafter\n at dimen\the\tmp at b}%
  \endgroup}

-- 
---- Ian Collier : imc at comlab.ox.ac.uk : WWW page below
------ http://users.comlab.ox.ac.uk/ian.collier/imc.shtml


More information about the texhax mailing list