asin - C math.h

C examples for math.h:asin

Type

function

From

<cmath>
<ctgmath>
<math.h>

Description

Compute arc sine of x, expressed in radians.

Prototype

long double asinl (long double x);
long double asin (long double x);
     double asin(double x);
      float asinf (float x);
      float asin (float x);
     double asin (T x);           

Parameters

Parameter Description
x Value in the range of [-1,+1]. If the argument is out of this interval, a domain error occurs.

Return Value

Principal arc sine of x, in the interval [-pi/2,+pi/2] radians.

Example

Demo Code


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

#define PI 3.14159265/*from w ww .j a  v a2 s  . com*/

int main ()
{
  double param = 0.5;
  double result = asin (param) * 180.0 / PI;
  printf ("The arc sine of %f is %f degrees\n", param, result);
  return 0;
}

Related Tutorials