https://github.com/carltonmpofu/estimating-pi-csharp
Estimating Pi using Monte Carlo Simulation in C#
https://github.com/carltonmpofu/estimating-pi-csharp
csharp
Last synced: 6 months ago
JSON representation
Estimating Pi using Monte Carlo Simulation in C#
- Host: GitHub
- URL: https://github.com/carltonmpofu/estimating-pi-csharp
- Owner: CarltonMpofu
- Created: 2021-09-29T13:00:32.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-08T21:11:43.000Z (almost 2 years ago)
- Last Synced: 2025-03-27T04:41:28.157Z (over 1 year ago)
- Topics: csharp
- Language: C#
- Homepage:
- Size: 627 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# estimating-pi-csharp
Estimating Pi using Monte Carlo Simulation.

An estimate of pi is obtained by dividing the
number of raindrops that hit the circle and the square
and multiplying the result by 4.
## Results
Using 1000 drops:

Using 5 000 drops:

Using 10 000 drops:

Using 100 000 drops:

Using 3 000 000 drops:

Using 10 000 000 drops:

### Notes
The program starts to slow down when using raindrops greater than 10000
due to the plotting of raindrops on the square. Therefore, I commented out the
plotting feature and only focused on getting the results for raindrop
values greater than 10000.
I will look for ways to optimize the program in the future.