Mail Archives: djgpp/1998/05/27/10:02:24
Nate Eldredge (nate AT cartsys DOT com) wrote:
> At 01:25 5/26/1998 GMT, Darryl Matthews wrote:
> >What is the DJGPP equivalent (or code fragment) for the atanpi( ) function?
> I haven't seen that before, but if you'll explain what it does, it'd be
> easier to come up with an equivalent.
From the Solaris man page (the occurrances of `[pi]' actually were
`-^Hn'):
trig_sun(3M) Mathematical Library trig_sun(3M)
NAME
trig_sun, sincos, sind, cosd, tand, asind, acosd, atand,
atan2d, sincosd, sinp, cosp, tanp, asinp, acosp, atanp, sin-
cosp, sinpi, cospi, tanpi, asinpi, acospi, atanpi, atan2pi,
sincospi - more trigonometric functions
SYNOPSIS
cc [ flag ... ] file ... -lsunmath -lm [ library ... ]
#include <sunmath.h>
...
double tanpi(double x);
...
DESCRIPTION
...
sinpi(x), cospi(x), and tanpi(x) avoid range-reduction
issues because their definition sinpi(x):=sin([pi]*x) permits
range reduction that is fast and exact for all x. The
corresponding inverse functions compute asinpi(x):= asin(x)/
[pi]. Similarly atan2pi(y,x):= atan2(y,x)/[pi].
...
So I think this will suffice (untested!):
#include <math.h>
#define atanpi(x) (atan(x) / M_PI)
--
Groeten, Michel. http://www.cs.vu.nl/~mdruiter
____________
\ /====\ / "You know, Beavis, you need things that suck,
\/ \/ to have things that are cool", Butt-Head.
- Raw text -