Repository: ManimCommunity/manim
File: manim/mobject/value_tracker.py (Python)

Code before:
        self.set_value(self.get_value() * d_value)
        return self

    def __ipow__(self, d_value: float) -> Self:
        """Set the value of this ValueTracker to the current value raised to the power of ``d_value``."""
        self.set_value(self.get_value() ** d_value)
        return self

    def __sub__(self, d_value: float | Mobject) -> Self:
        """Decrements the ValueTracker by ``d_value``."""
        if isinstance(d_value, Mobject):
            raise ValueError(
                "Cannot decrement ValueTracker by a Mobject. Please provide a scalar value."
            )
        else:
            self.increment_value(-d_value)
        return self

    def __isub__(self, d_value: float | Mobject) -> Self:
        """Adds ``-=`` syntax to decrement the value of the ValueTracker."""
        if isinstance(d_value, Mobject):
            raise ValueError(
                "Cannot decrement ValueTracker by a Mobject. Please provide a scalar value."
            )
        else:
            self.increment_value(-d_value)
        return self

    def __itruediv__(self, d_value: float) -> Self:
        """Sets the value of this ValueTracker to the current value divided by ``d_value``."""
        self.set_value(self.get_value() / d_value)
        return self

    def interpolate(
        self,
        mobject1: Mobject,
        mobject2: Mobject,
        alpha: float,
        path_func: PathFuncType = straight_path(),
    ) -> Self:
        """Turns ``self`` into an interpolation between ``mobject1`` and ``mobject2``."""
        self.set(points=path_func(mobject1.points, mobject2.points, alpha))
        return self


class ComplexValueTracker(ValueTracker):
    """Tracks a complex-valued parameter.

    The value is internally stored as a points array [a, b, 0]. This can be accessed directly
    to represent the value geometrically, see the usage example.
    When the value is set through :attr:`animate`, the value will take a straight path from the

Review comment (suggestion):
```suggestion
        self.increment_value(-d_value)
```

Code after:
        return self

    def __imod__(self, d_value: float) -> Self:
        """Set the value of this ValueTracker to the current value modulo ``d_value``."""
        self.set_value(self.get_value() % d_value)
        return self

    def __imul__(self, d_value: float) -> Self:
        """Set the value of this ValueTracker to the product of the current value and ``d_value``."""
        self.set_value(self.get_value() * d_value)
        return self

    def __ipow__(self, d_value: float) -> Self:
        """Set the value of this ValueTracker to the current value raised to the power of ``d_value``."""
        self.set_value(self.get_value() ** d_value)
        return self

    def __sub__(self, d_value: float | Mobject) -> ValueTracker:
        """Return a new :class:`ValueTracker` whose value is the current tracker's value minus
        ``d_value``.
        """
        if isinstance(d_value, Mobject):
            raise ValueError(
                "Cannot decrement ValueTracker by a Mobject. Please provide a scalar value."
            )
        return ValueTracker(self.get_value() - d_value)

    def __isub__(self, d_value: float | Mobject) -> Self:
        """Adds ``-=`` syntax to decrement the value of the ValueTracker."""
        if isinstance(d_value, Mobject):
            raise ValueError(
                "Cannot decrement ValueTracker by a Mobject. Please provide a scalar value."
            )
        self.increment_value(-d_value)
        return self

    def __itruediv__(self, d_value: float) -> Self:
        """Sets the value of this ValueTracker to the current value divided by ``d_value``."""
        self.set_value(self.get_value() / d_value)
        return self

    def interpolate(
        self,
        mobject1: Mobject,
        mobject2: Mobject,
        alpha: float,
        path_func: PathFuncType = straight_path(),
    ) -> Self:
        """Turns ``self`` into an interpolation between ``mobject1`` and ``mobject2``."""
        self.set(points=path_func(mobject1.points, mobject2.points, alpha))
        return self