Download Tutorial C Files H Files

dg_arcsin

This function calculate the angle in radian of a sin.

Usage

double dg_arcsin(double x);

Example

dg_arcsin(1));

Source code

double dg_arcsin(double x)
{
    double result;
    long int top_factor = 1;
    long int sub_factor = 1;

    while (x > 1)
        x--;
    while (x < -1)
        x++;
    for (int i = 3; i <= PRECISION; i += 2) {
        top_factor *= (i - 2);
        sub_factor *= (i - 1);
        result += (top_factor / sub_factor) * (dg_fpow(x, i) / i);
    }
    return result;
}