Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ trig(3M) — HP-UX 5.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

matherr(3M)

TRIG(3M)

NAME

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

SYNOPSIS

#include <math.h>

double sin (x) float fsin (x)
double x;‡float x;

double cos (x) float fcos (x)
double x;‡float x;

double tan (x) float ftan (x)
double x;‡float x;

double asin (x) float fasin (x)
double x;‡float x;

double acos (x) float facos (x)
double x;‡float x;

double atan (x) float fatan (x)
double x;‡float x;

double atan2 (y, x) float fatan2
double y, x;‡float y, x;

‡ see important note below

HP-UX COMPATIBILITY

Level: HP-UX/RUN ONLY

Origin: System V

DESCRIPTION

Sin, cos and tan return respectively the sine, cosine and tangent of their argument, x, measured in radians.

Asin returns the arcsine of x, in the range −π/2 to π/2.

Acos returns the arccosine of x, in the range 0 to π.

Atan returns the arctangent of x, in the range −π/2 to π/2.

Atan2 returns the arctangent of y/x, in the range −π to π, using the signs of both arguments to determine the quadrant of the return value.

IMPORTANT NOTE: The corresponding single-precision routines fsin, fcos, ftan, fasin, facos, fatan, and fatan2 expect true single-precision arguments, and therefore cannot be called from standard C.  They are provided for support of FORTRAN and Pascal. 

HARDWARE DEPENDENCIES

Series 200/500:
The approximate limit for the values passed to these functions is 2.98E8 for sin and cos, 1.49E8 for tan, 1.29E4 for fsin and fcos, and 6.43E3 for ftan.
The algorithms used for all functions except atan2 and fatan2 are from HP 9000 BASIC. 

DIAGNOSTICS

Sin, cos, and tan lose accuracy when their argument is far from zero.  For arguments sufficiently large, these functions return zero when there would otherwise be a complete loss of significance.  In this case a message indicating TLOSS error is printed on the standard error output.  errno is set to ERANGE. 

If the magnitude of the argument of asin or acos is greater than one, or if both arguments of atan2 are zero, zero is returned and errno is set to EDOM.  In addition, a message indicating DOMAIN error is printed on the standard error output. 

Error handling is identical for both single- and double-precision routines, except for one consideration: In any situation where the double-precision routine would return ±HUGE, the corresponding single-precision routine returns ±MAXFLOAT. 

These error-handling procedures may be changed with the function matherr(3M).

SEE ALSO

matherr(3M). 

Hewlett-Packard  —  last mod. May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026