C语言sin怎么用

C语言sin怎么用,第1张

C语言sin()用来计算参数x

的正玄值,然后将结果返回。返回-1

至1

之间的计算颤庆结果。

例子:

#include

<math.h>

main(){

double

answer

=

sin(0.5)

printf("sin(0.5)

=

%f\n",

answer)

}

执行

sin(0.5)

=

0.479426

C语言sin():

sin()原型:double

sin(double

x)

sin()角度与弧度

π=180°

1°=π/180

1(rad)=180/π

角埋谈度转弧度:用角度乘以π/180

弧度转角度:用弯洞碰弧度乘以180/π,或者用rtod()函数

扩展资料:

与sin相似的acos函数

函数名:

acos

能:计算并返回arccos(x)值、要求-1<=X<=1

函数与形参类型:

double

acos(x)

double

x

程序例:

#include

<stdio.h>

#include

<math.h>

int

main(void)

{

double

result

double

x

=

0.5

result

=

acos(x)

printf("The

arc

cosine

of

%lf

is

%lf\n",

x,

result)

return

0

}

参考资料:CSDN博客频道-C语言中sin和cos的用法

C语言sin()用来计算参数x 的正玄值,然后将结果返回。返回-1 至1 之间的计算结果。

例子:

#include <math.h>

main(){

double answer = sin(0.5)

printf("sin(0.5) = %f\n", answer)

}

执行

sin(0.5) = 0.479426

C语言sin():

sin()原型:double sin(double x)

sin()角度与弧度:

π=180°

1°=π/180

1(rad)=180/π

角度转弧度:用角度乘以π/180

弧度转角度:用弧度乘以180/π,或者用rtod()函数

扩展资料:

与sin相似的acos函数

函数名: acos

功 能:计算并返回arccos(x)值、要求-1<=X<=1

函数与形参类型:

double acos(x)

double x

程序例:

#include <stdio.h>

#include <math.h>int main(void)

{

double result

double x = 0.5result = acos(x)

printf("The arc cosine of %lf is %lf\n", x, result)

return 0

}

参考资料:CSDN博客频道-C语言中sin和cos的用法


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/12362630.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-23
下一篇2023-05-23

发表评论

登录后才能评论

评论列表(0条)

    保存