aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/javascript/reference/global_objects/math/sinh/index.html
blob: 68f6aeb977b84a44713c4803f9fb6ff3104d756d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
title: Math.sinh()
slug: Web/JavaScript/Reference/Global_Objects/Math/sinh
translation_of: Web/JavaScript/Reference/Global_Objects/Math/sinh
---
<div>{{JSRef}}</div>

<p>A função <strong><code>Math.sinh()</code></strong> retorna o seno hiperbólico de um número, que pode ser expresso usando a {{jsxref("Math.E", "constante e", "", 1)}}:</p>

<p><math display="block"><semantics><mrow><mstyle mathvariant="monospace"><mo lspace="0em" rspace="thinmathspace">Math.sinh(x)</mo></mstyle><mo>=</mo><mfrac><mrow><msup><mi>e</mi><mi>x</mi></msup><mo>-</mo><msup><mi>e</mi><mrow><mo>-</mo><mi>x</mi></mrow></msup></mrow><mn>2</mn></mfrac></mrow><annotation encoding="TeX">\mathtt{\operatorname{Math.sinh(x)}} = \frac{e^x - e^{-x}}{2}</annotation></semantics></math></p>

<div>{{EmbedInteractiveExample("pages/js/math-sinh.html")}}</div>



<h2 id="Sintáxe">Sintáxe</h2>

<pre class="syntaxbox"><code>Math.sinh(<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_retornado">Valor retornado</h3>

<p>O seno hiperbólico do número dado.</p>

<h2 id="Descrição">Descrição</h2>

<p>Como <code>sinh()</code> é um método estático de <code>Math</code>, você sempre deve usar como <code>Math.sinh()</code>, ao invés de um novo objeto instanciado <code>Math</code> (<code>Math</code> não é um construtor).</p>

<h2 id="Exemplos">Exemplos</h2>

<h3 id="Usando_Math.sinh()">Usando <code>Math.sinh()</code></h3>

<pre class="brush: js">Math.sinh(0); // 0
Math.sinh(1); // 1.1752011936438014
</pre>

<h2 id="Polyfill">Polyfill</h2>

<p>Isso pode ser emulado com a ajuda da função {{jsxref("Math.exp()")}}:</p>

<pre class="brush: js">Math.sinh = Math.sinh || function(x) {
  return (Math.exp(x) - Math.exp(-x)) / 2;
}
</pre>

<p>ou usando apenas uma chamada para a função {{jsxref("Math.exp()")}}:</p>

<pre class="brush: js">Math.sinh = Math.sinh || function(x) {
  var y = Math.exp(x);
  return (y - 1 / y) / 2;
}
</pre>

<h2 id="Especificações">Especificações</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Especificação</th>
   <th scope="col">Status</th>
   <th scope="col">Comentário</th>
  </tr>
  <tr>
   <td>{{SpecName('ES2015', '#sec-math.sinh', 'Math.sinh')}}</td>
   <td>{{Spec2('ES2015')}}</td>
   <td>Definição inicial.</td>
  </tr>
  <tr>
   <td>{{SpecName('ESDraft', '#sec-math.sinh', 'Math.sinh')}}</td>
   <td>{{Spec2('ESDraft')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilidade_nos_navegadores">Compatibilidade nos 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.sinh")}}</p>

<h2 id="Veja_também">Veja também</h2>

<ul>
 <li>{{jsxref("Math.acosh()")}}</li>
 <li>{{jsxref("Math.asinh()")}}</li>
 <li>{{jsxref("Math.atanh()")}}</li>
 <li>{{jsxref("Math.cosh()")}}</li>
 <li>{{jsxref("Math.tanh()")}}</li>
</ul>