Documentation
¶
Overview ¶
Pi estimates the value of Pi using Monte Carlo method.
We throw darts into a circle. We can estimate the area of the circle as area of the image * hits / miss. "Throwing a dart" means getting random x / y directions.
Circle is represented by a GIMP-made 1024x1024 png image. Circle is black and the background is white. There is some gradient on the border. We consider 50%+ gray to be black.
Index ¶
Constants ¶
View Source
const Scale = 1_000_000_000
scale is the scale factor we use to avoid floating point arithmetics
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(args *Args) (montecarlo.Experiment, error)
Returns new experiment based on the args
Types ¶
Click to show internal directories.
Click to hide internal directories.