Coder Social home page Coder Social logo

givemepseudonyms / pivisualisations Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 4.66 MB

A way to visualise millions of digits of Pi. Written in Python using Pygame and Tkinter.

Python 100.00%
pi pygame python tkinter self-organising-criticality data data-visualization

pivisualisations's Introduction

This is a work in progress and still contains various bugs and inefficiencies.

PiVisualisations

General Info:

This is a project I started in August 2022 in order to visualise millions of digits of Pi.

Users can choose a visualiser and choose their own settings using the settings GUI: image

The hare.py class

I found that python's inbuilt Turtle was slow and didn't offer the level of control/customisation I needed, so I built a faster version called the Hare. The Hare allows for more granularity over skipping frames, drawing speeds, and is much faster than the Turtle.

The Orbital Visualiser:

image

The orbital visualiser is a rough emulation of two bodies orbiting a central star. Lines are drawn between the two orbiting bodies at a given interval (in this case 314 - the first 3 digits of Pi). Orbits are determined by a distance to the sun (radius) and a speed which are plugged into basic sin/cos equations to produce circular motion.

The Pixel Visualiser:

image

The pixel visualiser produces an outward-moving square spiral. The colour, size and distance offset of each 'pixel' can be linked to each successive digit of Pi. This was the first visualiser I created.

The Sandpile Visualiser (self-organising criticality sim):

image

The sandpile visualiser is a self-organising criticality simulator based upon the Abelian sandpile model. In this version, 31415 'grains' of sand are placed in the central cell. You can learn more about Abelian Sandpiles here: https://www.youtube.com/watch?v=1MtEUErz7Gg

The Spiral Visualiser:

image

The spiral visualiser works in a similar way to the Pixel visualiser except for the fact that it uses a perfect spiral to create visualisations. Often visualisations look like galaxies or sunflowers (especially when the angular offset is close to the golden ratio of 1: 1.1168).

The Turtle Visualiser:

image

The turtle visualiser uses a 'turtle' object which creates lines based upon the path it takes. The angle at which it turns is based upon the digit of Pi given to it. This means that Pi can be 'mapped out'.

The Waveform Visualiser:

image

The waveform visualiser prints each digit of Pi line by line. Each digit is represented by a coloured square whose position, colour, and size can depend on the corresponding digit of Pi.

The Web Visualiser:

image

The web visualiser maps the path of Pi and the prevelence of connections between digits. The visualiser features the digits 0-9 in a circle. For each sequence of digits, a line is drawn from the first digit to the next. This creates 'web' patterns.

pivisualisations's People

Contributors

givemepseudonyms avatar

Stargazers

Terence Grover avatar

Watchers

Kostas Georgiou avatar  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.