Giter VIP home page Giter VIP logo

pywonderland's Introduction

A Tour in the Wonderland of Math with Python


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


Build Status


About this repo

Math is beautiful, but to truly enjoy it one has to walk a long and painful way learning lots of boring stuff before he could see the full landscape. I hope this repo could help those people without a strong math background get some intuitive understanding of the beauty and elegance of math. The 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 website for the docs is still under construction and will be released soon.

This repository will be always under construction since there are too many interesting things in math that can be shown by code. Pull requests, issues, questions, and suggestions are all welcomed!

NB: I will only maintain the code for python >= 3.5.

Examples

Here is a very small portion of examples that this project can do:

How to use

Each subdirectory in /src/ is a single program (except that glslhelpers is a helper module for running glsl programs and misc is a collection of independent scripts), any file named main.py, run_*.py, example_*.py is an executable script that gives some output.

List of algorithms

Here is a list of some algorithms implemented in this project:

Dependencies

The recommended way to install all dependencies is simply running the script install_dependencies.sh.

Or you can install the python libs by pip:

pip install -r requirements.txt

A few exceptions are: cairocffi also requires libffi-dev and pygraphviz also requires libgraphviz-dev:

sudo apt-get install libffi-dev libgraphviz-dev

Open source softwares:

  • 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)

They can all be installed via command-line:

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

In the scripts these softwares are called in command line by povray, ffmpeg, convert, etc. For Windows users you should add the directories contain these .exe files to the system Path environment variables. 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.

Thanks

I have learned a lot from the following people:

License

see the LICENSE file.

pywonderland's People

Contributors

isaaclyautey avatar lucas-c avatar neozhaoliang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.