A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh below:

Math.atanh() - JavaScript | MDN

Math.atanh()

Baseline Widely available

A função Math.atanh() retorna o arco tangente hiperbólico de um número, onde

∀ x ∊ ( - 1 , 1 ) , Math.atanh ( x ) = arctanh ( x ) = the unique y such that tanh ( y ) = x \forall x \in \left( -1, 1 \right), \mathtt{\operatorname{Math.atanh}(x)} = \operatorname{arctanh}(x) = \text{ the unique } ; y ; \text{such that} ; \tanh(y) = x Sintaxe Parâmetros Valor retornado

O arco tangente hiperbólico do parâmetro recebido.

Descrição

Por atanh() ser um método estático de Math, deve-se sempre usá-lo como Math.atanh(), e não como um método de um objeto Math que você criou.

Exemplos Usando Math.atanh()
Math.atanh(-2); // NaN
Math.atanh(-1); // -Infinity
Math.atanh(0); // 0
Math.atanh(0.5); // 0.5493061443340548
Math.atanh(1); // Infinity
Math.atanh(2); // NaN

For values greater than 1 or less than -1, NaN is returned.

Para valores menores que -1 ou maiores que 1, NaN é retornado.

Polyfill

Para | x | < 1 \left|x\right| < 1 , temos artanh ( x ) = 1 2 ln ( 1 + x 1 - x ) \operatorname {artanh} (x) = \frac{1}{2}\ln \left( \frac{1 + x}{1 - x} \right) , esse comportamento pode ser emulado com a seguinte função:

Math.atanh =
  Math.atanh ||
  function (x) {
    return Math.log((1 + x) / (1 - x)) / 2;
  };
Especificações Compatibilidade com navegadores Veja também

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