| << Prev | Beej's Guide to C | Next >> |
Calculate the arc sine of a number.
#include <math.h> double asin(double x); float asinf(float x); long double asinl(long double x);
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;
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.
double asinx; long double ldasinx; asinx = asin(0.2); ldasinx = asinl((long double)0.3);
acos(), atan(), atan2(), sin()
| << Prev | Beej's Guide to C | Next >> |