15.4. asin(), asinf(), asinl()

Calculate the arc sine of a number.

Prototypes

#include <math.h>
double asin(double x);
float asinf(float x);
long double asinl(long double x);

Description

Calculates the arc sine of a number in radians. (That is, the value whose sine is x.) The number must be in the range -1.0 to 1.0.

For those of you who don't remember, radians are another way of measuring an angle, just like degrees. To convert from degrees to radians or the other way around, use the following code:

degrees = radians * 180.0f / M_PI;
radians = degrees * M_PI / 180;

Return Value

Returns the arc sine of x, unless x is out of range. In that case, errno will be set to EDOM and the return value will be NaN. The variants return different types.

Example

double asinx;
long double ldasinx;

asinx = asin(0.2);
ldasinx = asinl((long double)0.3);

See Also

acos(), atan(), atan2(), sin()