ApplyWave¶
Qualified name: manim.animation.indication.ApplyWave
- class ApplyWave(mobject=None, *args, use_override=True, **kwargs)[source]¶
Bases:
Homotopy
Send a wave through the Mobject distorting it temporarily.
- Parameters:
mobject (Mobject) – The mobject to be distorted.
direction (np.ndarray) – The direction in which the wave nudges points of the shape
amplitude (float) – The distance points of the shape get shifted
wave_func (Callable[[float], float]) – The function defining the shape of one wave flank.
time_width (float) – The length of the wave relative to the width of the mobject.
ripples (int) – The number of ripples of the wave
run_time (float) – The duration of the animation.
Examples
Example: ApplyingWaves ¶
from manim import * class ApplyingWaves(Scene): def construct(self): tex = Tex("WaveWaveWaveWaveWave").scale(2) self.play(ApplyWave(tex)) self.play(ApplyWave( tex, direction=RIGHT, time_width=0.5, amplitude=0.3 )) self.play(ApplyWave( tex, rate_func=linear, ripples=4 ))
class ApplyingWaves(Scene): def construct(self): tex = Tex("WaveWaveWaveWaveWave").scale(2) self.play(ApplyWave(tex)) self.play(ApplyWave( tex, direction=RIGHT, time_width=0.5, amplitude=0.3 )) self.play(ApplyWave( tex, rate_func=linear, ripples=4 ))
Methods
Attributes
run_time
- _original__init__(mobject, direction=array([0., 1., 0.]), amplitude=0.2, wave_func=<function smooth>, time_width=1, ripples=1, run_time=2, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
mobject (Mobject)
direction (ndarray)
amplitude (float)
wave_func (Callable[[float], float])
time_width (float)
ripples (int)
run_time (float)
- Return type:
None