01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

TRIG ( 3M ) TRIG ( 3M)<br />

NAME<br />

sin, cos, tan, asin, acos, atan, atan2 - trigonometric functions<br />

SYNOPSIS<br />

#include < ma.th.h ><br />

double sin (x)<br />

double x;<br />

double cos (x)<br />

double x;<br />

double ta.n (x)<br />

double x;<br />

double asin (x)<br />

double x;<br />

double acos (x)<br />

double x;<br />

double a.ta.n (x)<br />

double x;<br />

double a.ta.n2 (y, x)<br />

double x, y;<br />

DESCRIPTION<br />

Sin , cos and tan return respectively the sine, cosine and tangent<br />

of their argument, which is in radians.<br />

Asin returns the arcsine of x, in the range -7r/2 to 7r/2.<br />

A cos returns the arccosine of x, in the range 0 to 1r.<br />

Atan returns the arctangent of x, in the range -7r/2 to 7r/2.<br />

Atan2 returns the arctangent of y/x, in the range -1r to 1r, using<br />

the signs of both arguments to determine the quadrant of the<br />

return value.<br />

DIAGNOSTICS<br />

Sin , cos and tan lose accuracy when their argument is far from<br />

zero. For arguments sufficiently large, these functions return 0<br />

when there would otherwise be a complete loss of significance. In<br />

this case a message indicating TLOSS error is printed on the standard<br />

error output. For less extreme arguments, a PLOSS error is<br />

generated but no message is printed. In both cases, errno is set to<br />

ERANGE.<br />

Tan returns HUGE for an argument which is near an odd multiple<br />

of 7r/2 when the correct value would overflow, and sets errno<br />

to ERANGE.<br />

Arguments of magnitude greater than 1.0 cause asin and acos to<br />

return 0 and to set errno to EDOM. In addition, a message indicating<br />

DOMAIN error is printed on the standard error output.<br />

These error-handling procedures may be changed with the function<br />

matherr(3M) .<br />

SEE ALSO<br />

matherr(3M).<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!