While attempting a masters degree in math I came across a little article about fractals. Since then I've generated hundreds of my own. Here are some of them:
|
Image |
Size |
Comment |
|
291Kb |
Etched jewels |
|
|
188Kb |
Magic wind |
|
|
134Kb |
Electric Pond |
|
|
77Kb |
This one's kind of ugly |
|
|
571Kb |
Fungal frost--not as bad as it sounds |
|
|
63Kb |
Funky Socks |
|
|
135Kb |
Candy Seahorse |
|
|
554Kb |
Almost the same as fractal1 but daintier |
|
|
159Kb |
Cartoon Dragon |
Here is some Borland C++Builder code to draw a fractal:
void TForm1::Draw()
{
if ( bmp_valid )
return;
Button1->Enabled = false;
const int maxiter = 100; // use 10000 for the other interval, commented below:
double minx, miny, maxx, maxy;
minx = -2.2; maxx = 1.2;
miny = -1.4; maxy = 2.4;
// minx = 0.155206; maxx = 0.155207;
// miny = -0.650837; maxy = -0.650836;
double cr, ci, zr, zi, zsq, tmp;
cr = ci = 0.0;
TCanvas *cnv = bmp->Canvas;
int w = PaintBox1->Width;
int h = PaintBox1->Height;
for ( int i = 0; i < w; i++ ) {
for ( int j = 0; j < h; j++ ) {
cr = minx + i * ( maxx - minx ) / w;
ci = miny + j * ( maxy - miny ) / h;
int count = 0;
zr = 0.0;
zi = 0.0;
zsq = 0.0;
while ( (zsq < 4.0) && (count++ < maxiter) ) {
tmp = zr * zr - zi * zi;
zi = 2.0 * zr * zi + ci;
zr = tmp + cr;
zsq = zr * zr + zi * zi;
}
if ( count == maxiter ) {
cnv->Pixels[i][j] = clBlack;
} else {
cnv->Pixels[i][j] = 1 + count * maxiter; // RGB( count, count, count );
}
}
PaintBox1->Canvas->Draw( 0, 0, bmp );
Caption = "Column " + IntToStr( i );
}
bmp_valid = true;
Button1->Enabled = true;
} // end TForm1::Draw()