Python acosh

The Python acosh function calculates the Trigonometric Hyperbolic Arc Cosine for the specified expression or number. The Python acosh function also called the inverse of hyperbolic Cosine. In this section, we reveal how to use acosh function in Python with example.

The syntax of the acosh Function in Python Programming Language is

math.acosh(number);

Number: It can be a number or a valid numerical expression for which you want to find Hyperbolic Arc Cosine value.

  • If the number argument is a positive number, the acosh function returns the hyperbolic Arc Cosine value.
  • If it is a Negative number, the acosh function returns ValueError.
  • And if it is not a number, the acosh function returns TypeError.

Python acosh Function Example

The Python acosh Function allows you to find the Trigonometric Hyperbolic Arc Cosine of the numeric values. In this acosh example, We are going to find the Hyperbolic Arc Cosine values of different data types and display the output

# Python ACOSH Function

import math

Tup = (10, 20, 30, -40 , 50)
Lis = [-15, 25, -32.5, -45.95 , 15.64]

print('Hyperbolic Arc Cosine of Positive Number = %.2f' %math.acosh(10))
print('Hyperbolic Arc Cosine of Decimal Number = %.2f' %math.acosh(20.45))

print('Hyperbolic Arc Cosine of Tuple Item = %.2f' %math.acosh(Tup[2]))
print('Hyperbolic Arc Cosine of List Item = %.2f' %math.acosh(Lis[4]))

print('Hyperbolic Arc Cosine of Multiple Numbers = %.2f' %math.acosh(22 + 49 - 27))

print('Hyperbolic Arc Cosine of String Value = ', math.acosh('Hello'))
Python ACOSH Function

First, We declared Python List and Tuple with some random values. Next, We used the acosh Function directly on both the Positive integer and decimal values. The following statements find the hyperbolic arc cosine Math function of the corresponding values.

print('Hyperbolic Arc Cosine of Positive Number = %.2f' %math.acosh(10))
print('Hyperbolic Arc Cosine of Decimal Number = %.2f' %math.acosh(20.45))

TIP: You can try with Negative values as well, but Python throws ValueError. Please refer to the Python cos Function article to understand the Cosine Function.

Next, We used the acosh Function on Python Tuple and List items. If you observe the above screenshot, the acosh function is working perfectly on them.

print('Hyperbolic Arc Cosine of Tuple Item = %.2f' %math.acosh(Tup[2]))
print('Hyperbolic Arc Cosine of List Item = %.2f' %math.acosh(Lis[4]))

Next, We used the acosh Function directly on multiple values.

print('Hyperbolic Arc Cosine of Multiple Numbers = %.2f' %math.acosh(22 + 49 - 27))

Within the last statement, we tried acosh Function on the String value, and it returns TypeError as output.

print('Hyperbolic Arc Cosine of String Value = ', math.acosh('Hello'))