Movatterモバイル変換


[0]ホーム

URL:


Skip to content

tan

tan(x:array,/)array

Calculates an implementation-dependent approximation to the tangent for each elementx_i of the input arrayx.

Each elementx_i is assumed to be expressed in radians.

Note

Tangent is an analytical function on the complex plane and has no branch cuts. The function is periodic, with period\(\pi j\), with respect to the real component and has first order poles along the real line at coordinates\((\pi (\frac{1}{2} + n), 0)\). However, IEEE 754 binary floating-point representation cannot represent the value\(\pi / 2\) exactly, and, thus, no argument value is possible for which a pole error occurs.

Note

For complex arguments, the mathematical definition of tangent is

\[\begin{split}\begin{align} \operatorname{tan}(x) &= \frac{j(e^{-jx} - e^{jx})}{e^{-jx} + e^{jx}} \\ &= (-1) \frac{j(e^{jx} - e^{-jx})}{e^{jx} + e^{-jx}} \\ &= -j \cdot \operatorname{tanh}(jx) \end{align}\end{split}\]

where\(\operatorname{tanh}\) is the hyperbolic tangent.

Parameters:

x (array) – input array whose elements are expressed in radians. Should have a floating-point data type.

Returns:

out (array) – an array containing the tangent of each element inx. The returned array must have a floating-point data type determined byType Promotion Rules.

Notes

Special cases

For real-valued floating-point operands,

  • Ifx_i isNaN, the result isNaN.

  • Ifx_i is+0, the result is+0.

  • Ifx_i is-0, the result is-0.

  • Ifx_i is either+infinity or-infinity, the result isNaN.

For complex floating-point operands, special cases must be handled as if the operation is implemented as-1j*tanh(x*1j).

Changed in version 2022.12:Added complex data type support.


[8]ページ先頭

©2009-2025 Movatter.jp