std::atan2
Da cppreference.com.
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <cmath> | ||
float atan2(float y, float x ); | (1) | |
double atan2(double y, double x ); | (2) | |
longdouble atan2(longdouble y, longdouble x ); | (3) | |
Promoted atan2( Arithmetic y, Arithmetic x ); | (4) | (dal C++11) |
Calcola la tangente inversa di
4) y/x
utilizzare i segni di argomenti per determinare correttamente quadrante. Original:
Computes the inverse tangent of
y/x
using the signs of arguments to correctly determine quadrant. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Se un qualsiasi argomento è di tipo integrale, il cast double. Se qualsiasi altro argomento è longdouble, quindi il tipo di ritorno è longdouble, altrimenti è double.
Original:
If any argument has integral type, it is cast to double. If any other argument is longdouble, then the return type is longdouble, otherwise it is double.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica]Parametri
x, y | - | valore in virgola mobile Original: floating point value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifica]Valore di ritorno
Tangente Arco di
y/x
in radianti nell'intervallo radianti [-π; π]
.Original:
Arc tangent of
y/x
in radians in the range of [-π; π]
radians.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifica]Esempio
#include <cmath>#include <utility>#include <iostream> std::pair<double, double> cartesian_to_polar(double x, double y){return{std::hypot(x, y), std::atan2(y,x)};} int main(){std::pair<double, double> polar = cartesian_to_polar(1, 1);std::cout<<"(1,1) cartesian is ("<< polar.first<<","<< polar.second<<") polar\n";}
Output:
(1,1) cartesian is (1.41421,0.785398) polar
[modifica]Vedi anche
calcola arco tangente (arctan(x)) Original: computes arc tangent (arctan(x)) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) | |
calcola arcoseno (arcsin(x)) Original: computes arc sine (arcsin(x)) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) | |
calcola l'arcocoseno (arccos(x)) Original: computes arc cosine (arccos(x)) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) | |
calcola tangente (tan(x)) Original: computes tangent (tan(x)) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) |