April 16, 2003

After it works so nicely on Mike Chambers' site I'll also give Sean Voisen's MTCodeBeautifier a try.

As an example here's a little prototype that helps you to draw eggs:

MovieClip.prototype.drawEgg = function(x, y, r) {
var rx = r/1.618;
var ry = r;
var ry1 = 2*ry*.618;
var ry2 = 2*ry*.382;
this.moveTo(x+rx, y);
this.curveTo(rx+x, -0.4142*ry1+y, 0.7071*rx+x, -0.7071*ry1+y);
this.curveTo(0.4142*rx+x, -ry1+y, x, -ry1+y);
this.curveTo(-0.4142*rx+x, -ry1+y, -0.7071*rx+x, -0.7071*ry1+y);
this.curveTo(-rx+x, -0.4142*ry1+y, -rx+x, y);
this.curveTo(-rx+x, 0.4142*ry2+y, -0.7071*rx+x, 0.7071*ry2+y);
this.curveTo(-0.4142*rx+x, ry2+y, x, ry2+y);
this.curveTo(0.4142*rx+x, ry2+y, 0.7071*rx+x, 0.7071*ry2+y);
this.curveTo(rx+x, 0.4142*ry2+y, rx+x, y);

And this is how it's used:

for (var i = 0; i<100; i++) {
this.lineStyle(0, 0);
var y = 100+Math.random()*300;
this.drawEgg(100+Math.random()*500, y, y/10);

Posted at April 16, 2003 08:25 PM | Further reading

Hmmmm. These [BR] look a bit strange...

Posted by: coma2mario on April 16, 2003 08:41 PM

Yeah, yeah ... there is a bug when using Convert Line Breaks. I don't know how to get around it.

Posted by: Sean Voisen on April 16, 2003 10:51 PM

turn off "convert line breaks" and then wrap your non-code text in

that should do it.

mike chambers


Posted by: mike chambers on April 17, 2003 12:21 AM

Thanks guys. I already turned "convert line breaks" off, but i'll try it again.

Posted by: coma2mario on April 17, 2003 10:17 AM


I had been thinking about how to draw an egg shape just last week. Thanks for posting this - now I can deliver an easter themed screen saver to our clients. If you'd like to see it I've posted it on Flazoom.com here:




Posted by: CHris on April 17, 2003 04:50 PM
Post a comment

Email Address:



Remember info?

Thank you!

Most Visited Entries
Sketches, Works & Source Code
In Love with
Powered by
Movable Type 2.661

© Copyright Mario Klingemann

Syndicate this site:
RSS 1.0 - RSS 2.0

Quasimondo @ flickr
Quasimondo @ LinkedIn
Quasimondo @ Twitter
Quasimondo @ Facebook
Quasimondo @ MySpace
Quasimondo is a Bright
Citizen of the TRansnational Republic
My other blog in german

My family name is written Klingemann,
not Klingelmann, Klingeman, Klingaman, Kingemann,
Kindermann, Killingaman, Klingman, Klingmann, Klingonman
Klingemman, Cleangerman, Klingerman or Kleangerman

profile for Quasimondo at Stack Overflow, Q&A for professional and enthusiast programmers