Estimates the value of π using the Monte Carlo method.
We generate random points within the unit square and count how many fall within a circle of radius 1 centered at the origin. The ratio of the number of points within the circle to the total number of points approaches π/4.
Build and run an estimation with the default configuration.
go build ./cmd/pi
./piUse the --help flag to see configuration options.
./pi --help-
Run tests
go test ./... -
Check formatting
gofmt -d . -
Check linking
go vet ./...
-
Generate new diagram for the readme
go run ./cmd/generatediagram