Skip to content

ChristianHolm1/processing_pi_approximater

Repository files navigation

Pi Approximator in Processing

This project serves as a simple demonstration in Processing to approximate the value of Pi using a Monte Carlo method.

About

This Processing sketch utilizes a Monte Carlo algorithm to estimate the value of Pi. It generates random points within a square and determines the ratio of points falling inside a quarter-circle inscribed within the square to the total points generated. By leveraging this ratio, an approximation of Pi can be obtained.

Getting Started

To run this project, ensure you have Processing installed on your machine.

  1. Clone this repository.
  2. Open the pi_approximator.pde file using Processing.
  3. Click the "Run" button within the Processing IDE to execute the sketch.

Learnings

This project is created as part of a test project to learn Processing. It offers insights into:

  • Implementing Monte Carlo methods in Processing.
  • Visualizing random point generation and its relation to Pi approximation.

Demonstration

Demonstration GIF

Demonstration of the first 1000 frames

Pi apporximation

Pi apporximated using the version 2 (more colorful)

Resources

Releases

No releases published

Packages

No packages published