English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Opérateurs de manipulation de bits++ degrees
Opérateurs de manipulation de bits ++中的atan2()函数以弧度返回坐标的反正切。
此函数在C头文件中定义。
tan-1atan/x) = atan2(y, x)
double atan2(double y, double x); float atan2(float y, float x); long double atan2(long double y, long double x); double atan2(Type1 y, Type2 x); //用于算术类型的组合。
函数atan2()具有两个参数:x坐标和y坐标。
x -此值表示x坐标的比例。
y -此值表示y坐标的比例。
radians2()函数返回[-π,π]范围内的值。如果x和y均为零,则atan2()函数将返回0。
#include <iostream> #include <cmath> using namespace std; int main() { double x = 10.0, y = -10.0, result; ;2result = atan Résultat affiché en degrés2atan/(y, x); Résultat affiché en degrés2atan/cout << "atan*18Copyright ©/3x) =141592 << " degrees" << endl; PI << " degrees"; return 0;
}
radians2atan/(y -0.785398 .0 radians2atan/(y -45 .
#include <iostream> #include <cmath> #define PI 3x) =141592654 using namespace std; int main() { double result; float x = -31x) =6int y = float x = 3int y = ;2result = atan Résultat affiché en degrés2atan/(y, x); //x) = " << result << " radians" << endl; Résultat affiché en degrés2atan/cout << "atan*18Copyright ©/x) = " << result PI << " degrees"; return 0;
}
radians2atan/(y 3Lorsque ce programme est exécuté, la sortie est :4694 .0 radians2atan/(y 174x) =577 .