Home >>C Math Functions >C math asin() function

C math asin() function

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);

Parameters

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); 
}

Output:
The arc sine of 0.750000 is 48.590378 degrees
Example-2

// 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); 
}

Output:
The arc sine of 0.555000 is 33.710715 degrees

No Sidebar ads