GLSL built-in function
acosh()
Returns the inverse hyperbolic cosine for input at least one.
Demo version: GLSL ES 3.00 / WebGL 2Demo stage: Fragment
Syntax
genType acosh(genType x)genType means float / vec2 / vec3 / vec4; matching placeholders use the same type.
Parameters
- x
- Input value or left-hand vector
Return value
A nonnegative angle in hyperbolic radians for each component of x; defined for x ≥ 1.
Live example
Edit the code and the preview updates as you type.
What acosh does
Returns the inverse hyperbolic cosine for input at least one.
Read the preview
acosh(max(x+2.0,1.0))*0.5 rises from zero at the left edge. Replace x+2.0 with x+1.0 to keep the left half flat at zero before the curve rises.
Core call
acosh(max(x+2.0,1.0))*0.5;
Results are undefined below one.
Experiment
Change the final multiplier in acosh(max(x+2.0,1.0))*0.5 to 0.25. The curve becomes half as tall without changing its starting point.