Search code examples
manim

what does the "wag" manim mobject method do


I was just looking at the documentation for mobjects and I saw a method named wag the mobject methods listed here and I can't really decipher what it does and I can't find any other references to it


Solution

  • Grant has used it twice in his old videos -- and indeed, the method is a bit weird. If I had to write a docstring for it, it would look something like this:

    def wag(self, direction=RIGHT, axis=DOWN, wag_factor=1.0):
        """Distorts a mobject along and in specified directions.
    
        Parameters
        ----------
        direction
            The direction in which points of the mobject are shifted.
        axis
            The direction that determines the magnitude of the shift.
            The more the points of this mobject lie in this direction,
            the more they get shifted. Points on the opposite end of the
            direction specified by ``axis`` are not shifted at all, and
            those in the direction of ``axis`` are shifted by
            the unscaled direction vector. The magnitude for points in
            between is linearly interpolated between these two extremes.
        wag_factor
            The power to which the linearly interpolated shifting
            magnitudes are raised.
        """
    

    But honestly, this is a fairly specific and obscure method that should probably just be removed.