A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Math/atan below:

Math.atan() - JavaScript | MDN

Math.atan()

Baseline Widely available

La fonction Math.atan() renvoie l'arc tangente d'un nombre exprimée en radians. Elle est définie par :

Math.atan ( x ) = arctan ( x ) =le seul y ∊ [ - π 2 ; π 2 ] tel que tan ( y ) = x \mathtt{\operatorname{Math.atan}(x)} = \arctan(x) = \text{ the unique } ; y \in \left[-\frac{\pi}{2}; \frac{\pi}{2}\right] , \text{such that} ; \tan(y) = x Exemple interactif
// Calculates angle of a right-angle triangle in radians
function calcAngle(opposite, adjacent) {
  return Math.atan(opposite / adjacent);
}

console.log(calcAngle(8, 10));
// Expected output: 0.6747409422235527

console.log(calcAngle(5, 3));
// Expected output: 1.0303768265243125
Syntaxe Paramètres Valeur de retour

L'arc tangente du nombre passé en argument (exprimé en radians).

Description

La méthode Math.atan() renvoie une valeur numérique comprise entre - π 2 -\frac{\pi}{2} et π 2 \frac{\pi}{2} .

atan() est une méthode statique de Math et doit toujours être utilisée avec la syntaxe Math.atan(), elle ne doit pas être utilisée comme une méthode d'un autre objet qui aurait été créé (Math n'est pas un constructeur).

Exemples Utiliser Math.atan()
Math.atan(1); // 0.7853981633974483
Math.atan(0); // 0
Math.atan(-0); // -0

Math.atan(Infinity); // 1.5707963267948966
Math.atan(-Infinity); // -1.5707963267948966

// L'angle formé entre la droite [(0,0);(x,y)] et l'axe des abscisses
// dans un système de coordonnées cartésienne
Math.atan(y / x);
Spécifications Compatibilité des navigateurs Voir aussi

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4