From instruction: Complexity, intensity and disorder
Code: frcCID by 0rel
fractal boundary of the julia set
float complexity = 0.6f; float intensity = 0.8f; float disorder = 0.4f; int depth = int( 15.0f * complexity ); float c = 255.0f * intensity; float cAdd = 127.0f * ( 1.0f - intensity ); color cIn = color( c + 127 ); double reC = -0.6 * disorder; double imC = disorder; double pxl = 0.0065; int checkZo( double a, double b ) { int i = 0; while( i < depth ) { double imZ = 2.0 * a * b + imC; double reZ = a * a - b * b + reC; if( reZ * reZ + imZ * imZ > 4.0 ) break; a = reZ; b = imZ; ++i; } return i; } void draw() { double im = -0.96; for( int y=0; y<height; y++ ) { double re = -1.5; for( int x=0; x<width; x++ ) { int i = checkZo( re, im ); if( i >= depth ) { set( x, y, cIn ); } else { i = int( ( i / float( depth ) ) * c + cAdd ); set( x, y, color( i ) ); } re += pxl; } im += pxl; } } void setup() { size( 200, 200 ); }
[download]
Written in Processing.