sin¶
- sin(x: array, /) array¶
Calculates an implementation-dependent approximation to the sine for each element
x_iof the input arrayx.Each element
x_iis assumed to be expressed in radians.Note
The sine is an entire function on the complex plane and has no branch cuts.
Note
For complex arguments, the mathematical definition of sine is
\[\begin{split}\begin{align} \operatorname{sin}(x) &= \frac{e^{jx} - e^{-jx}}{2j} \\ &= \frac{\operatorname{sinh}(jx)}{j} \\ &= \frac{\operatorname{sinh}(jx)}{j} \cdot \frac{j}{j} \\ &= -j \cdot \operatorname{sinh}(jx) \end{align}\end{split}\]where \(\operatorname{sinh}\) is the hyperbolic sine.
- Parameters:
x (array) – input array whose elements are each expressed in radians. Should have a floating-point data type.
- Returns:
out (array) – an array containing the sine of each element in
x. The returned array must have a floating-point data type determined by Type Promotion Rules.
Notes
Special cases
For real-valued floating-point operands,
If
x_iisNaN, the result isNaN.If
x_iis+0, the result is+0.If
x_iis-0, the result is-0.If
x_iis either+infinityor-infinity, the result isNaN.
For complex floating-point operands, special cases must be handled as if the operation is implemented as
-1j * sinh(x*1j).Changed in version 2022.12: Added complex data type support.