The ATANH()
function in SQLite calculates the inverse hyperbolic tangent of a given numeric value. The result is the value whose hyperbolic tangent is the specified number.
Syntax
ATANH(X)
Where X
is the numeric value for which you want to calculate the inverse hyperbolic tangent. This value must be between -1 and 1, exclusive, because the hyperbolic tangent is undefined outside this range.
The result will be a real number that represents the angle in hyperbolic space, in terms of radians.
Example 1
Here’s a quick example to demonstrate how it works:
SELECT ATANH(0.35);
Output:
0.365443754271396
Example 2
Suppose we have a table hyperbolic_values
with a column value
containing values within the range (-1, 1). We want to calculate the inverse hyperbolic tangent for each of these values.
CREATE TABLE hyperbolic_values (value REAL);
INSERT INTO hyperbolic_values (value) VALUES (0.5), (-0.5), (0.9), (-0.9);
Now, we can use ATANH()
to calculate the inverse hyperbolic tangent for each value:
SELECT value, ATANH(value) AS inverse_hyperbolic_tangent
FROM hyperbolic_values;
Output:
value inverse_hyperbolic_tangent
----- --------------------------
0.5 0.549306144334055
-0.5 -0.549306144334055
0.9 1.47221948958322
-0.9 -1.47221948958322
In this example:
- For a
value
of0.5
,ATANH(0.5)
returns approximately0.549306144334055
radians. - For
-0.5
, the result is approximately-0.549306144334055
radians. - A
value
of0.9
returns approximately1.47221948958322
radians. - Similarly,
-0.9
corresponds to approximately-1.47221948958322
radians.
The ATANH()
function is useful in advanced mathematical and engineering fields, particularly in physics and complex analysis, where hyperbolic functions and their inverses play an important role.