keil编写正弦函数_keil中怎么使用三角函数 要给个c编程例子 谢谢

满意答案

z6dlc53H

推荐于 2017.11.23

采纳率:55%    等级:12

已帮助:5255人

math.h 和C一样调用。

程序:

sin

Summary #include

float sin (float x); /* value to calculate sine for */

Description The sin function calculates the sine of the floating-point value x. The value of x must be in the -65535 to +65535 range or an NaN error value is generated.

Return Value The sin function returns the sine of x.

See Also cos, cos517, sin517, tan, tan517

Example

#include

#include /* for printf */

void tst_sin (void) {

float x;

float y;

for (x = 0; x < (2 * 3.1415); x += 0.1) {

y = sin (x);

printf ("SIN(%f) = %f\n", x, y);

}

}

注:角度不是用度算的,以弧度为单位

10分享举报

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值