From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- .../reference/global_objects/math/atan2/index.html | 155 +++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 files/it/web/javascript/reference/global_objects/math/atan2/index.html (limited to 'files/it/web/javascript/reference/global_objects/math/atan2') diff --git a/files/it/web/javascript/reference/global_objects/math/atan2/index.html b/files/it/web/javascript/reference/global_objects/math/atan2/index.html new file mode 100644 index 0000000000..842106f7a1 --- /dev/null +++ b/files/it/web/javascript/reference/global_objects/math/atan2/index.html @@ -0,0 +1,155 @@ +--- +title: Math.atan2() +slug: Web/JavaScript/Reference/Global_Objects/Math/atan2 +tags: + - Arcotangente + - JavaScript + - Math + - metodo +translation_of: Web/JavaScript/Reference/Global_Objects/Math/atan2 +--- +
{{JSRef}}
+ +

La funzione Math.atan2() restituisce l'arcotangente del quoziente dei suoi argomenti.

+ +

Sintassi

+ +
Math.atan2(y, x)
+ +

Parametri

+ +
+
y
+
Primo numero.
+
x
+
Secondo numero.
+
+ +

Valore restituito

+ +

L'arcotangente del quoziente degli argomenti forniti alla funzione, espresso in radianti e compreso tra -π e π.

+ +

Descrizione

+ +

Il metodo Math.atan2() restituisce un valore compreso tra -π e π che reppresenta l'angolo teta di un punto (x, y). Questo angolo è orientato in senso antiorario, misurato in radianti e compreso tra l'asse positivo delle ascisse, ed il punto (x, y). È importante ricordare che il primo argomento da fornire alla funzione è l'ordinata del punto ed il secondo la sua ascissa.

+ +

A simple diagram showing the angle returned by atan2(y, x)

+ +

A Math.atan2() vengono passate x ed y separatamente, mentre a Math.atan() deve essere passato il loro quoziente.

+ +

Poichè atan2() è un metodo statico di Math esso viene sempre utilizzato nella forma Math.atan2(), invece che come metodo di un oggetto Math che hai personalmente creato (Math non è un costruttore).

+ +

Examples

+ +

Using Math.atan2()

+ +
Math.atan2(90, 15); // 1.4056476493802699
+Math.atan2(15, 90); // 0.16514867741462683
+
+Math.atan2(±0, -0);               // ±PI.
+Math.atan2(±0, +0);               // ±0.
+Math.atan2(±0, -x);               // ±PI con x > 0.
+Math.atan2(±0, x);                // ±0 con x > 0.
+Math.atan2(-y, ±0);               // -PI/2 con y > 0.
+Math.atan2(y, ±0);                // PI/2 con y > 0.
+Math.atan2(±y, -Infinity);        // ±PI con y finito e y > 0.
+Math.atan2(±y, +Infinity);        // ±0 con y finito e y > 0.
+Math.atan2(±Infinity, x);         // ±PI/2 con x finito.
+Math.atan2(±Infinity, -Infinity); // ±3*PI/4.
+Math.atan2(±Infinity, +Infinity); // ±PI/4.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('ES1')}}{{Spec2('ES1')}}Initial definition. Implemented in JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.8.2.5', 'Math.atan2')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-math.atan2', 'Math.atan2')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-math.atan2', 'Math.atan2')}}{{Spec2('ESDraft')}} 
+ +

Browser compatibility

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

See also

+ + -- cgit v1.2.3-54-g00ecf