Koch:s curve - needed
Author Message
Koch:s curve - needed

If anyone have the source code for koch:s curve, please send it to me!

kim

Wed, 18 Jun 1902 08:00:00 GMT
Koch:s curve - needed

Quote:

>If anyone have the source code for koch:s curve, please send it to me!

Kim:

Look for Koch.ZIP on the Fractals and Chaos page of my
Computer Lab.

efg
_________________________________________
efg's Computer Lab:  http://infomaster.net/external/efg

MedTech Research Corporation, Lenexa, KS  USA

Wed, 18 Jun 1902 08:00:00 GMT
Koch:s curve - needed

Quote:
>If anyone have the source code for koch:s curve, please send it to me!

>kim

var
p, dx, dy, m, n, k, l, s: integer;
h, x, y: extended;
t: array [0..20] of integer;
begin
p:= 6;
h:= x_y(3, -1*p); x:=0; y:=0;
moveTo(round(-Left/(Right-Left)*241),round(-Left/(Right-Left)*241));

for n:= 0 to round(x_y(4, p))-1 do begin
m:= n;
for l:= 0 to p-1 do begin
t[l]:= m mod 4;
m:= m div 4;
end;
s:= 0;
for k:= 0 to p-1 do s:= s + (t[k] +1) mod 3 -1;
x:= x + cos(pi * s/3) *h;
y:= y + sin(pi * s/3) *h;
dx:= round((x-Left)/(Right-Left)*241);
dy:= round((y-Top)/(Bottom-Top)*171);
LineTo(x,y)
end;
end;

Should work. It was Delphi code so I might have put some typos in it
when I converted it (I didn't check :-) )
HTH
Sebastian

Wed, 18 Jun 1902 08:00:00 GMT

 Page 1 of 1 [ 3 post ]

Relevant Pages