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/asin below:

Math.asin() - JavaScript | MDN

Math.asin()

Baseline Widely available

La fonction Math.asin() renvoie l'arc sinus d'un nombre (en radians). Elle est définie par :

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

console.log(calcAngle(6, 10));
// Expected output: 0.6435011087932844

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

L'arc sinus du nombre passé en argument (exprimé en radians). Si ce nombre n'est pas compris entre -1 et 1, la valeur renvoyée sera NaN.

Description

La méthode Math.asin() renvoie une valeur numérique comprise entre - π 2 -\frac{\pi}{2} et π 2 \frac{\pi}{2} pour x compris entre -1 et 1. Si x est hors de cet intervalle, la méthode renverra NaN.

Math.asin() est une méthode statique de Math et doit toujours être utilisée avec la syntaxe Math.asin(), elle ne doit pas être appelée à partir d'un autre objet créé (Math n'est pas un constructeur).

Exemples Utiliser Math.asin()
Math.asin(-2); // NaN
Math.asin(-1); // -1.570796326794897 (-pi/2)
Math.asin(0); // 0
Math.asin(0.5); // 0.5235987755982989
Math.asin(1); // 1.570796326794897 (pi/2)
Math.asin(2); // NaN

Pour les valeurs (strictement) inférieures à -1 ou supérieures à 1, Math.asin() renvoie NaN.

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