sinh
Use the sinh() function to calculate the hyperbolic sine of a numeric value.
Syntax
sinh(<number>)Parameters
number
integer, float
Yes
The numeric value for which to calculate the hyperbolic sine. Any real number is valid.
Returns
Type: float
Description: The sinh() function returns the hyperbolic sine of the input value. If the input is null, the function returns null.
Usage notes
Input type: XQL doesn't support NaN or infinite values as input and these value types also can not be returned.
Valid Input Range: The
sinh()function accepts any real number as input.Null Handling: If the input expression is
null, the function returnsnull.Symmetry: The function is odd, meaning
sinh(-x) = -sinh(x).Identity Value:
sinh(0)always returns0.0.Definition: The hyperbolic sine is defined as
(e^x - e^(-x)) / 2.Overflow: For very large input values, the result may overflow to infinity.
Common Use Cases: This function is typically used within the
alterstage for mathematical modeling, catenary curve calculations, and scientific computations.
Examples
Example 1: Calculate hyperbolic sine of literal values
Goal: Calculate the hyperbolic sine for specific numeric literals to verify known mathematical results.
XQL code:
Explanation: sinh(0) returns 0.0. sinh(1) returns approximately 1.1752, and sinh(-1) returns approximately -1.1752, demonstrating the odd symmetry of the function.
Output:
0.0
1.17520
-1.17520
Example 2: Calculate hyperbolic sine from a field value
Goal: Calculate the hyperbolic sine of values stored in a dataset field.
XQL code:
Explanation: This query computes the hyperbolic sine for each value in the duration_seconds field. No filtering is needed since sinh() accepts any real number.
Output:
101
0.0
0.0
102
1.0
1.17520
103
2.0
3.62686
Example 3: Verify relationship between sinh and asinh
Goal: Demonstrate that asinh() is the inverse of sinh() by applying both functions sequentially.
XQL code:
Explanation: This query first computes sinh() of duration_seconds, then applies asinh() to the result. The final value should match the original duration_seconds, confirming the inverse relationship.
Output:
101
1.0
1.17520
1.0
102
2.0
3.62686
2.0
103
3.0
10.01787
3.0
Related articles
Last updated
Was this helpful?
