From 39f2114f9797eb51994966c6bb8ff1814c9a4da8 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:36:08 +0100 Subject: unslug fr: move --- .../reference/global_objects/math/pi/index.html | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 files/fr/web/javascript/reference/global_objects/math/pi/index.html (limited to 'files/fr/web/javascript/reference/global_objects/math/pi/index.html') diff --git a/files/fr/web/javascript/reference/global_objects/math/pi/index.html b/files/fr/web/javascript/reference/global_objects/math/pi/index.html new file mode 100644 index 0000000000..1afe5afc3a --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/math/pi/index.html @@ -0,0 +1,81 @@ +--- +title: Math.PI +slug: Web/JavaScript/Reference/Objets_globaux/Math/PI +tags: + - JavaScript + - Math + - Propriété + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Math/PI +--- +
{{JSRef}}
+ +

La propriété Math.PI représente le ratio entre le périmètre d'un cercle et son diamètre. Elle vaut environ 3.14159:

+ +

Math.PI=π3.14159\mathtt{\mi{Math.PI}} = \pi \approx 3.14159

+ +
{{EmbedInteractiveExample("pages/js/math-pi.html")}}
+ + + +
{{js_property_attributes(0,0,0)}}
+ +

Description

+ +

PI est une propriété statique de l'objet Math et doit toujours être utilisée avec la syntaxe Math.PI plutôt que d'être appelée comme la propriété d'un autre objet qui aurait été crée (Math n'est pas un constructeur).

+ +

Exemples

+ +

Utiliser Math.PI

+ +

La fonction suivante utilise Math.PI afin de calculer le périmètre d'un cercle à partir du rayon passé en argument.

+ +
function calculPérimètre(rayon) {
+  return 2 * Math.PI * rayon;
+}
+
+calculPérimètre(1);  // 6.283185307179586
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpécificationStatutCommentaires
{{SpecName('ES1')}}{{Spec2('ES1')}}Définition initiale. Implémentée avec JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.8.1.6', 'Math.PI')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-math.pi', 'Math.PI')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-math.pi', 'Math.PI')}}{{Spec2('ESDraft')}} 
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("javascript.builtins.Math.PI")}}

+ +

Voir aussi

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