Skip to content

Math.Tanh

Name Mandatory Description Default Type
⬅️ Input The input float or sequence of floats to calculate the hyperbolic tangent of. FloatFloat2Float3Float4Color[Any]
Output ➡️ Outputs the hyperbolic tangent of the input. FloatFloat2Float3Float4Color[Any]

This shard calculates the hyperbolic tangent of the given input, where the input is the real number. The hyperbolic tangent is a hyperbolic function that is analogous to the circular tangent function, but it uses exponential functions instead of angles.

Details

Tanh is not a periodic function. It does not repeat its values.

Tanh is bounded and will always return a value between -1 and 1 but approaches 1 as the input value grows positively and -1 as the input value grows negatively.

If a sequence of floats was provided as input, the shard will calculate the hyperbolic tangent of each element in the sequence and output a sequence.

If a sequence of vectors was provided as input, the shard will calculate the hyperbolic tangent of each component in each vector in the sequence and output a sequence of vectors where each component in each vector is the hyperbolic tangent of the corresponding component in the input sequence.

Examples

1
2
3
@f3(-1.0 0.0 1.0) | Math.Tanh | Log
Math.Subtract(@f3(-0.76159416 0.0 0.76159416)) | Math.Abs
IsLess(@f3(0.00001 0.00001 0.00001)) | Assert.Is(true Break: true)

[info] [sample-wire] @f3(-0.761594 0 0.761594)