📅  最后修改于: 2023-12-03 14:39:51.130000             🧑  作者: Mango
math.atan()函数是C++ STL的一个数学函数,用于计算反正切值。
double atan(double x);
#include <iostream>
#include <cmath>
using namespace std;
int main() {
double x = 1.0;
cout << "反正切值:" << atan(x) << endl;
return 0;
}
输出结果:
反正切值:0.785398
#include <iostream>
#include <cmath>
using namespace std;
int main() {
double x = 1.0;
double angle = atan(x) * 180 / M_PI;
cout << "角度:" << angle << endl;
return 0;
}
输出结果:
角度:45