A tour in the wonderland of math with python.
A collection of python scripts for drawing beautiful figures and animating interesting algorithms in mathematics.
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:
These topics are chosen largely due to my personal taste:
I'll use only popular python libs and build all math stuff by hand (tools like
mathemeticawill 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.
Many more to be comtinued ...
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 install_dependencies.sh
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
sudo apt-get install libgraphviz-dev
In the scripts these softwares are called in command line as
ImageMagick), etc. For Windows users you should add the directories contain these .exe files to the system
Pathenvironment 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\binto system
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.