#include <graphics.h>
#include <conio.h>
void main(void){
register int X=9, Y=2,
step; //X&Y auch gleich für InitGraph
float x_step, x_pos, x_org, x_max,
x_iter, x_temp, //FraktalParameter
y_step, y_pos, y_org, y_max,
y_iter;
initgraph(&X,&Y,""); //Grafik_Init auf 9,2=EGA 640x480
//****************************************************************************
x_org=-2.0; x_max= 0.5;
x_step=(x_max-x_org)/640; //640=MAX_X
y_org=-1.25; y_max= 1.25;
y_step=(y_max-y_org)/480; //480=MAX_Y
for(X=0;X<640;X++){
for(Y=0;Y<480;Y++){ //Über
alle Pixel
x_pos=x_org+X*x_step; y_pos=y_org+Y*y_step;
//Init Iteration
x_iter=0.0;
y_iter=0.0; step=0; //Init Iteration
do{ x_temp=(x_iter*x_iter)-(y_iter*y_iter)+x_pos;
//Temp=rel.-X-FarbWert
y_iter=2*(x_iter*y_iter)+y_pos;
//rel Y-Tiefe=Y-FarbWert
x_iter=x_temp;
//Temp auf X-FarbTiefe
}while((step++<15)&&(((x_iter*x_iter+y_iter*y_iter)<4.0)));
//FarbTiefe->15
putpixel(X,Y,step);}
//Pixel setzen ; ENDE Y-Koord-Schleife
if(kbhit()){X=700;Y=480;}} //Probe auf Abbruch
Programm; ENDE X-Koord
//****************************************************************************
getch();closegraph();} //Ende Main