The math.atanh() function returns the inverse hyperbolic tangent of a number.

Syntax:
math.atanh(x) 
copy

Where x is a real number between -1 and 1. If the number is outside of this range, a ValueError is raised.

The function  returns the corresponding angle in radians whose hyperbolic tangent equals to x.

ExampleEdit & Run
import math

x = 0.5
result = math.atanh(x)
print(result) 
copy
Output:
0.5493061443340548 [Finished in 0.0127164158038795s]
ExampleEdit & Run
import math

values = [0.3, 0.7, 0.9]
results = [math.atanh(x) for x in values]
print(results)
copy
Output:
[0.30951960420311175, 0.8673005276940531, 1.4722194895832204] [Finished in 0.011787741910666227s]

You can use the math.degrees() function to get the returned angle in degrees.

ExampleEdit & Run
import math

x = 0.5
result = math.atanh(x)
print(math.degrees(result))
copy
Output:
31.47292373094538 [Finished in 0.01105730514973402s]
ExampleEdit & Run

 

import math

values = [0.3, 0.7, 0.9]
results = [math.atanh(x) for x in values]
print([math.degrees(x) for x in results])
copy
Output:
[17.734166997398, 49.69265980633841, 84.3519632700228] [Finished in 0.01108842995017767s]