◐ Shell
clean mode source ↗

std::atan2 - cppreference.com

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.

Click here for the English version of this page

<metanoindex/>

<tbody> </tbody>

Elemento definito nell'header

<cmath>

float atan2( float y, float x );

(1)

double atan2( double y, double x );

(2)

long double atan2( long double y, long double x );

(3)

Promoted atan2( Arithmetic y, Arithmetic x );

(4) (dal C++11)

Calcola la tangente inversa di 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.

4)

Se un qualsiasi argomento è di tipo integrale, il cast double. Se qualsiasi altro argomento è long double, quindi il tipo di ritorno è long double, altrimenti è double.

Original:

If any argument has integral type, it is cast to double. If any other argument is long double, then the return type is long double, 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.

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.

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.

Return value

X argument

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

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) [modifica]

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) [modifica]

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) [modifica]

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) [modifica]