Eat your greens!

Actually, I am a rocket scientist
Home » geekage » God bows to math

God bows to math

Posted in geekage

Ever wondered how to draw a Fibonacci spiral using only CSS and JavaScript? Well, wonder no more. If you want to change the amount of the spiral that’s visible, add a parameter ‘scale’ to the URL. Well, it’s actually an approximation to a spiral made by drawing sections of circles, but who’s going to notice? (Fibonacci number generator found at LiteratePrograms.)

Here’s a simple logarithmic spiral. Change a and b in the URL to alter its appearance. It becomes quite dull as b approaches 0. Update: try pressing the cursor keys while looking at the spiral. Negative values of b are kind of fun.

Judge for yourself which of these spirals best represents a nautilus shell.

4 Responses to “God bows to math”

  1. I see you’re developing your DOM fu at the moment. Very cool.

    However, it’s not very accessible. ;-)

  2. I wonder if the keyboard-operated one would fail WCAG because it can’t be used with a mouse?

  3. PS I like ‘DOM fu’.

  4. I thought I was the only one dull enough to be interested in this (my site layout all corresponds to the golden ratio). Nice work Jim.

Leave a Reply