trig(3M) DG/UX 5.4R3.00 trig(3M)
NAME
trig: sin, sinf, cos, cosf, tan, tanf, asin, asinf, acos, acosf,
atan, atanf, atan2, atan2f - trigonometric functions
SYNOPSIS
cc [flag ...] file ... -lm [library ...]
#include <math.h>
double sin (double x);
float sinf (float x);
double cos (double x);
float cosf (float x);
double tan (double x);
float tanf (float x);
double asin (double x);
float asinf (float x);
double acos (double x);
float acosf (float x);
double atan (double x);
float atanf (float x);
double atan2 (double y, double x);
float atan2f (float y, float x);
DESCRIPTION
sin, cos, and tan and the single-precision versions sinf, cosf, and
tanf return, respectively, the sine, cosine, and tangent of their
argument, x, measured in radians.
In the following paragraphs, pi represents pi.
asin and asinf return the arcsine of x, in the range [-pi/2,+pi/2].
acos and acosf return the arccosine of x, in the range [0,+pi].
atan and atanf return the arctangent of x, in the range
(-pi/2,+pi/2).
atan2 and atan2f return the arctangent of y/x, in the range
(-pi,+pi], using the signs of both arguments to determine the
quadrant of the return value.
Licensed material--property of copyright holder(s) 1
trig(3M) DG/UX 5.4R3.00 trig(3M)
Those functions using float arguments, sinf, cosf, tanf, asinf,
acosf, atanf, and atan2f, will give unpredictable results when used
with the -Xt (which is the default) compilation option. In
traditional compilation mode float arguments are promoted to doubles.
An object compiled with -Xt will expect this promotion and therefore
not work correctly with these functions.
Considerations for Threads Programming
+---------+-----------------------------+
| | async- |
|function | reentrant cancel cancel |
| | point safe |
+---------+-----------------------------+
|acos | Y N N |
|acosf | Y N N |
|asin | Y N N |
|asinf | Y N N |
|atan | Y N N |
|atan2 | Y N N |
|atan2f | Y N N |
|atanf | Y N N |
|cos | Y N N |
|cosf | Y N N |
|sin | Y N N |
|sinf | Y N N |
|tan | Y N N |
|tanf | Y N N |
+---------+-----------------------------+
SEE ALSO
cc(1). reentrant(3), matherr(3M).
DIAGNOSTICS
If the magnitude of the argument of asin, asinf, acos, or acosf is
greater than 1, or if both arguments of atan2 or atan2f are 0, 0 is
returned and errno is set to EDOM. In addition, a message indicating
DOMAIN error is printed on the standard error output.
Except when the -Xc compilation option is used, these error-handling
procedures may be changed with the function matherr. When the -Xa or
-Xc compilation options are used, no error messages are printed.
Licensed material--property of copyright holder(s) 2