From a55b575e8089ee6cab7c5c262a7e6db55d0e34d6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:46:50 +0100 Subject: unslug es: move --- .../reference/global_objects/math/pi/index.html | 126 +++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 files/es/web/javascript/reference/global_objects/math/pi/index.html (limited to 'files/es/web/javascript/reference/global_objects/math/pi/index.html') diff --git a/files/es/web/javascript/reference/global_objects/math/pi/index.html b/files/es/web/javascript/reference/global_objects/math/pi/index.html new file mode 100644 index 0000000000..d4428498cd --- /dev/null +++ b/files/es/web/javascript/reference/global_objects/math/pi/index.html @@ -0,0 +1,126 @@ +--- +title: Math.PI +slug: Web/JavaScript/Referencia/Objetos_globales/Math/PI +tags: + - JavaScript + - Math + - Propiedad + - Referencia +translation_of: Web/JavaScript/Reference/Global_Objects/Math/PI +--- +
{{JSRef}}
+ +
La propiedad Math.PI representa la relacion entre la longitud de la circunferencia de un circulo y su diametro, la cual es aproximadamente 3.14159.
+ +

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

+ +
{{js_property_attributes(0, 0, 0)}}
+ +

Descripción

+ +

Debido a que PI es una propiedad estatica del modulo Math, siempre debes de utilizarla como Math.PI, en lugar de una propiedad de un objeto Math que tu hayas creado ( Math no es un constructor ).

+ +

Ejemplos

+ +

Utilizando Math.PI

+ +

La siguiente función utiliza Math.PI para calcular la longitud de la circunferencia de un circulo mediante el radio del circulo proporcionado como parametro.

+ +
function calculaCircunferencia(radio) {
+  return 2 * Math.PI * radio;
+}
+
+calculaCircunferencia(1);  // 6.283185307179586
+
+ +

Especificaciones

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EspecificaciónEstatusComentario
{{SpecName('ES1')}}{{Spec2('ES1')}} +

Definición inicial. Implementado en 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')}} 
+ + + +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracteristicaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Soporte Basico{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracteristicaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Soporte Basico{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Ver tambien

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