colour.algebra.smoothstep_function#

colour.algebra.smoothstep_function(x: ArrayLike, a: ArrayLike = 0, b: ArrayLike = 1, clip: bool = False) NDArrayFloat[source]#

Evaluate the smoothstep sigmoid-like function on array \(x\).

Parameters:
  • x (ArrayLike) – Array \(x\).

  • a (ArrayLike) – Low input domain limit, i.e. the left edge.

  • b (ArrayLike) – High input domain limit, i.e. the right edge.

  • clip (bool) – Whether to scale, bias and clip input values to domain [a, b].

Returns:

Array \(x\) after smoothstep sigmoid-like function evaluation.

Return type:

numpy.ndarray

Examples

>>> x = np.linspace(-2, 2, 5)
>>> smoothstep_function(x, -2, 2, clip=True)
array([ 0.     ,  0.15625,  0.5    ,  0.84375,  1.     ])