diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/math/atanh/index.html')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/math/atanh/index.html | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/math/atanh/index.html b/files/zh-cn/web/javascript/reference/global_objects/math/atanh/index.html new file mode 100644 index 0000000000..08af33d242 --- /dev/null +++ b/files/zh-cn/web/javascript/reference/global_objects/math/atanh/index.html @@ -0,0 +1,132 @@ +--- +title: Math.atanh() +slug: Web/JavaScript/Reference/Global_Objects/Math/atanh +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> 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">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> + +<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> + +<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="Polyfill">Polyfill</h2> + +<p>For \left|x\right| < 1, we have \operatorname {artanh} (x) = \frac{1}{2}\ln \left( \frac{1 + x}{1 - x} \right) so this can be emulated by the following function:</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"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('ES6', '#sec-math.atanh', 'Math.atanh')}}</td> + <td>{{Spec2('ES6')}}</td> + <td>Initial definition.</td> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-math.atanh', 'Math.atanh')}}</td> + <td>{{Spec2('ESDraft')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<div>{{CompatibilityTable}}</div> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatChrome("38")}}</td> + <td>{{CompatGeckoDesktop("25")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatOpera("25")}}</td> + <td>{{CompatSafari("7.1")}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Chrome for Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatGeckoMobile("25")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>8</td> + </tr> + </tbody> +</table> +</div> + +<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> |