应用波形

限定名称: manim.animation.indication.ApplyWave

class ApplyWave(mobject=None, *args, use_override=True, **kwargs)[source]

基础:Homotopy

发送一个波动通过Mobject,暂时扭曲它。

Parameters:
  • mobject (Mobject) – 要扭曲的mobject。

  • direction (ndarray) – 波浪推动形状点的方向

  • amplitude (float) – 形状的点移动的距离

  • wave_func (Callable[[float], float]) – 定义波形一侧形状的函数。

  • time_width (float) – 波浪的长度相对于mobject的宽度。

  • 波纹 (整数) – 波的波纹数量

  • run_time (float) – 动画的持续时间。

示例

示例:应用波浪

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
        ))

方法