当前位置: C语言 -- 标准库 -- <math.h> -- asin

asin函数


概要:
#include <math.h>
double asin(double x);

描述:

该函数计算参数x的反正弦值。

如果参数x不在区间[-1,+1]内,将发生域错误。


参数:
double x

参数为一个double类型的浮点数,取值范围为-1≤x≤1


返回值:

函数返回参数x的反正弦值,返回值为区间[-π/2,+π/2]内的弧度值。


范例:
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
/*函数asin范例*/

#include <math.h>
#include <stdio.h>

int main(void)
{
    double value = 1.0;
    double angle;

    angle = asin(value)*180.0/3.14;
    printf("The arc sine of %.2f is %d degrees.\n", value, (int)angle);

    return 0;
}

输出:

The arc sine of 1.00 is 90 degrees.


相关内容:
asinf float类型的反正弦函数。
asinl long double类型的反正弦函数。