copapy.clamp#

copapy.clamp(x, min_value, max_value)#
Overloads:
  • x (value[U]), min_value (U | value[U]), max_value (U | value[U]) → value[U]

  • x (U | value[U]), min_value (value[U]), max_value (U | value[U]) → value[U]

  • x (U | value[U]), min_value (U | value[U]), max_value (value[U]) → value[U]

  • x (U), min_value (U), max_value (U) → U

  • x (vector[U]), min_value (U | value[U]), max_value (U | value[U]) → vector[U]

Clamp function to limit a value between a minimum and maximum.

Parameters:
  • x (TypeVar(U, int, float) | value[TypeVar(U, int, float)] | vector[TypeVar(U, int, float)]) – Input value

  • min_value (TypeVar(U, int, float) | value[TypeVar(U, int, float)]) – Minimum limit

  • max_value (TypeVar(U, int, float) | value[TypeVar(U, int, float)]) – Maximum limit

Returns:

Clamped value of x