Spiral Matrix function for Ulam Spirals
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Latest commit 463756c Dec 24, 2012
Permalink
Failed to load latest commit information.
README.md Update README.md Dec 24, 2012
ulam.html Initial commit Dec 24, 2012
ulam.js Initial commit Dec 24, 2012

README.md

ulam

Spiral Matrix function for Ulam Spirals

The main function ulam(w, h, x, y) generates a spiral matrix of width w and height h, and tells you what the value is at position x, y in that matrix. Note that 1,1 is in the top left corner of a matrix. See [Ulam Spiral rectangular grid construction] (http://en.wikipedia.org/wiki/Ulam_spiral#Construction) for more details.

This was mostly a mental exercise, and something for [Joseph] (https://github.com/jcla1) to use.