colour.algebra.smooth#

colour.algebra.smooth(x: FloatingOrArrayLike, a: FloatingOrArrayLike = 0, b: FloatingOrArrayLike = 1, clip: bool = False) numpy.ndarray#

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

Parameters
  • x (FloatingOrArrayLike) – Array \(x\).

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

  • b (FloatingOrArrayLike) – 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.     ])