当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


C语言 asin()用法及代码示例

此函数提供计算值的反正弦的函数。该值应小于等于 1 且大于等于 -1。

该函数以单个参数作为需要计算arc sin值的值,并返回计算结果的值。

例:

    X = 0.2
    The function will return 0.201358 

这个函数是一部分math.h库,它必须包含在程序中。

math.h - C 中的 asin() 函数示例


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

int main()
{
    // Define the type of variables
    double a,b;

    // Assigning value for getting asin value
    a = 0.2;

    // Calculating the arc sine of a
    b = asin(a);

    // Displaying the result for the user
    printf("The calculated value is:%lf \n\n", b);
    
    return 0;
}

输出

math.h - asin()  in c language



相关用法


注:本文由纯净天空筛选整理自Manu Jemini大神的英文原创作品 asin() function of math.h in C。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。