Movatterモバイル変換


[0]ホーム

URL:


Python Tutorial

Python cmath.acosh() Function



The Pythoncmath.acosh() function is used to find the inverse hyperbolic cosine of a given number.

The inverse hyperbolic cosine function is denoted as cosh-1(x) or we can also call this function arccosh(x). It is a mathematical method. If we have a value of x, i.e., greater than or equal to 1, theacosh() function will return the value whose hyperbolic cosine is equal to x.

The domain of the inverse hyperbolic cosine function is in the range [1,).

Syntax

Following is the basic syntax of the Pythoncmath.acosh() function −

cmath.acosh(x)

Parameters

This function accepts a number, i.e, greater than or equal to 1, for which we need to find the inverse hyperbolic cosine as a parameter.

Return value

This function returns the inverse hyperbolic cosine from the range [0,).

Example 1

In hyperbolic trigonometry, the cosine of 0 is equal to 1. When we pass '1' as an argument to thecmath.acosh() function, it returns 0j as the output.(Inverse hyperbolic cosine of 1 is 0).

import cmathresult = cmath.acosh(1)print(result)

Output

When we run the above code, it produces the following result −

0j

Example 2

When we pass a fraction value to thecmath.acosh() function, then it returns a positive real number.

import cmathfrom fractions import Fractionx = Fraction(9, 4)result = cmath.acosh(x)print(result)

Output

Following is the output of the above code −

(1.45057451382258+0j)

Example 3

In the below example, we are passing a complex number to thiscmath.acosh() function.

import cmathx = cmath.acosh(2+3j)print(x)

Output

The output is output as follows −

(1.9833870299165355+1.0001435424737972j)
python_modules.htm
Print Page
Advertisements

[8]ページ先頭

©2009-2025 Movatter.jp