The ACOSH() function in SQLite calculates the inverse hyperbolic cosine of a given number. The inverse hyperbolic cosine of a number is the value whose hyperbolic cosine equals that number.
Syntax
ACOSH(X)
Where X is the numeric value for which you want to calculate the inverse hyperbolic cosine. This value must be greater than or equal to 1, as values below 1 do not have a real hyperbolic cosine.
The result will be a positive number, representing the angle in hyperbolic space in terms of radians.
Example 1
Here’s a quick example to demonstrate how it works:
SELECT ACOSH(2.3);
Output:
1.47504478124143
Example 2
Suppose we have a table t1 with a column num containing various values greater than or equal to 1, and we want to find the inverse hyperbolic cosine of each value.
CREATE TABLE t1 (num REAL);
INSERT INTO t1 (num) VALUES (1), (1.5), (2), (2.5), (3);
Now, we can use ACOSH() to calculate the inverse hyperbolic cosine for each value:
SELECT num, ACOSH(num) AS inverse_hyperbolic_cosine
FROM t1;
Output:
num inverse_hyperbolic_cosine
--- -------------------------
1.0 0.0
1.5 0.962423650119207
2.0 1.31695789692482
2.5 1.56679923697241
3.0 1.76274717403909
In this example:
- When
numis1, the result is0because the inverse hyperbolic cosine of1is0. - For
numvalues like1.5,2, and3, theACOSH()function calculates the corresponding angle in hyperbolic space, in radians.
This function is useful in mathematical applications where hyperbolic functions are involved, such as certain physics, engineering, and computational fields.