Skip to content

primespiral visualizes prime numbers using polar coordinates

License

Notifications You must be signed in to change notification settings

mthaler/primespiral

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

primespiral

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.

Requirements

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.

Usage

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.

Credits

This program was inspired by the wonderful video Why do prime numbers make these spirals?

About

primespiral visualizes prime numbers using polar coordinates

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages