C ++中的三角函数
C++三角函数
三角函数也称为圆函数或角度函数或测角函数,其用于三角函数的计算等计算余弦,正弦,正切值。
三角函数列表
这是所有三角函数及其说明和语法的列表,
C++代码演示三角函数示例
//示例
//三角函数
#include <iostream>
#include <cmath>
using namespace std;
// main()部分
int main(){
float x;
float y;
x = 0.25;
cout<<"cos("<<x<<") : "<<cos (x)<<endl;
cout<<"sin("<<x<<") : "<<sin (x)<<endl;
cout<<"tan("<<x<<") : "<<tan (x)<<endl;
cout<<"acos("<<x<<"): "<<acos(x)<<endl;
cout<<"asin("<<x<<"): "<<asin(x)<<endl;
cout<<"atan("<<x<<"): "<<atan(x)<<endl;
y = 1.0;
cout<<"atan2("<<y<<","<<x<<"): "<<atan2(y,x)<<endl;
return 0;
}输出结果
cos(0.25) : 0.968912 sin(0.25) : 0.247404 tan(0.25) : 0.255342 acos(0.25): 1.31812 asin(0.25): 0.25268 atan(0.25): 0.244979 atan2(1,0.25): 1.32582
参考:C++cmath标头
热门推荐
10 诗词送行祝福语大全简短
11 新房开工吉日祝福语简短
12 50多岁生日简短祝福语
13 安徽疫情祝福语简短英语
14 农民朋友发财祝福语简短
15 对生活祝福语简短精辟
16 搬家词简短祝福语朋友
17 女神结婚快乐祝福语简短
18 文学短句祝福语大全简短