Skip to content

Simple animations related to the number PI, using Manim Community Edition

License

Notifications You must be signed in to change notification settings

Bartasx4/PiGround

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pi Animations with Manim

Pi Day is celebrated on March 14th (3/14 in month/day format) because the digits 3, 1, and 4 are the first three digits of π. This project uses Manim Community Edition to visualize mathematical concepts through animations. The animations include a Monte Carlo approximation of π, an illustration of the relationship between a circle’s circumference and π, and a demonstration of Aristotle’s Wheel Paradox.

About the Project

This repository contains four animations:

PiGraph Animation

This animation visualizes how the circumference of a circle is related to π. For a circle with a radius of 0.5, its circumference is exactly π. The animation shows the circle "unwrapping" its circumference as it rolls along an axis.

Key aspects:

  • Visualizes a circle of radius 0.5 and its associated circumference.
  • Demonstrates that the unwrapped circumference equals π (approximately 3.14).
  • Emphasizes the relationship between the radius and circumference, reinforcing that π is the ratio of a circle's circumference to its diameter.

Monte Carlo Approximation

This animation demonstrates a Monte Carlo method to approximate π. In this scene, a circle and a square are drawn, where the square has a side equal to the circle's diameter (2r). By randomly distributing points in the square and counting how many fall inside the circle, the animation provides a visual approximation of π.

Key aspects:

  • Constructs a circle and a bounding square (with side length equal to the circle’s diameter).
  • Illustrates that the area of the square is (4/π) times the area of the circle.
  • Uses random point generation to approximate the value of π.

Aristotle's Wheel Paradox

This animation explores a classical geometrical paradox. Aristotle's Wheel Paradox involves rolling two concentric circles of different sizes. Although their circumferences differ, the paradox shows that both circles seem to travel the same distance when rolled.

Key aspects:

  • Visualizes two concentric circles (one larger and one smaller) rolling simultaneously.
  • Highlights the counterintuitive result where both circles cover the same linear distance despite their different circumferences.

Polygon Approximation

This animation demonstrates how to approximate the circumference of a circle (π) by using the perimeters of inscribed and circumscribed polygons.

Key aspects:

  • Visualizes two polygons: one inscribed in the circle and one circumscribed around it.
  • Shows how increasing the number of polygon sides improves the accuracy of the approximation.
  • Highlights the relationship between the circle's circumference and π through geometric methods.

Video Preview

PiGraph Animation

PiGraph.mp4

PiRatio Animation

PiRatio.mp4

Aristotle's Wheel Paradox Animation

WheelParadox.mp4

Polygon Approximation Animation

PiPolygonApproximation.mp4

Usage

  1. Install Manim Community Edition (version 0.19.0 or later).

  2. Render the desired scene by running one of the following commands in your terminal:

    • For the Monte Carlo approximation animation:

      manim -pqh PiRatio.py PiRatio
      
    • For the Aristotle's Wheel Paradox animation:

      manim -pqh wheelParadox.py WheelParadox
      
    • For the PiGraph animation:

      manim -pqh pigraph.py PiGraph
      
    • For the PiPolygonApproximation animation:

      manim -pqh piPolygonApproximation.py PiPolygonApproximation
      

      The generated videos will be stored in the media folder.

License & Acknowledgments

MIT license.

Enjoy and Happy Pi Day (3.14)!

About

Simple animations related to the number PI, using Manim Community Edition

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages