diff --git a/manimlib/utils/iterables.py b/manimlib/utils/iterables.py index bbecbab9..e8880552 100644 --- a/manimlib/utils/iterables.py +++ b/manimlib/utils/iterables.py @@ -130,6 +130,9 @@ def arrays_match(arr1: np.ndarray, arr2: np.ndarray) -> bool: return arr1.shape == arr2.shape and (arr1 == arr2).all() +def array_is_constant(arr: np.ndarray) -> bool: + return len(arr) > 0 and not (arr - arr[0]).any() + def hash_obj(obj: object) -> int: if isinstance(obj, dict): return hash(tuple(sorted([