A collection of mathematical animations and visualizations created using Manim Community Edition.
This repository contains various animations and mathematical visualizations created using Manim Community Edition. The projects range from basic animations to complex mathematical concepts, including:
- Eye and Iris Animations
- 3D Camera Effects
- Mathematical Transformations
- Abstract Wallpapers
- Various Mathematical Concepts
.
├── animations/
│ ├── eye/ # Eye and iris-related animations
│ │ ├── human-eye.py # Basic human eye animation
│ │ ├── human-eye2.py # Advanced eye animation with blinking
│ │ ├── human-eye3.py # Eye animation with iris movement
│ │ ├── Iris.py # Iris animation with color changes
│ │ ├── iris2.py # Advanced iris patterns
│ │ ├── eyeExp.py # Eye expressions and emotions
│ │ └── Heterochromia.py # Different colored irises
│ ├── 3d/ # 3D and camera effect animations
│ │ ├── threeDCamera.py # Basic 3D camera setup
│ │ ├── ThreeDCameraIllusionRotation.py # Camera rotation effects
│ │ └── MovingZoomedSceneAround.py # Dynamic camera movements
│ ├── math/ # Mathematical concept animations
│ │ ├── Fourier.py # Fourier transform visualization
│ │ ├── ft.py # Basic Fourier transform
│ │ ├── ft3d.py # 3D Fourier transform
│ │ ├── PiTransfer.py # Pi-related animations
│ │ ├── Morse.py # Morse code visualization
│ │ └── MultMod100.py # Modular arithmetic
│ └── abstract/ # Abstract and artistic animations
│ ├── abstract-wallpaper.py # Abstract pattern generation
│ ├── mcescher.py # Escher-style patterns
│ └── ttt.py # Tic-tac-toe animation
├── utils/ # Utility functions and common components
│ ├── scenes.py # Common scene implementations
│ ├── mobjects.py # Custom Manim objects
│ ├── functions.py # Mathematical functions
│ └── graph.py # Graph utilities
└── svg/ # SVG assets for animations
The eye animations demonstrate various aspects of human eye visualization:
- Basic Eye Animation (
human-eye.py
):
class HumanEyeScene(Scene):
def construct(self):
# Create basic eye shape
eye = Circle(radius=2, color=WHITE)
iris = Circle(radius=1, color=BLUE)
pupil = Circle(radius=0.5, color=BLACK)
# Add to scene
self.play(Create(eye))
self.play(Create(iris))
self.play(Create(pupil))
- Advanced Eye Animation (
human-eye2.py
):
- Includes blinking mechanism
- Realistic iris patterns
- Dynamic pupil dilation
- Iris Animations (
Iris.py
,iris2.py
):
- Color gradient effects
- Pattern generation
- Dynamic color transitions
These animations showcase various 3D camera techniques:
- Basic 3D Setup (
threeDCamera.py
):
class ThreeDScene(ThreeDScene):
def construct(self):
# Set camera orientation
self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)
# Create 3D object
cube = Cube()
self.play(Create(cube))
# Rotate camera
self.begin_ambient_camera_rotation(rate=0.2)
self.wait(5)
- Camera Illusions (
ThreeDCameraIllusionRotation.py
):
- Perspective tricks
- Optical illusions
- Dynamic camera movements
Mathematical visualizations and animations:
- Fourier Transform (
Fourier.py
):
class FourierTransform(Scene):
def construct(self):
# Create function to transform
func = FunctionGraph(
lambda x: np.sin(x),
x_range=[-4, 4],
color=YELLOW
)
# Show transformation
self.play(Create(func))
self.play(
func.animate.apply_complex_function(
lambda x: np.exp(2j * PI * x)
)
)
- Modular Arithmetic (
MultMod100.py
):
- Number theory visualizations
- Pattern recognition
- Mathematical sequences
Creative and artistic animations:
- Abstract Wallpaper (
abstract-wallpaper.py
):
class AbstractPattern(Scene):
def construct(self):
# Create repeating pattern
pattern = VGroup()
for i in range(5):
for j in range(5):
square = Square(side_length=1)
square.move_to([i*2, j*2, 0])
pattern.add(square)
# Animate pattern
self.play(Create(pattern))
self.play(
pattern.animate.arrange_in_grid(5, 5),
run_time=2
)
- Python 3.7 or higher
- Manim Community Edition
- Required Python packages (see
requirements.txt
)
Manim requires a specific Python environment setup to work correctly. Here's how to set it up:
- Create a virtual environment:
# Windows
python -m venv manim-env
.\manim-env\Scripts\activate
# macOS/Linux
python3 -m venv manim-env
source manim-env/bin/activate
- Install Manim and dependencies:
pip install manim
pip install -r requirements.txt
- Verify installation:
manim --version
- Create a conda environment:
conda create -n manim-env python=3.9
conda activate manim-env
- Install Manim and dependencies:
pip install manim
pip install -r requirements.txt
If you're using an IDE like VS Code or PyCharm:
-
VS Code:
- Open Command Palette (Ctrl+Shift+P)
- Select "Python: Select Interpreter"
- Choose the interpreter from your manim-env
-
PyCharm:
- Go to File → Settings → Project → Python Interpreter
- Click the gear icon → Add
- Select "Existing Environment" and point to your virtual environment
- ImportError: No module named 'manim': Make sure you've activated the correct virtual environment
- FFmpeg not found: Install FFmpeg separately:
# Windows (using Chocolatey) choco install ffmpeg # macOS brew install ffmpeg # Linux sudo apt-get install ffmpeg
- LaTeX errors: Install a LaTeX distribution:
# Windows: Install MiKTeX # macOS: Install MacTeX # Linux sudo apt-get install texlive-full
- Clone this repository:
git clone https://github.com/mosioc/manim-projects.git
- Install dependencies:
pip install -r requirements.txt
To run any animation, use the following command:
manim -pql animations/[category]/[filename].py [SceneName]
For example:
# Run basic eye animation
manim -pql animations/eye/human-eye.py HumanEyeScene
# Run 3D camera effect
manim -pql animations/3d/threeDCamera.py ThreeDScene
# Run Fourier transform
manim -pql animations/math/Fourier.py FourierTransform
-p
: Preview the animation-q
: Quality (l=low, m=medium, h=high)-l
: Use a lower quality (faster rendering)-o
: Output file name--write_to_movie
: Save as video file
Feel free to contribute to this project by:
- Forking the repository
- Creating a new branch for your feature
- Submitting a pull request
- Manim Community Edition team
- 3Blue1Brown for inspiration
- The Manim community for support and resources
For questions or suggestions, please open an issue in the repository.