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
|
---
title: Math.atanh()
slug: Web/JavaScript/Reference/Global_Objects/Math/atanh
tags:
- JavaScript
- Math
- Довідка
- метод
translation_of: Web/JavaScript/Reference/Global_Objects/Math/atanh
---
<div>{{JSRef}}</div>
<p>Функція <strong><code>Math.atanh()</code></strong> повертає значення гіперболічного акртангенса числа, що являється:</p>
<p><math display="block"><semantics><mrow><mo>∀</mo><mi>x</mi><mo>∊</mo><mrow><mo>(</mo><mrow><mo>-</mo><mn>1</mn><mo>,</mo><mn>1</mn></mrow><mo>)</mo></mrow><mo>,</mo><mstyle mathvariant="monospace"><mrow><mo lspace="0em" rspace="thinmathspace">Math.atanh</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow></mstyle><mo>=</mo><mo lspace="0em" rspace="thinmathspace">arctanh</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><mtext> такий унікальний </mtext><mspace width="thickmathspace"></mspace><mi>y, </mi><mspace width="thickmathspace"></mspace><mtext>для якого</mtext><mspace width="thickmathspace"></mspace><mo lspace="0em" rspace="0em">tanh</mo><mo stretchy="false">(</mo><mi>y</mi><mo stretchy="false">)</mo><mo>=</mo><mi>x</mi></mrow><annotation encoding="TeX">\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</annotation></semantics></math></p>
<div>{{EmbedInteractiveExample("pages/js/math-atanh.html")}}</div>
<p class="hidden">Джерело цих інтерактивних прикладів зберігається у репозиторії на GitHub. Якщо ви маєте бажання зробити свій внесок у проект інтерактивних прикладів - будь ласка, зклонуйте репозиторій <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> та пришліть нам pull request.</p>
<h2 id="Синтаксис">Синтаксис</h2>
<pre class="syntaxbox"><code>Math.atanh(<var>x</var>)</code></pre>
<h3 id="Аргументи">Аргументи</h3>
<dl>
<dt><code>x</code></dt>
<dd>Число.</dd>
</dl>
<h3 id="Результат">Результат</h3>
<p>Гіперболічний арктангенс даного числа.</p>
<h2 id="Опис">Опис</h2>
<p>Оскільки <code>atanh()</code> - статичний метод об'єкту <code>Math</code>, він завжди використовується як <code>Math.atanh()</code>, а не як метод створеного об'єкту <code>Math</code> (<code>Math</code> не є конструктором).</p>
<h2 id="Приклади">Приклади</h2>
<h3 id="Застосування_Math.atanh">Застосування <code>Math.atanh()</code></h3>
<pre class="brush: js">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
</pre>
<p>Для числових значень, що більші за 1 чи менші від -1, результатом є {{jsxref("NaN")}}.</p>
<h2 id="Поліфіл">Поліфіл</h2>
<p>Для <math><semantics><mrow><mrow><mo>|</mo><mi>x</mi><mo>|</mo></mrow><mo><</mo><mn>1</mn></mrow><annotation encoding="TeX">\left|x\right| < 1</annotation></semantics></math>, ми маємо <math><semantics><mrow><mo lspace="0em" rspace="thinmathspace">artanh</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mo lspace="0em" rspace="0em">ln</mo><mrow><mo>(</mo><mfrac><mrow><mn>1</mn><mo>+</mo><mi>x</mi></mrow><mrow><mn>1</mn><mo>-</mo><mi>x</mi></mrow></mfrac><mo>)</mo></mrow></mrow><annotation encoding="TeX">\operatorname {artanh} (x) = \frac{1}{2}\ln \left( \frac{1 + x}{1 - x} \right)</annotation></semantics></math>, тобто можемо емулювати необхідний функціонал за допомогою наступної функції:</p>
<pre class="brush: js">Math.atanh = Math.atanh || function(x) {
return Math.log((1+x)/(1-x)) / 2;
};
</pre>
<h2 id="Специфікації">Специфікації</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Специфікація</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('ESDraft', '#sec-math.atanh', 'Math.atanh')}}</td>
</tr>
</tbody>
</table>
<h2 id="Підтримка_у_браузерах">Підтримка у браузерах</h2>
<p class="hidden">Таблиця сумісності на цій сторінці сформована автоматично із структурованих даних. Якщо ви маєте бажання зробити свій внесок до цих даних - будь-ласка, ось репозиторій <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>, надішліть нам свій pull request.</p>
<p>{{Compat("javascript.builtins.Math.atanh")}}</p>
<h2 id="Дивіться_також">Дивіться також</h2>
<ul>
<li>{{jsxref("Math.acosh()")}}</li>
<li>{{jsxref("Math.asinh()")}}</li>
<li>{{jsxref("Math.cosh()")}}</li>
<li>{{jsxref("Math.sinh()")}}</li>
<li>{{jsxref("Math.tanh()")}}</li>
</ul>
|