Fibonacci spiral fun with Java3D

Recently I became fascinated with the Fibonacci series and the Golden Ratio, especially with how they turn up in nature. I had been meaning to explore the Java3D API for a while, so I thought it would be a good idea to try and generate some Fibonacci spirals and get to know Java3D that way. Here is one example of what I could come up with.

fibo_java3d_1

I was able to tweak the code to highlight interesting patterns. I actually thought for a moment that I had “discovered” a few things like for instance how if you number the “dots” by the order in which they are introduced into the simulation, the spirals that visually strike you are formed by joining the dots where the number difference is a fibonacci number.

Of course all this is common knowledge in the mathematics community. But I think I was able to create much prettier visualizations :) Here is a snapshot showing how the two most obvious spirals are where the dot-number difference is equal to 13 and 21 (successive Fibonacci numbers). Dot number 1 is on the far right.

fibo_java3d_2

And here is this interesting effect when the dots are numbered in reverse order, the dots corresponding to the Fibonacci sequence (1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144) line up along the x-axis.

fibo_java3d_3

Well, this is animation after all – so here is my first ever YouTube video :) If you are interested, here is the source code (not much documentation I’m afraid).

I found the fantastic sunflower photo on Flickr. The photo description has a good explanation of why the fibonacci spirals happen and the maths behind it. If you want to explore more, have a look at this Science News Online article.

Update 2008-12-13: Found this link to some nice mathematical analysis of number spirals (not Fibonacci): http://www.numberspiral.com/

8 Responses to Fibonacci spiral fun with Java3D

  1. decoding says:

    Well done, really interesting project!

    Reading the source code, Java3D doesn’t look so hard after all.

  2. Luca says:

    Hi there, thanks for ‘resuscitating’ my sunflower pic on Flickr… they have banned it from Flickr.explore

  3. monica says:

    Wow! that was amazing :) Wish I could think up things like that :)

    nice work – and nice explanation/webpage along with it :)

  4. Boo says:

    Pretty sweet stuff.
    I’m doing a project on Fibonacci and the Golden Ratio.
    It’s lots of fun.
    :D

  5. ayesha says:

    well done……..i like ur experiment.
    keep it up

  6. AvichSays says:

    This looks really neat. I love drawing Fibonacci spirals.

  7. I’m amazed, I have to admit. Seldom do I encounter a blog that’s both educative and
    interesting, and without a doubt, you have hit the nail on the head.
    The issue is an issue that too few people are speaking intelligently about.
    I’m very happy I found this during my search for something relating to
    this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: