home *** CD-ROM | disk | FTP | other *** search
- { Zeichnen von Julia-Mengen }
-
- PROGRAM Julia;
-
- CONST
- xres = 640;
- yres = 200;
- ak = 2;
- xmin = -2;
- ymin = -2;
- xmax = 2;
- ymax = 2;
- anz = 4;
- pmin = 0; pmax = 0.6;
- qmin = 0; qmax = 0.9;
- r_max = 40;
- k_max = 40;
-
- VAR
- nx, ny,
- x_null, y_null,
- k, bild_x, bild_y: INTEGER;
- dx, dy,
- x, x_alt, y, q, p: REAL;
-
- LABEL exit;
-
- {---------------------------------------------------------}
-
- PROCEDURE iterat (nx, ny: INTEGER);
-
- BEGIN
- k := 0;
- x := xmin + nx * dx;
- y := ymin + ny * dy;
- REPEAT
- x_alt := x;
- x := x * x - y * y + p;
- y := 2 * x_alt * y + q;
- k := k + 1;
- UNTIL (x * x + y * y > r_max) OR (k = k_max);
- IF k = k_max THEN k := 0;
- Plot(x_null + nx, yres - y_null-ny, k mod ak);
- END;
-
- {---------------------------------------------------------}
-
- BEGIN
- ClrScr;
- HiRes;
- HiResColor(15);
- dx := (xmax - xmin) / (xres div anz - 1);
- dy := (ymax - ymin) / (yres div anz - 1);
- FOR bild_x := 0 TO anz-1 DO
- BEGIN
- p := pmin + bild_x * (pmax - pmin) / (anz - 1);
- x_null := bild_x * (xres Div anz);
- FOR bild_y := 0 TO anz-1 DO
- BEGIN
- q := qmin + bild_y * (qmax - qmin) / (anz - 1);
- y_null := bild_y * (yres Div anz);
- FOR nx := 0 TO xres Div anz - 1 DO
- BEGIN
- FOR ny := 0 TO yres Div anz - 1 DO
- iterat(nx,ny);
- IF KeyPressed THEN GOTO exit;
- END;
- END;
- END;
- REPEAT UNTIL KeyPressed;
- exit:
- END.
-