Показать сообщение отдельно
  #1  
Старый 04.01.2007, 22:26
-=NAV=- -=NAV=- вне форума
Прохожий
 
Регистрация: 04.01.2007
Сообщения: 1
Репутация: 10
Лампочка Подскажите можно ли переделать множество мандельброта в множество Жюлия.

Подскажите что нужно поменять в программе что бы полуть множество Жюлия.
unit MANDELBROT;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;

type
TForm1 = class(TForm)
Panel1: TPanel;
Image1: TImage;
Button2: TButton;
procedure Button2Click(Sender: TObject);

private
public
end;
var
Form1: TForm1;
implementation

{$R *.DFM}

//MANDELBROT
procedure TForm1.Button2Click(Sender: TObject);
var
cc: integer;
tgx, tgy, rX1, rY1: extended;
x, y, l, n:integer;
c_real, c_img, x1, X2,Y1,Y2: Double;
xx, zm, zr, zi: Double;
begin
n:=300;
L:=10;

{
x1:=-0.19920;
x2:=-0.12954;
y1:=1.01480;
y2:=1.06707;
}

x1:=-2.4;
x2:=0.8;
y1:=-1.2;
y2:=1.2;


if x1<0 then begin if x2>0 then tgx:=abs(x1)+abs(x2); end;
if x1<0 then begin if x2<0 then tgx:=abs(x1)-abs(x2); end;
if x1>0 then begin if x2>0 then tgx:=x2-x1; end;
if y1<0 then begin if y2>0 then tgy:=abs(y1)+abs(y2); end;
if y1<0 then begin if y2<0 then tgy:=abs(y1)-abs(y2); end;
if y1>0 then begin if y2>0 then tgy:=y2-y1; end;

begin
screen.Cursor:=crHourGlass;
for x:=0 to image1.Width do
begin
rX1:=X1+(tgx / image1.Width)*x;
for y:=0 to image1.Height do
begin
rY1:=Y1+(tgy / Image1.Height)*y;
zr:=0;
zi:=0;
zm:=0;
for cc:=0 to n do
begin
xx:=zr;
zr:=sqr(xx)-sqr(zi)+ rX1;
zi:=2*xx*zi+rY1;
zm:=sqr(zr)+sqr(zi);
if zm>L then break;
end;

if zm<L then image1.Canvas.Pixels[x,y]:=clblack else image1.Canvas.Pixels[x,y]:=rgb(cc*5,cc*9,cc*4);

end;
end;
screen.cursor:=crDefault;
end;
end;
end.
Ответить с цитированием