cos C · 数学函数
求余弦值,参数是弧度而不是角度。
怎么用
double r = cos(弧度);
小例子
#include <stdio.h>
#include <math.h>
int main(void) {
printf("%f", cos(0.0));
return 0;
}
运行结果
输出 1.000000
提醒:cos(0) 等于 1;头文件是 math.h
在代码里遇到不认识的词?打开代码点读机,点一下就懂 → ← C全部词条