A collection of mathematical animations built with Python to help students visualize mathematical concepts using geometry, linear algebra, and transformations.
This project demonstrates how mathematical ideas can be turned into dynamic visual animations using libraries such as NumPy and Matplotlib.
The focus of this repository is learning mathematics through visualization and understanding how mathematical transformations produce motion.
This project aims to help students understand:
- Mathematical visualization
- Coordinate geometry
- Linear transformations
- Rotation matrices
- Parametric motion
- 2D and 3D animation principles
Instead of treating animation as a graphics trick, the project approaches animation as a mathematical transformation problem.
A classical geometric construction visualized dynamically.
Minimal surfaces catenoid and helicoid are isometric and can smoothly deform into each other without stretching.
Boy’s Surface is an immersion of the real projective plane
Multiple Shapes combine to perform human movement.
Multiple cubes are translating and rotating.
Updation of CUBE from wireframe to surface plot which gets explodes to individual faces and reassemble.
Animation showing multiple Sphere in and their rotation in different axes.
Animation showing how the camera viewpoint changes while the object itself remains fixed.
This demonstrates the difference between camera motion and object motion in 3D visualization.
A triangle rotating using a rotation matrix.
A square rotating around the x-axis.
A cube rotating using combined 3D transformations.
Most animations in this project are based on linear algebra transformations.
Example transformation:
P' = R @ P
Where
P= original coordinatesR= transformation matrixP'= transformed coordinates
For example, a rotation around the z-axis is given by
Rz(θ) = [[cosθ -sinθ 0]
[sinθ cosθ 0]
[0 0 1]]
Applying this matrix rotates every point of an object simultaneously.
.
├── 2d-anim
│ ├── notebooks
│ ├── scripts
│ └── assets
│ ├── gifs
│ └── videos
│
├── 3d-anim
│ ├── notebooks
│ ├── scripts
│ └── assets
│ ├── gifs
│ └── videos
This project uses uv for Python environment and dependency management.
Install uv (if not installed):
pip install uvClone the repository:
git clone https://github.com/Shubham18024/Python-Mathematical-Animation.git
cd Python-Mathematical-Animationor using SSH(if you have SSH keys configured)
git clone git@github.com:Shubham18024/Python-Mathematical-Animation.git
cd Python-Mathematical-AnimationInstall dependencies using uv:
uv syncThis command will:
- create the virtual environment
- install dependencies from
pyproject.toml
Run scripts using uv:
uv run python 3d-anim/scripts/object_rotation.pyExample:
uv run python 3d-anim/scripts/rotating_camera.pyTo open notebooks:
uv run jupyter labShubham Tiwari
B.Sc. Mathematics (Hons)
Dyal Singh College
University of Delhi
This project will be released under the MIT License.










