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 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短