applyDeadband

open fun applyDeadband(value: Double, deadband: Double, maxMagnitude: Double): Double
open fun applyDeadband(value: Float, deadband: Float, maxMagnitude: Float): Float

Returns 0.0 if the given value is within the specified range around zero. The remaining range between the deadband and the maximum magnitude is scaled from 0.0 to the maximum magnitude.

Return

The value after the deadband is applied.

Parameters

value

Value to clip.

deadband

Range around zero.

maxMagnitude

The maximum magnitude of the input. Can be infinite.


open fun applyDeadband(value: Double, deadband: Double): Double
open fun applyDeadband(value: Float, deadband: Float): Float

Returns 0.0 if the given value is within the specified range around zero. The remaining range between the deadband and 1.0 is scaled from 0.0 to 1.0.

Return

The value after the deadband is applied.

Parameters

value

Value to clip.

deadband

Range around zero.