Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mthaler/primespiral
primespiral visualizes prime numbers using polar coordinates
https://github.com/mthaler/primespiral
golang prime-numbers visualization webapp
Last synced: 2 days ago
JSON representation
primespiral visualizes prime numbers using polar coordinates
- Host: GitHub
- URL: https://github.com/mthaler/primespiral
- Owner: mthaler
- License: bsd-3-clause
- Created: 2020-08-23T19:17:56.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-24T07:53:28.000Z (about 4 years ago)
- Last Synced: 2023-03-24T11:39:33.468Z (over 1 year ago)
- Topics: golang, prime-numbers, visualization, webapp
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/jbarham/primegen) and [Go Graphics](https://github.com/fogleman/gg) 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?](https://www.youtube.com/watch?v=EK32jo7i5LQ)