Skip to content

initialcapacity/pi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pi Estimation

Estimates the value of π using the Monte Carlo method.

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.

Illustration of a Monte Carlo simulation

Run Estimation

Build and run an estimation with the default configuration.

go build ./cmd/pi
./pi

Use the --help flag to see configuration options.

./pi --help

Development

  1. Run tests

    go test ./...
  2. Check formatting

    gofmt -d .
  3. Check linking

    go vet ./...
  4. Generate new diagram for the readme

    go run ./cmd/generatediagram

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages