Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drvinceknight/monte_carlo_simulation_for_estimating_pi
Repo for a script to make rain drops in a field so as to estimate pi.
https://github.com/drvinceknight/monte_carlo_simulation_for_estimating_pi
Last synced: 2 months ago
JSON representation
Repo for a script to make rain drops in a field so as to estimate pi.
- Host: GitHub
- URL: https://github.com/drvinceknight/monte_carlo_simulation_for_estimating_pi
- Owner: drvinceknight
- Created: 2013-05-05T09:05:44.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-11-19T16:34:10.000Z (about 4 years ago)
- Last Synced: 2024-06-20T00:45:27.955Z (7 months ago)
- Language: Python
- Size: 246 KB
- Stars: 13
- Watchers: 3
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Making rain fall in a field so as to estimate pi.
This repo contains some code that simulates rain fall in a square field and counts the number of drops that fall in an inscribed circle so as to estimate pi.
## Usage
python Estimate_pi.py 500
This returns:
----------------------
500 drops
pi estimated as:
3.112
----------------------*but* also outputs a plot:
![500 drops](500_drops.png)
If we have 100,000 drops we get:
![100,000 drops](100000_drops.png)
If we have 1,000,000 drops we get:
![1,000,000 drops](1000000_drops.png)
# License Information
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0](http://creativecommons.org/licenses/by-sa/3.0/us/) license. You are free to:
* Share: copy, distribute, and transmit the work,
* Remix: adapt the workUnder the following conditions:
* Attribution: You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
* Share Alike: If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.When attributing this work, please include me (but don't feel obliged to: I'd just be happy to know if anyone made use of it :) ).