The StandingWave class creates a 2D wave (represented as a ParametricFunction) that oscillates in place, simulating a standing wave pattern.
Parameters:
n (int): The harmonic number.length (float): The total length of the wave.period (float): The time taken for one full oscillation.amplitude (float): The maximum height of the wave.**kwargs: Additional parameters passed to the Manim ParametricFunction class.
Animation Control:
start_wave(): Begins the standing wave oscillation.stop_wave(): Stops the standing wave oscillation.
# Example: Creating multiple harmonics
wave1 = StandingWave(n=1, length=4, amplitude=1)
wave2 = StandingWave(n=2, length=4, amplitude=1)
waves = VGroup(wave1, wave2)
da.add(waves)
for wave in waves:
wave.start_wave()
self.wait()