- Thursday, January 1, 2015

A four parameter elephant

You might have noticed the little wiggly elephant in the corner of the screen. It's a "four parameter" elephant that's based around an old physics joke that I wrote about in this post a while back.

I got inspired to use it as the logo for my blog after reading about a math paper that claimed it was really possible. But, of course, the authors didn't actually publish any code that would let you play with it.

After working out the math in MATLAB, I set out to implement a javascript version using svg.js.

Just for fun, the animation is supposed to start out looking roughly like a cell. Then it "develops" into an elephant.

After that, if you keep moving your mouse over it, you'll trigger it to keep moving. Sometimes it wiggles its trunk, and sometimes it goes back to being a single cell for a while.

I used svg.js to build it. If you want to see the code, you can check it out here on my CodePen account. If you want to see the math check out the original paper:

“Drawing an elephant with four complex parameters” by Jurgen Mayer, Khaled Khairy, and Jonathon Howard, Am. J. Phys. 78, 648 (2010), DOI:10.1119/1.3254017.

No comments :

Post a Comment