Chapter Contents

Previous

Next
asin

asin



Compute the Trigonometric Arc Sine

Portability: ISO/ANSI C conforming, UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
DIAGNOSTICS
EXAMPLE
RELATED FUNCTIONS
SEE ALSO


SYNOPSIS

#include <math.h>

double asin(double x);


DESCRIPTION

asin computes the trigonometric arc sine of the value x . The arc sine function is the inverse of the sine function and is expressed by the following relation:

[IMAGE]

x is in the closed interval [-1.0,1.0] .


RETURN VALUE

asin returns the principal value of the arc sine of the argument x , provided that this value is defined and computable. The return value is a double precision floating-point number in the closed interval [-[pi] /2,[pi] /2] radians.


DIAGNOSTICS

asin returns 0.0 if the value of its argument is larger than 1.0 or smaller than -1.0. The run-time library writes an error message to the standard error file ( stderr ) in this case.

If an error occurs in asin , the _matherr routine is called. You can supply your own version of _matherr to suppress the diagnostic message or modify the value returned.


EXAMPLE

This example computes pi as 4 times the arc sine of the square root of 0.5:

#include <math.h>
#include <stdio.h>

main()
{
   double pival, value;
   value = .500;

   pival = 4 * asin(sqrt(value));
   printf("4 * asin(sqrt(%f)) = %f\n",value,pival);
}


RELATED FUNCTIONS

acos , atan , _matherr


SEE ALSO


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.