-
Notifications
You must be signed in to change notification settings - Fork 0
java-parallelism-examples/Pi
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
PiApproximation --------------- This application uses an approximation algorithm to compute pi. Imagine a circle inscribed in a square with side length 1. The radius of the circle is 1/2. The area of a circle of radius r is: pi * r * r So, the area of our circle of radius 0.5 is: pi * 0.5 * 0.5 = pi/4 Hence, pi is four times the area of the circle. We can approximate the area of the circle by generating random points in the square of side length 1 and counting how many of them are within the circle, i.e. closer than 0.5 to the center. So, the value of pi is the ratio between the number of inscribed points and the total number of points, times 4.
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published