A small program that visualizes prime numbers using polar coordinates. Each prime number is plotted as a point (r, theta) = (p, p) where r is the radius, theta the angle and p a prime number.
To build primespiral primegen and Go Graphics need to be installed. Do go get github.com/jbarham/primegen
and go get github.com/fogleman/gg
to install these packages.
Run primespiral with go run primesprial.go
Open a web browser and enter http://localhost:8080/primes?max=1000&pointsize=10
The max query parameter specifies the largest prime number that is drawn and the pointsize parameter sets the size of the points.
This program was inspired by the wonderful video Why do prime numbers make these spirals?