up | Inhaltsverzeichniss | Kommentar

Manual page for TRIG(3M)

sin, cos, tan, asin, acos, atan, atan2 - trigonometric functions

SYNOPSIS

#include <math.h>

double sin(x) double x;

double cos(x) double x;

void sincos(x, s, c) double x, *s, *c;

double tan(x) double x;

double asin(x) double x;

double acos(x) double x;

double atan(x) double x;

double atan2(y, x) double y, x;

double sinpi(x) double x;

double cospi(x) double x;

void sincospi(x, s, c) double x, *s, *c;

double tanpi(x) double x;

double asinpi(x) double x;

double acospi(x) double x;

double atanpi(x) double x;

double atan2pi(y, x) double y, x;

DESCRIPTION

sin(), cos(), sincos(), and tan() return trigonometric functions of radian arguments. The values of trigonometric functions of arguments exceeding \(*p/4 in magnitude are affected by the precision of the approximation to \(*p/2 used to reduce those arguments to the range -\(*p/4 to \(*p/4. Argument reduction may occur in hardware or software; if in software, the variable fp_pi defined in <math.h> allows changing that precision at run time. Trigonometric argument reduction is discussed in the [a manual with the abbreviation FPOINT]. Note: sincos(x,s,c) allows simultaneous computation of *s = sin(x) and *c = cos(x).

asin() returns the arc sin in the range -\(*p/2 to \(*p/2.

acos() returns the arc cosine in the range 0 to \(*p.

atan() returns the arc tangent of x in the range -\(*p/2 to \(*p/2.

atan2(y,x) and hypot(x,y) (see hypot.3m convert rectangular coordinates (x,y) to polar (r,\(*h); atan2() computes \(*h, the argument or phase, by computing an arc tangent of y/x in the range -\(*p to \(*p. atan2.0.0,0.0 is ±0.0 or ±\(*p, in conformance with 4.3BSD, as discussed in the [a manual with the abbreviation FPOINT].

sinpi(), cospi(), and tanpi() avoid range-reduction issues because their definition sinpi(x)==sin(\(*p*x) permits range reduction that is fast and exact for all x. The corresponding inverse functions compute asinpi(x)==asin(x)/\(*p. Similarly atan2pi(y,x)==atan2(y,x)/\(*p.

DIAGNOSTICS

These functions handle exceptional arguments in the spirit of ANSI/IEEE Std 754-1985. sin(±\(if), cos(±\(if), tan(±\(if), or asin(x) or acos(x) with |x|>1, return NaN; sinpi(x) et. al. are similar. In addition, asin(), acos(), and atan2() may also set errno and call matherr.3m

SEE ALSO

hypot.3m matherr.3m


index | Inhaltsverzeichniss | Kommentar

Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97