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  
 
 [ 3 post ] 

 Relevant Pages 

1. Re.Koch curve

2. How do I draw the Koch curve

3. Need routine to draw bezier curves.

4. Delphi Learning Curve

5. Wanted: RNG with bell-curve distro

6. Help, With Quick Pascal - Curve Sketching

7. CURVE FITTER WANTED!

8. plot polar curve in delphi3.How do?

9. distribution curves?

10. A arcanoid clone with a curved surface

11. Polynomial Curve Fitting

12. Programming curves

 

 
Powered by phpBB® Forum Software