Math Visualizer Skill
The Math Visualizer brings mathematical concepts to life through precise, beautiful animations that reveal the structure and relationships within mathematics.
Mathematical Domains
Supported Areas
- Algebra: Equations, inequalities, polynomials
- Calculus: Derivatives, integrals, limits, series
- Geometry: Shapes, transformations, proofs
- Trigonometry: Functions, identities, unit circle
- Linear Algebra: Vectors, matrices, transformations
- Complex Analysis: Complex numbers, transformations
- Number Theory: Primes, sequences, patterns
Rules
rules/equation-presentation.md
How to present equations with proper pacing and emphasis.
rules/color-coding-math.md
Consistent color schemes for mathematical elements.
rules/graphing-best-practices.md
Creating clear, informative function graphs.
rules/proof-visualization.md
Step-by-step proof animations that build understanding.
Color Coding Standard
| Element | Color | Hex |
|---|---|---|
| Variables (x, y) | BLUE | #58C4DD |
| Constants | YELLOW | #FFFF00 |
| Operators | WHITE | #FFFFFF |
| Key Terms | GREEN | #83C167 |
| Equals/Results | GOLD | #FFD700 |
| Negative/Subtract | RED | #FC6255 |
Templates
Equation Derivation
python1from manim import * 2 3class EquationDerivation(Scene): 4 def construct(self): 5 # Initial equation 6 eq1 = MathTex(r"x^2 + 2x + 1 = 0") 7 self.play(Write(eq1)) 8 self.wait() 9 10 # Transform step by step 11 eq2 = MathTex(r"(x + 1)^2 = 0") 12 eq3 = MathTex(r"x + 1 = 0") 13 eq4 = MathTex(r"x = -1") 14 15 # Show each transformation 16 for new_eq in [eq2, eq3, eq4]: 17 self.play(TransformMatchingTex(eq1, new_eq)) 18 self.wait() 19 eq1 = new_eq 20 21 # Highlight final answer 22 box = SurroundingRectangle(eq4, color=GREEN, buff=0.2) 23 self.play(Create(box))
Color-Coded Equation
python1from manim import * 2 3class ColorCodedEquation(Scene): 4 def construct(self): 5 # Equation with color-coded parts 6 equation = MathTex( 7 r"f(", r"x", r") = ", r"a", r"x^2", r" + ", r"b", r"x", r" + ", r"c" 8 ) 9 10 # Color code 11 equation[1].set_color(BLUE) # x 12 equation[3].set_color(YELLOW) # a 13 equation[4].set_color(BLUE) # x^2 14 equation[6].set_color(YELLOW) # b 15 equation[7].set_color(BLUE) # x 16 equation[9].set_color(YELLOW) # c 17 18 self.play(Write(equation)) 19 20 # Explain each part 21 labels = [ 22 (equation[3], "coefficient"), 23 (equation[1], "variable"), 24 (equation[9], "constant") 25 ] 26 27 for part, label_text in labels: 28 self.play(Indicate(part)) 29 label = Text(label_text, font_size=24).next_to(part, DOWN) 30 self.play(Write(label)) 31 self.wait() 32 self.play(FadeOut(label))
Function Graph with Animation
python1from manim import * 2 3class FunctionGraph(Scene): 4 def construct(self): 5 # Create axes 6 axes = Axes( 7 x_range=[-4, 4, 1], 8 y_range=[-2, 8, 1], 9 x_length=8, 10 y_length=5, 11 axis_config={"include_tip": True} 12 ) 13 labels = axes.get_axis_labels(x_label="x", y_label="y") 14 15 self.play(Create(axes), Write(labels)) 16 17 # Function 18 func = axes.plot(lambda x: x**2, color=BLUE) 19 func_label = MathTex(r"f(x) = x^2", color=BLUE).to_corner(UR) 20 21 self.play(Create(func), Write(func_label)) 22 23 # Show derivative 24 deriv = axes.plot(lambda x: 2*x, color=GREEN) 25 deriv_label = MathTex(r"f'(x) = 2x", color=GREEN).next_to(func_label, DOWN) 26 27 self.play(Create(deriv), Write(deriv_label)) 28 29 # Tangent line demonstration 30 x_tracker = ValueTracker(-2) 31 32 tangent = always_redraw(lambda: axes.get_secant_slope_group( 33 x=x_tracker.get_value(), 34 graph=func, 35 dx=0.01, 36 secant_line_color=YELLOW, 37 secant_line_length=4 38 )) 39 40 dot = always_redraw(lambda: Dot( 41 axes.c2p(x_tracker.get_value(), x_tracker.get_value()**2), 42 color=RED 43 )) 44 45 self.play(Create(tangent), Create(dot)) 46 self.play(x_tracker.animate.set_value(2), run_time=4)
3D Mathematical Surface
python1from manim import * 2 3class Surface3D(ThreeDScene): 4 def construct(self): 5 # Set up camera 6 self.set_camera_orientation(phi=75 * DEGREES, theta=-45 * DEGREES) 7 8 # Create axes 9 axes = ThreeDAxes( 10 x_range=[-3, 3, 1], 11 y_range=[-3, 3, 1], 12 z_range=[-2, 2, 1] 13 ) 14 15 # Create surface 16 surface = Surface( 17 lambda u, v: axes.c2p(u, v, np.sin(u) * np.cos(v)), 18 u_range=[-PI, PI], 19 v_range=[-PI, PI], 20 resolution=(30, 30), 21 fill_opacity=0.7 22 ) 23 surface.set_fill_by_value( 24 axes=axes, 25 colorscale=[(RED, -1), (YELLOW, 0), (GREEN, 1)] 26 ) 27 28 # Animate 29 self.play(Create(axes)) 30 self.play(Create(surface), run_time=3) 31 self.begin_ambient_camera_rotation(rate=0.2) 32 self.wait(5)
Geometric Proof
python1from manim import * 2 3class PythagoreanProof(Scene): 4 def construct(self): 5 # Create right triangle 6 triangle = Polygon( 7 ORIGIN, RIGHT * 3, RIGHT * 3 + UP * 4, 8 color=WHITE, fill_opacity=0.3 9 ) 10 11 # Labels 12 a_label = MathTex("a").next_to(triangle, DOWN) 13 b_label = MathTex("b").next_to(triangle, RIGHT) 14 c_label = MathTex("c").move_to( 15 (ORIGIN + RIGHT * 3 + UP * 4) / 2 + LEFT * 0.5 + UP * 0.3 16 ) 17 18 self.play(Create(triangle)) 19 self.play(Write(a_label), Write(b_label), Write(c_label)) 20 21 # Show squares on each side 22 sq_a = Square(side_length=3, color=BLUE, fill_opacity=0.5) 23 sq_a.next_to(triangle, DOWN, buff=0) 24 25 sq_b = Square(side_length=4, color=GREEN, fill_opacity=0.5) 26 sq_b.next_to(triangle, RIGHT, buff=0) 27 28 self.play(Create(sq_a), Create(sq_b)) 29 30 # Area labels 31 area_a = MathTex(r"a^2", color=BLUE).move_to(sq_a) 32 area_b = MathTex(r"b^2", color=GREEN).move_to(sq_b) 33 34 self.play(Write(area_a), Write(area_b)) 35 36 # Conclusion 37 theorem = MathTex(r"a^2 + b^2 = c^2").to_edge(UP) 38 box = SurroundingRectangle(theorem, color=GOLD) 39 40 self.play(Write(theorem), Create(box))
LaTeX Quick Reference
Common Expressions
latex1% Fractions 2\frac{a}{b} 3 4% Square root 5\sqrt{x} \sqrt[n]{x} 6 7% Summation 8\sum_{i=1}^{n} x_i 9 10% Integral 11\int_{a}^{b} f(x) \, dx 12 13% Limit 14\lim_{x \to \infty} f(x) 15 16% Matrix 17\begin{pmatrix} a & b \\ c & d \end{pmatrix} 18 19% Partial derivative 20\frac{\partial f}{\partial x}
Greek Letters
latex1\alpha \beta \gamma \delta \epsilon 2\theta \lambda \mu \pi \sigma \omega 3\Gamma \Delta \Theta \Lambda \Sigma \Omega
Best Practices
- Reveal equations gradually - Build up complex equations piece by piece
- Use consistent notation - Same symbol = same meaning throughout
- Annotate meaningfully - Labels should clarify, not clutter
- Show, don't just state - Animate the mathematical relationships
- Connect to intuition - Bridge abstract math to visual understanding