From ecb2679bafe92579c846385b9b1a4127974cc9cd Mon Sep 17 00:00:00 2001 From: rvasikarla Date: Sat, 18 Oct 2025 17:08:24 -0500 Subject: [PATCH 1/2] Add QuadraticFormula example to basic.py - Adds educational example demonstrating quadratic formula visualization- Shows clear mathematical presentation with title and formula- Includes proper animation timing and cleanup- Enhances examples available for learning mathematical concepts with Manim --- example_scenes/basic.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/example_scenes/basic.py b/example_scenes/basic.py index 6e8c866f49..3233edfc9d 100644 --- a/example_scenes/basic.py +++ b/example_scenes/basic.py @@ -177,3 +177,23 @@ def construct(self): # See many more examples at https://docs.manim.community/en/stable/examples.html + + +class QuadraticFormula(Scene): + """Demonstrates the quadratic formula with a clear mathematical presentation.""" + def construct(self): + # Title + title = Text("The Quadratic Formula", font_size=48) + title.to_edge(UP) + self.play(Write(title)) + self.wait() + + # The famous formula + formula = MathTex(r"x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}") + formula.scale(2) + self.play(Write(formula)) + self.wait(2) + + # Cleanup + self.play(FadeOut(title, formula)) + self.wait() From 842e5312cabe3260e5fd2626f380b6eff1fae0ca Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 18 Oct 2025 22:11:09 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- example_scenes/basic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/example_scenes/basic.py b/example_scenes/basic.py index 3233edfc9d..d0c06ec288 100644 --- a/example_scenes/basic.py +++ b/example_scenes/basic.py @@ -181,19 +181,20 @@ def construct(self): class QuadraticFormula(Scene): """Demonstrates the quadratic formula with a clear mathematical presentation.""" + def construct(self): # Title title = Text("The Quadratic Formula", font_size=48) title.to_edge(UP) self.play(Write(title)) self.wait() - + # The famous formula formula = MathTex(r"x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}") formula.scale(2) self.play(Write(formula)) self.wait(2) - + # Cleanup self.play(FadeOut(title, formula)) self.wait()