Home >>C Math Functions >C math asin() function
The C library function double asin(double x) is used to return the arc sine (inverse sine) of any number x in radians. It takes a single argument x (1 ≥ x ≥ -1) and returns the arc sine of it in radians. This function is included in <math.h> header file.
Syntax:double asin(double x);
x − It is the floating point value in the interval [-1,+1].
Here is an example of asin() function:
// C code to illustrate
// the use of acos function
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main ()
{
double x, ret, val;
x = 0.75;
val = 180.0 / PI;
ret = asin(x) * val;
printf("The arc sine of %lf is %lf degrees", x, ret);
return(0);
}
// C code to illustrate
// the use of acos function
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main ()
{
double x, ret, val;
x = 0.555;
val = 180.0 / PI;
ret = asin(x) * val;
printf("The arc sine of %lf is %lf degrees", x, ret);
return(0);
}