A Bunch of Dragon Flowers

Capture

var canvas = document.getElementById("canvas"); 
var ctx = canvas.getContext("2d"); 

for (var x = 0; x < 1000; ++x) 
{ 
   for (var y = 0; y < 600; ++y) 
   { 
       var c = -0.835, ci = -0.2321; 
       var z = x / 300.0 - 1.7; 
       var zi = y / 300.0 - 1; 

       for (var i = 255; i > 0; --i) 
       { 
           var a = z * z - zi * zi + c; 
           var b = 2 * z * zi + ci; 
           if (a * a + b * b > 50) 
           { 
               ctx.fillStyle = "rgb("+ i + "," + i + "," + 255 +")"; 
               ctx.fillRect(x, y, 1, 1); 
               break; 
           } 
           z = a; 
           zi = b; 
       } 
    } 
}

 

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s