rm-hull / arnolds-cat-map.cljs
Last updated

Arnold's cat map is named after the mathematician Vladimir Arnold, who in the 1960s demonstrated the effect of repeatedly applying a linear transformation to an image of a cat (hence the name). Each animation frame transforms the pixels according to the pisano period of the largest dimension (width or height). Eventually the image will restore back to the original, but the number of cycles this takes will vary wildly depending on the period. Inspired by: http://pi3.sites.sheffield.ac.uk/tutorials/week-5. In number theory, the nth Pisano period, written π(n), is the period with which the sequence of Fibonacci numbers, modulo n repeats. For example, the Fibonacci numbers modulo 3 are 0, 1, 1, 2, 0, 2, 2, 1, 0, 1, 1, 2, 0, 2, 2, 1, etc., with the first eight numbers repeating, so π(3) = 8. Pisano periods are named after Leonardo Pisano, better known as Fibonacci.

Fork me on GitHub!