Soddy Circles

We have a winner! At 4:05 a.m., I received the following from Ryan Phelan, who will get a free copy of Foundation ActionScript Animation 3.0: Making Things Move!

[kml_flashembed movie=”http://www.bit-101.com/blog/wp-content/uploads/2008/05/soddy_circles_1.swf” width=”600″ height=”600″ /]

And the source.

As you can see, a Soddy Circle is one of the two circles which are tangent to the other three tangent circles. The inner Soddy Circle is between the three, and the outer one surrounds the three if possible, or lies off to the side if necessary.

Ryan beat out Jason Fistner by about 21 minutes, and Anselm Bradford came in less than an hour later. All three were awesome and as far as I can tell are technically accurate and well coded. Ryan was just first. I’d show the rest, but a Soddy Circle is a Soddy Circle is a Soddy Circle. 🙂

I think I might do a little contest like this on a regular basis, as long as my supply of books holds up.

This entry was posted in Flash. Bookmark the permalink.

6 Responses to Soddy Circles

  1. Evan Mullins says:

    Great job Ryan, congrats.

    @KP – Yes, please do more contests!

  2. Jason Fistner says:

    blast!

    oh well
    i spent about 30 minutes trying to ignore the problem and get sleep haha

    please no more challenges
    my brain doesn’t let me let things go

    😛

  3. Jason Fistner says:

    btw…
    i’m able to get this one to error
    🙂

    ArgumentError: Error #2004: One of the parameters is invalid.
    at flash.display::Graphics/drawRoundRect()
    at flash.display::Graphics/drawCircle()
    at soddy_circles_1_fla::MainTimeline/drawSoddyCircle()
    at soddy_circles_1_fla::MainTimeline/drawSoddy()
    at soddy_circles_1_fla::MainTimeline/draw()
    at soddy_circles_1_fla::MainTimeline/onMove()

  4. Ryan Phelan says:

    Hmm… I guess that’s what happens when you rush through some code at 2:00 am to try and win a book! Might just need a conditional around the call to drawSoddyCircle for the radius = NaN case?

  5. gonzalo says:

    Great Job Ryan, congratulations.
    Visually worderfull and very precise code

    And thanks for the source: is an case study

    saludos

  6. claude says:

    Thank you for helping to become more intelligent but what a headache!
    I didn’t understand the formula in the script and i found the
    solution in wikipedia The radius of the 4th circles are given by
    this formula: k4=k1+k2+k3(+or-)2*Math.sqrt(k1*k2+k2*k3+k1*k3) with k=1/R. Knowing the radius it is relatively easy to get the center.
    Wiki says the formula was discovered by Descartes and rediscovered
    by Soddy.
    PS i have already your book.

Leave a Reply