Sine Wave Frequency Morph Animation

Loading...

Loading video...

Pro
0:00 / 0:00

Animation Specification: Sine Wave Frequency Morphing (Defaults)

Purpose: Demonstrate how changing the frequency of a sine wave affects its shape, using a smooth morphing transition.

1. Mathematical Elements

  • Initial wave: y=sin(2πt)y = \sin(2\pi t)
  • Final wave: y=sin(4πt)y = \sin(4\pi t) (frequency doubled)
  • Domain: t[0,2]t \in [0, 2] (two seconds of time, enough to show several periods of both waves)
  • Interpolation: Linear interpolation of the frequency parameter from 1 Hz to 2 Hz during the morph.

2. Visual Elements

  • Axes:
    • Cartesian 2‑D axes with default Axes class.
    • X‑axis labeled "time (s)" and Y‑axis labeled "amplitude".
    • Tick marks and grid lines at default spacing.
  • Wave curves:
    • Initial wave drawn in blue.
    • Final wave drawn in red.
    • During the morph, the curve color smoothly transitions from blue to red.
  • Annotations (default):
    • A small text label at the top‑right corner showing the current frequency, e.g., "f = 1.0 Hz" → "f = 2.0 Hz". The label updates in real time.
  • Background: Default white background.

3. Animation Timing & Transitions

  • Total duration: 10 seconds.
  • Sequence:
    1. 0 s – 1 s: Fade‑in axes and initial wave.
    2. 1 s – 9 s: Morph the wave by increasing the frequency from 1 Hz to 2 Hz while smoothly blending the color and updating the frequency label.
    3. 9 s – 10 s: Hold the final wave for a brief pause, then fade out.
  • Easing: Use the default smooth easing for the morph.

4. Camera & Perspective

  • Camera: Static 2‑D camera (no zoom or pan).
  • View: Default frame width/height (16:9 aspect ratio).

5. Output Settings

  • Resolution: Default 1920 × 1080 (HD).
  • File format: MP4 (default renderer).

6. Implementation Sketch (Manim Community Edition)

from manim import *

class SineFrequencyMorph(Scene):
    def construct(self):
        # Axes
        axes = Axes(
            x_range=[0, 2, 0.5],
            y_range=[-1.2, 1.2, 0.5],
            x_axis_label=Tex("time (s)"),
            y_axis_label=Tex("amplitude"),
            tips=False,
        )
        self.play(Create(axes), run_time=1)

        # Initial and final wave functions
        f_initial = lambda t: np.sin(2 * np.pi * t)   # 1 Hz
        f_final   = lambda t: np.sin(4 * np.pi * t)   # 2 Hz

        # Wave graphs
        wave_initial = axes.plot(f_initial, color=BLUE)
        wave_final   = axes.plot(f_final,   color=RED)
        self.add(wave_initial)

        # Frequency label
        freq_label = Tex(r"f = 1.0\,\text{Hz}").to_corner(UR)
        self.add(freq_label)

        # Morph animation
        def update_freq(mob, alpha):
            freq = 1 + alpha  # linearly from 1 to 2 Hz
            mob.become(Tex(fr"f = {freq:.2f}\,\text{{Hz}}").to_corner(UR))
        self.play(
            Transform(wave_initial, wave_final, path_arc=0),
            UpdateFromAlphaFunc(freq_label, update_freq),
            run_time=8,
            rate_func=smooth,
        )
        self.wait(1)
        self.play(FadeOut(wave_final), FadeOut(axes), FadeOut(freq_label))

This specification uses only the default settings of Manim (colors, fonts, timing functions, etc.) while providing a clear, self‑contained animation of a sine wave whose frequency morphs from 1 Hz to 2 Hz.

Created By

Kang Liang (tiga)Kang Liang (tiga)

Description

An animation shows a sine wave plotted on Cartesian axes whose frequency linearly increases from 1 Hz to 2 Hz over ten seconds. The curve morphs smoothly, changing color from blue to red, while a corner label updates the current frequency in real time. Axes fade in, the morph runs with smooth easing, and the final wave holds before fading out.

Created At

Dec 28, 2025, 02:15 PM

Tags

sine-wavefrequencytrigonometry

Status

Completed
AI Model
openai/gpt-oss-120b