2019-04-21 11:50:48 +08:00

117 lines
5.9 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<article id="wikiArticle">
<div></div>
<p><strong><code>Math.asinh()</code></strong> 函数返回给定数字的反双曲正弦值, 即:</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> 特定的 </mtext><mspace width="thickmathspace"></mspace><mi>y</mi><mspace width="thickmathspace"></mspace><mtext>满足</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{ the unique } \; y \; \text{such that} \; \sinh(y) = x</annotation></semantics></math></p>
<h2 id="语法">语法</h2>
<pre><code class="language-javascript"><code>Math.asinh(<var>x</var>)</code></code></pre>
<h3 id="参数">参数</h3>
<dl>
<dt><code>x</code></dt>
<dd>待计算的数字。</dd>
</dl>
<h3 id="返回值">返回值</h3>
<p>给定数值的反双曲正弦值。</p>
<h2 id="描述">描述</h2>
<p><code>由于asinh()是</code><code>Math的静态方法</code>, <code>用户应该直接通过Math.asinh()来使用</code>, 而不是先创建出Math对象再调用该方法<code>Math</code>不是一个构造器)。</p>
<h2 id="示例">示例</h2>
<h3 id="使用Math.asinh()"><code>使用Math.asinh()</code></h3>
<pre><code class="language-javascript">Math.asinh(1); // 0.881373587019543
Math.asinh(0); // 0
</code></pre>
<h2 id="其他实现方式">其他实现方式</h2>
<p>由于<math><semantics><mrow><mo lspace="0em" rspace="thinmathspace">arsinh</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><mo lspace="0em" rspace="0em">ln</mo><mrow><mo>(</mo><mrow><mi>x</mi><mo>+</mo><msqrt><mrow><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><mn>1</mn></mrow></msqrt></mrow><mo>)</mo></mrow></mrow><annotation encoding="TeX">\operatorname {arsinh} (x) = \ln \left(x + \sqrt{x^{2} + 1} \right)</annotation></semantics></math> ,因此该函数可以被如下的函数所模拟:</p>
<pre><code class="language-javascript">Math.asinh = Math.asinh || function(x) {
if (x === -Infinity) {
return x;
} else {
return Math.log(x + Math.sqrt(x * x + 1));
}
};
</code></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><a class="external" href="https://www.ecma-international.org/ecma-262/6.0/#sec-math.asinh" hreflang="en" lang="en" rel="noopener">ECMAScript 2015 (6th Edition, ECMA-262)<br/><small lang="zh-CN">Math.asinh</small></a></td>
<td><span class="spec-Standard">Standard</span></td>
<td>Initial definition.</td>
</tr>
<tr>
<td><a class="external" href="https://tc39.github.io/ecma262/#sec-math.asinh" hreflang="en" lang="en" rel="noopener">ECMAScript Latest Draft (ECMA-262)<br/><small lang="zh-CN">Math.asinh</small></a></td>
<td><span class="spec-Draft">Draft</span></td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<div><div class="blockIndicator warning"><strong><a class="external" href="https://github.com/mdn/browser-compat-data" rel="noopener">We're converting our compatibility data into a machine-readable JSON format</a></strong>.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
<strong><a class="new" href="/zh-CN/docs/MDN/Contribute/Structures/Compatibility_tables" rel="nofollow">Find out how you can help!</a></strong></div>
<div class="htab">
<a id="AutoCompatibilityTable" name="AutoCompatibilityTable"></a>
<ul>
<li class="selected"><a>Desktop</a></li>
<li><a>Mobile</a></li>
</ul>
</div></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>38</td>
<td><a href="/en-US/Firefox/Releases/25" title="Released on 2013-10-29.">25</a> (25)</td>
<td><span style="color: #f00;">未实现</span></td>
<td>25</td>
<td>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><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td>25.0 (25)</td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td>8</td>
</tr>
</tbody>
</table>
</div>
<h2 id="另见">另见</h2>
<ul>
<li><a class="new" href="Reference/Global_Objects/Math/acosh" rel="nofollow" title="此页面仍未被本地化, 期待您的翻译!"><code>Math.acosh()</code></a></li>
<li><a href="Reference/Global_Objects/Math/atanh" title="Math.atanh() 函数返回一个数值反双曲正切值, 即:"><code>Math.atanh()</code></a></li>
<li><a href="Reference/Global_Objects/Math/cosh" title="Math.cosh() 函数返回数值的双曲余弦函数, 可用 constant e 表示:"><code>Math.cosh()</code></a></li>
<li><a href="Reference/Global_Objects/Math/sinh" title="Math.sinh() 函数返回一个数字(单位为角度)的双曲正弦值."><code>Math.sinh()</code></a></li>
<li><a href="Reference/Global_Objects/Math/tanh" title="Math.tanh() 函数将会返回一个数的双曲正切函数值,计算如下:"><code>Math.tanh()</code></a></li>
</ul>
</article>