diff options
Diffstat (limited to 'files/pt-br/web/javascript/reference/global_objects/math/asinh/index.html')
| -rw-r--r-- | files/pt-br/web/javascript/reference/global_objects/math/asinh/index.html | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/files/pt-br/web/javascript/reference/global_objects/math/asinh/index.html b/files/pt-br/web/javascript/reference/global_objects/math/asinh/index.html new file mode 100644 index 0000000000..56c7d8a684 --- /dev/null +++ b/files/pt-br/web/javascript/reference/global_objects/math/asinh/index.html @@ -0,0 +1,97 @@ +--- +title: Math.asinh() +slug: Web/JavaScript/Reference/Global_Objects/Math/asinh +tags: + - Referencia + - metodo +translation_of: Web/JavaScript/Reference/Global_Objects/Math/asinh +--- +<div>{{JSRef}}</div> + +<p>A função <strong><code>Math.asinh()</code></strong> retorna o arco-seno hiperbólico de um número, isto é:</p> + +<p><math display="block"><semantics><mrow><mstyle mathvariant="monospace"><mrow><mo lspace="0em" rspace="thinmathspace">Math.asinh</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow></mstyle><mo>=</mo><mo lspace="0em" rspace="thinmathspace">arsinh</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><mtext> the unique </mtext><mspace width="thickmathspace"></mspace><mi>y</mi><mspace width="thickmathspace"></mspace><mtext>such that</mtext><mspace width="thickmathspace"></mspace><mo lspace="0em" rspace="0em">sinh</mo><mo stretchy="false">(</mo><mi>y</mi><mo stretchy="false">)</mo><mo>=</mo><mi>x</mi></mrow><annotation encoding="TeX">\mathtt{\operatorname{Math.asinh}(x)} = \operatorname{arsinh}(x) = \text{o} \; y \; \text{único tal que} \; \sinh(y) = x</annotation></semantics></math></p> + +<div>{{EmbedInteractiveExample("pages/js/math-asinh.html")}}</div> + + + +<h2 id="Sintaxe">Sintaxe</h2> + +<pre class="syntaxbox"><code>Math.asinh(<var>x</var>)</code></pre> + +<h3 id="Parâmetros">Parâmetros</h3> + +<dl> + <dt><code>x</code></dt> + <dd>Um número.</dd> +</dl> + +<h3 id="Valor_de_retorno">Valor de retorno</h3> + +<p>O arco-seno hiperbólico de um dado número.</p> + +<h2 id="Descrição">Descrição</h2> + +<p>Como <code>asinh()</code> é um métodos estático de <code>Math</code>, você deve sempre chamá-lo como <code>Math.asinh()</code>, ao invés de um método de um objeto <code>Math</code> que você criou (<code>Math</code> não é um construtor).</p> + +<h2 id="Exemplos">Exemplos</h2> + +<h3 id="Usando_Math.asinh()">Usando <code>Math.asinh()</code></h3> + +<pre class="brush: js">Math.asinh(1); // 0.881373587019543 +Math.asinh(0); // 0 +</pre> + +<h2 id="Polyfill">Polyfill</h2> + +<p>Como uma solução simples a expressçao<math><semantics><annotation encoding="TeX">\operatorname {arsinh} (x) = \ln \left(x + \sqrt{x^{2} + 1} \right)</annotation></semantics></math> pode ser usada diretamente para uma emulação grosseira pela seguinte função:</p> + +<pre class="brush: js">Math.asinh = Math.asinh || function(x) { + if (x === -Infinity) { + return x; + } else { + return Math.log(x + Math.sqrt(x * x + 1)); + } +}; +</pre> + +<p>Apesar de formalmente correta, ela sofre de algumas problemas relacionadas à computação de ponto flutuante. Resultados precisos precisam de tratamento especial de positivos/negativos e argumentos pequenos/grandes como feitos por exemplo em em <a href="https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/ieee754/dbl-64/s_asinh.c">glibc</a> ou<a href="http://git.savannah.gnu.org/cgit/gsl.git/tree/sys/invhyp.c">GNU Scientific Library</a>.</p> + +<h2 id="Especificações">Especificações</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('ES6', '#sec-math.asinh', 'Math.asinh')}}</td> + <td>{{Spec2('ES6')}}</td> + <td>Initial definition.</td> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-math.asinh', 'Math.asinh')}}</td> + <td>{{Spec2('ESDraft')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilitade_de_navegadores">Compatibilitade de navegadores</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("javascript.builtins.Math.asinh")}}</p> + +<h2 id="Veja_também">Veja também</h2> + +<ul> + <li>{{jsxref("Math.acosh()")}}</li> + <li>{{jsxref("Math.atanh()")}}</li> + <li>{{jsxref("Math.cosh()")}}</li> + <li>{{jsxref("Math.sinh()")}}</li> + <li>{{jsxref("Math.tanh()")}}</li> +</ul> |
