aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/javascript/reference/global_objects/math/atan
diff options
context:
space:
mode:
authorFlorian Dieminger <me@fiji-flo.de>2021-02-11 18:20:58 +0100
committerGitHub <noreply@github.com>2021-02-11 18:20:58 +0100
commit2318b37e3fd17a3e76a29b9be7d1ce82f040c3bb (patch)
tree5e640d40fd69dc380b04e01de981a345e0141ffa /files/es/web/javascript/reference/global_objects/math/atan
parent6aa6274d2ad3e22e7f5e69b1d7531a5eaeaf5666 (diff)
parent8a5554c6fae83e92b10c8dbe5b82108cb44fad6c (diff)
downloadtranslated-content-2318b37e3fd17a3e76a29b9be7d1ce82f040c3bb.tar.gz
translated-content-2318b37e3fd17a3e76a29b9be7d1ce82f040c3bb.tar.bz2
translated-content-2318b37e3fd17a3e76a29b9be7d1ce82f040c3bb.zip
Merge pull request #53 from fiji-flo/unslugging-es
Unslugging es
Diffstat (limited to 'files/es/web/javascript/reference/global_objects/math/atan')
-rw-r--r--files/es/web/javascript/reference/global_objects/math/atan/index.html108
1 files changed, 108 insertions, 0 deletions
diff --git a/files/es/web/javascript/reference/global_objects/math/atan/index.html b/files/es/web/javascript/reference/global_objects/math/atan/index.html
new file mode 100644
index 0000000000..bad9ca0f5c
--- /dev/null
+++ b/files/es/web/javascript/reference/global_objects/math/atan/index.html
@@ -0,0 +1,108 @@
+---
+title: Math.atan()
+slug: Web/JavaScript/Reference/Global_Objects/Math/atan
+tags:
+ - JavaScript
+ - Matemática
+ - Math
+ - Method
+ - Trigonometría
+translation_of: Web/JavaScript/Reference/Global_Objects/Math/atan
+original_slug: Web/JavaScript/Referencia/Objetos_globales/Math/atan
+---
+<div>{{JSRef}}</div>
+
+<p>La función <strong><code>Math.atan()</code></strong> retorna el arcotangente (en radianes) de un number, esto es</p>
+
+<p><math display="block"><semantics><mrow><mstyle mathvariant="monospace"><mrow><mo lspace="0em" rspace="thinmathspace">Math.atan</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow></mstyle><mo>=</mo><mo lspace="0em" rspace="0em">arctan</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><mtext> el único </mtext><mspace width="thickmathspace"></mspace><mi>y</mi><mo>∊</mo><mrow><mo>[</mo><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac><mo>;</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow><mo>]</mo></mrow><mspace width="thinmathspace"></mspace><mtext> tal que</mtext><mspace width="thickmathspace"></mspace><mo lspace="0em" rspace="0em">tan</mo><mo stretchy="false">(</mo><mi>y</mi><mo stretchy="false">)</mo><mo>=</mo><mi>x</mi></mrow><annotation encoding="TeX">\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</annotation></semantics></math></p>
+
+<div>{{EmbedInteractiveExample("pages/js/math-atan.html")}}</div>
+
+<p class="hidden">La fuente para este ejemplo interactivo se encuentra almacenado en un repositorio de GitHub. Si quieres contribuir al proyecto de ejemplos interactivos, por favor clona el repositorio que hay en este link: <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> ; y envíanos una <em>pull request</em>.</p>
+
+<h2 id="Sintaxis">Sintaxis</h2>
+
+<pre class="syntaxbox"><code>Math.atan(<var>x</var>)</code></pre>
+
+<h3 id="Parámetros">Parámetros</h3>
+
+<dl>
+ <dt><code>x</code></dt>
+ <dd>Un número.</dd>
+</dl>
+
+<h3 id="Valor_de_retorno">Valor de retorno</h3>
+
+<p>El arcotangente (en radianes) de el número dado.</p>
+
+<h2 id="Descripción">Descripción</h2>
+
+<p>El método <code>Math.atan()</code> retorna un valor numérico entre <math><semantics><mrow><mo>-</mo><mfrac><mi>π</mi><mn>2</mn></mfrac></mrow><annotation encoding="TeX">-\frac{\pi}{2}</annotation></semantics></math> y <math><semantics><mfrac><mi>π</mi><mn>2</mn></mfrac><annotation encoding="TeX">\frac{\pi}{2}</annotation></semantics></math> radianes.</p>
+
+<p>Dado que <code>atan()</code> es un método estático de <code>Math</code>, siempre debes usarlo como <code>Math.atan()</code>, y no como un método de un objeto <code>Math</code> que hayas creado (<code>Math</code> no es un constructor).</p>
+
+<h2 id="Ejemplos">Ejemplos</h2>
+
+<h3 id="Usando_Math.atan()">Usando <code>Math.atan()</code></h3>
+
+<pre class="brush: js">Math.atan(1); // 0.7853981633974483
+Math.atan(0); // 0
+Math.atan(-0); // -0
+
+Math.atan(Infinity); <span class="objectBox objectBox-number"> // 1.5707963267948966
+Math.atan(-Infinity); // -1.5707963267948966
+
+</span>// El ángulo que la línea [(0,0);(x,y)] forma con el eje-x en un sistema de coordenadas Cartesianas.
+Math.atan(y / x);
+</pre>
+
+<p>Nota que podrías querer evitar usar <strong>±</strong><code>Infinity</code> por razones de estilo. En este caso, {{jsxref("Math.atan2()")}} con <code>0</code> como segundo argumento puede ser una mejor solución.</p>
+
+<h2 id="Especificaciones">Especificaciones</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Especificación</th>
+ <th scope="col">Estado</th>
+ <th scope="col">Comentario</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES1')}}</td>
+ <td>{{Spec2('ES1')}}</td>
+ <td>Definición inicial. Implementada en JavaScript 1.0.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.8.2.4', 'Math.atan')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-math.atan', 'Math.atan')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-math.atan', 'Math.atan')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilidad_con_el_navegador">Compatibilidad con el navegador</h2>
+
+<p class="hidden">La tabla de compatibilidad en esta página es generada apartir de datos estructurados. Si quieres contribuir a los datos, por favor consulte <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> y envíenos una <em>pull request</em>.</p>
+
+<p>{{Compat("javascript.builtins.Math.atan")}}</p>
+
+<h2 id="Ver_también">Ver también</h2>
+
+<ul>
+ <li>{{jsxref("Math.acos()")}}</li>
+ <li>{{jsxref("Math.asin()")}}</li>
+ <li>{{jsxref("Math.atan2()")}}</li>
+ <li>{{jsxref("Math.cos()")}}</li>
+ <li>{{jsxref("Math.sin()")}}</li>
+ <li>{{jsxref("Math.tan()")}}</li>
+</ul>