Why Manim?
I've always been fascinated by 3Blue1Brown's math videos. The elegant animations that make complex concepts intuitive - they're created with Manim, a Python library Grant Sanderson developed. I wanted to learn it, but more importantly, I wanted to learn it the old-fashioned way: reading documentation, watching tutorials, and experimenting. No AI shortcuts.
The Goal
I set myself a challenge: create an animation explaining the concept of derivatives. From a line between two points on a curve, shrink the distance until it becomes a tangent. Simple concept, but it required understanding Manim's coordinate systems, animations, and real-time updates.
The Learning Journey
Step 1: Understanding the Basics
I started with the official Manim documentation and some YouTube tutorials. The first hours were spent understanding the core concepts: Scenes, Mobjects, and Animations. Just getting a simple text to appear on screen felt like an achievement.
Step 2: Plotting Functions
Creating axes and plotting a function was my next challenge. I chose a cubic polynomial that would give interesting visual results. The documentation for ThreeDAxes was my guide, and after several attempts, I had a working graph.
func = axes.plot_parametric_curve(
lambda x: np.array([
x,
0.01 * (x - 5) * (x - 12) * (x - 22) + 7,
0
]),
t_range=(0, 25)
)
Step 3: The Secant Line
The real challenge began with the secant line. I discovered ValueTracker and always_redraw - powerful tools that let you create objects that automatically update when a value changes. This was the key to making the animation interactive.
x = ValueTracker(21)
dx = ValueTracker(3)
secant = always_redraw(
lambda: axes.get_secant_slope_group(
x=x.get_value(),
graph=func,
dx=dx.get_value(),
secant_line_color=GREEN
)
)
Step 4: Animation Magic
Once I understood ValueTracker, animating was straightforward. Shrinking dx from 3 to nearly 0 transforms the secant into a tangent, visually demonstrating the derivative concept.
self.play(dx.animate.set_value(0.001))
Step 5: Going 3D
I couldn't resist adding a 3D twist. ThreeDScene allows camera movements, and I created a surface to show that derivatives work in higher dimensions too. Moving the camera and adding a surface felt like the cherry on top.
The Struggles
It wasn't all smooth. I spent hours debugging coordinate systems, figuring out why my function wasn't displaying correctly. The documentation sometimes assumed knowledge I didn't have. But each solved problem felt earned, not given.
Key Takeaway
always_redraw is incredibly powerful but took me a while to understand. It recreates the object every frame based on current ValueTracker values - essential for smooth animations.
Why No AI?
I use AI daily in my work - it's a fantastic tool for productivity. But for learning something new, I wanted to build genuine understanding. When you copy-paste AI-generated code, you might get it working, but you don't truly learn. By reading documentation and experimenting, I now understand Manim's architecture deeply enough to create my own animations from scratch.
I did use AI at the very end for minor cleanup, but the core learning - understanding Scenes, Mobjects, ValueTrackers, and animations - was all done manually. And that foundation will stay with me.
Lessons Learned
- Documentation is underrated - it's often better than tutorials for deep understanding
- ValueTracker + always_redraw is the core pattern for dynamic Manim animations
- 3D in Manim requires ThreeDScene and careful coordinate management
- Learning without AI is slower but builds lasting knowledge
What's Next?
This was just my first animation. I want to create more mathematical visualizations - maybe Fourier transforms or linear algebra concepts. Now that I understand the fundamentals, the possibilities are exciting.
The Final Result
Here's the animation I created - from the initial function plot to the 3D extension. Every frame represents hours of learning, debugging, and experimenting.