[pstricks] Outputting a particular value of a function using PSTricks

dpstory at uakron.edu dpstory at uakron.edu
Sat Sep 17 16:24:06 CEST 2005


Many thanks, I'll look into the pstricks solution first.

dps

On 17 Sep 2005 at 15:07, Herbert Voss wrote:

> dpstory at uakron.edu wrote:
> > Hi all,
> > 
> > Is there a way of computing a particular value of a function, say sin(20), using PSTricks?
> > 
> > I wish to typset a sentence like:
> > 
> > y-coordinate:  sin(20)
> > 
> > This is part of a multido that is reading out the x and y coordinates in an animation we are 
> > trying to build.
> 
> for a TeX solution use the fp package or for a PS solution
> the following code
> 
> Herbert
> 
> 
> \documentclass[12pt]{article}
> \usepackage{pstricks,multido}
> %
> \def\printValue#1{%
>    \pstVerb{gsave /Times findfont 100 scalefont setfont #1 10 string cvs 
> 1 -1 scale show grestore}}
> %
> \parindent=0pt
> \begin{document}
> 
> \makebox[2em]{\#} \makebox[5em]{$sin x$} \makebox[5em]{$cos x$}
>                    \makebox[5em]{$\sqrt x$}\makebox[6em]{$sin^2 x+cos^2 
> x$}\\[3pt]
> \multido{\iA=0+10}{36}{
>      \makebox[1em]{\iA}
>      \makebox[5em]{\printValue{\iA\space sin}}
>      \makebox[5em]{\printValue{\iA\space cos}}
>      \makebox[5em]{\printValue{\iA\space sqrt}}
>      \makebox[6em]{\printValue{\iA\space dup sin dup mul exch cos dup 
> mul add}}\\}
> 
> \end{document}
> 
> 
> _______________________________________________
> pstricks mailing list
> pstricks at tug.org
> http://tug.org/mailman/listinfo/pstricks





More information about the PSTricks mailing list