Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python cmath.cosh() function is used to return hyperbolic cosine of a complex number. The hyperbolic cosine of x is defined as:

cosh

where e is an Euler's number.

Syntax

cmath.cosh(x)

Parameters

x Required. Specify a number to find the hyperbolic cosine of

Return Value

Returns the hyperbolic cosine of x.

Example:

In the below example, cosh() function is used to find out the hyperbolic cosine of the given number.

import cmath

x = 2 + 2j
y = 2
z = 2j

print(cmath.cosh(x))
print(cmath.cosh(y))
print(cmath.cosh(z))

The output of the above code will be:

(-1.5656258353157435+3.297894836311237j)
(3.7621956910836314+0j)
(-0.4161468365471424+0j)

❮ Python cMath Module