A tour in the wonderland of math with python.
Alternatives To Pywonderland
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Leetcode Go29,463
2 months ago14mitGo
✅ Solutions to LeetCode by Go, 100% test coverage, runtime beats 100% / LeetCode 题解
6 days ago39gpl-3.0JavaScript
Algorithms and Data Structures implemented in JavaScript for beginners, following best practices.
C Plus Plus24,534
20 hours ago33mitC++
Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
Homemade Machine Learning21,220
a month ago22mitJupyter Notebook
🤖 Python examples of popular machine learning algorithms with interactive Jupyter demos and math being explained
a day ago19gpl-3.0C
Collection of various algorithms in mathematics, machine learning, computer science, physics, etc implemented in C for educational purposes.
5 days ago95mitJava
A collection of algorithms and data structures
Dsa Bootcamp Java11,780
2 days ago298mitJava
This repository consists of the code samples, assignments, and notes for the Java Data Structures & Algorithms bootcamp of Community Classroom.
9 days ago4otherPython
Open Machine Learning Course
Awesome Java Leetcode7,852
2 years ago15Java
:crown: LeetCode of algorithms with java solution(updating).
Ai Learn6,327
a year ago19
人工智能学习路线图,整理近200个实战案例与项目,免费提供配套教材,零基础入门,就业实战!包括:Python,数学,机器学习,数据分析,深度学习,计算机视觉,自然语言处理,PyTorch tensorflow machine-learning,deep-learning data-analysis data-mining mathematics data-science artificial-intelligence python tensorflow tensorflow2 caffe keras pytorch algorithm numpy pandas matplotlib seaborn nlp cv等热门领域
Alternatives To Pywonderland
Select To Compare

Alternative Project Comparisons

A Tour in the Wonderland of Math with Python

A collection of python scripts for drawing beautiful figures and animating interesting algorithms in mathematics.

About this repo

The purpose of this project is to show the beauty of math with python by rendering high quality images, videos and animations. It consists of several independent projects with each one illustrates a special object/algorithm in math. The current list contains:

  • Aperiodic tilings like Penrose tiling, Ammann-Beenker tiling, etc.
  • Triology on perfectly random sampling algorithms.
    1. Domino shuffling algorithm on Aztec diamonds.
    2. Wilson's uniform spanning tree algorithm on 2d grids.
    3. Coupling from the past algorithm on lozenge tilings.
  • Hopf fibration.
  • 3D and 4D Uniform polytopes.
  • 2D uniform tilings and 3D uniform honeycombs in Euclidean, spherical and hyperbolic spaces.
  • Make gif animations of various algorithms.
  • Lots of shader animations.
  • Miscellaneous scripts like E8 root system, Mandelbrot set, Newton's fractal, Lorenz attractor, etc.

These topics are chosen largely due to my personal taste:

  1. They must produce appealing results.
  2. There must be some non-trivial math behind them.
  3. The code should be as simple as possible.

I'll use only popular python libs and build all math stuff by hand (tools like sage, sympy, mathemetica will not be used here).


The code for some of the images are not in the master branch, they can be found in the released version.

  • Uniform 3D and 4D polytopes

  • Möbius transformations

  • 3D Euclidean uniform honeycombs and their duals

  • Gray-Scott simulation

  • 3D hyperbolic uniform honeycombs

  • Limit set of rank 4 Coxeter groups

  • Aperiodic tilings

  • 3D Fractals

  • Coxeter automata and 2D Uniform tilings

  • GIF animations of various algorithms

  • Others

Many more to be comtinued ...

How to use

All projects here are implemented in a ready-to-use manner for new comers. You can simply run the examples without tweaking any parameters once you have the dependencies installed correctly.


The recommended way to install all dependencies is simply running the bash script

sudo bash

Or you can install the python libs by pip:

pip install -r requirements.txt

Open source softwares required:

  • python3-tk (for file dialog)
  • ImageMagick (for making gif animations)
  • FFmpeg (for saving animations to video files)
  • POV-Ray (for generating high quality raytracing results)
  • graphviz (for drawing automata of Coxeter groups)
  • Inkscape (optional, for convering large svg files to png)

They can all be installed via command-line:

sudo apt-get install python3-tk imagemagick ffmpeg povray graphviz inkscape

Note pygraphviz also requires libgraphviz-dev:

sudo apt-get install libgraphviz-dev

In the scripts these softwares are called in command line as povray, ffmpeg, convert (from ImageMagick), etc. For Windows users you should add the directories contain these .exe files to the system Path environment variables to let the system know what executables these commands refer to. For example on Windows the default location of POV-Ray's exe file is C:\Program Files\POV-Ray\v3.7\bin\pvengine64.exe, so you should add C:\Program Files\POV-Ray\v3.7\bin to system Path and rename pvengine64.exe to povray.exe, then you can run the scripts without any changes and everything works fine.


I have learned a lot from the following people:


see the LICENSE file.

Popular Mathematics Projects
Popular Algorithms Projects
Popular Mathematics Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.