cosh¶
- cosh(x: array, /) array¶
Calculates an implementation-dependent approximation to the hyperbolic cosine for each element
x_iin the input arrayx.The mathematical definition of the hyperbolic cosine is
\[\operatorname{cosh}(x) = \frac{e^x + e^{-x}}{2}\]Note
The hyperbolic cosine is an entire function in the complex plane and has no branch cuts. The function is periodic, with period \(2\pi j\), with respect to the imaginary component.
- Parameters:
x (array) – input array whose elements each represent a hyperbolic angle. Should have a floating-point data type.
- Returns:
out (array) – an array containing the hyperbolic cosine of each element in
x. The returned array must have a floating-point data type determined by Type Promotion Rules.
Notes
Special cases
Note
For all operands,
cosh(x)must equalcosh(-x).For real-valued floating-point operands,
If
x_iisNaN, the result isNaN.If
x_iis+0, the result is1.If
x_iis-0, the result is1.If
x_iis+infinity, the result is+infinity.If
x_iis-infinity, the result is+infinity.
For complex floating-point operands, let
a = real(x_i),b = imag(x_i), andNote
For complex floating-point operands,
cosh(conj(x))must equalconj(cosh(x)).If
ais+0andbis+0, the result is1 + 0j.If
ais+0andbis+infinity, the result isNaN + 0j(sign of the imaginary component is unspecified).If
ais+0andbisNaN, the result isNaN + 0j(sign of the imaginary component is unspecified).If
ais a nonzero finite number andbis+infinity, the result isNaN + NaN j.If
ais a nonzero finite number andbisNaN, the result isNaN + NaN j.If
ais+infinityandbis+0, the result is+infinity + 0j.If
ais+infinityandbis a nonzero finite number, the result is+infinity * cis(b).If
ais+infinityandbis+infinity, the result is+infinity + NaN j(sign of the real component is unspecified).If
ais+infinityandbisNaN, the result is+infinity + NaN j.If
aisNaNandbis either+0or-0, the result isNaN + 0j(sign of the imaginary component is unspecified).If
aisNaNandbis a nonzero finite number, the result isNaN + NaN j.If
aisNaNandbisNaN, the result isNaN + NaN j.
where
cis(v)iscos(v) + sin(v)*1j.Changed in version 2022.12: Added complex data type support.