Re.Koch curve 
Author Message
 Re.Koch curve

Hi Kim

You asked for a Koch source code. Here it is!
If you need help or if you want the source code of other types
(for example Mandelbrot) let me know.

Joerg Teubl

======================================

======================================

program Koch;
{Joerg Teubl}

uses crt,graph;

var treiber,modus  : integer;
    grad           : real;

procedure zeichnen(grad: real;s:integer);
var h,v :word;
begin
 h:=round(s*cos(grad));
 v:=round(s*sin(grad));
 linerel(h,v);
end;

procedure Generator(Stufe,s :integer);
begin

if stufe > 0 then
  begin
    generator(stufe-1,s div 3);
    grad:=grad-pi / 3;
    generator(stufe-1,s div 3);
    grad:=grad+(pi/3)*2;
    generator(stufe-1,s div 3);
    grad:=grad-pi/3;
    generator(stufe-1,s div 3);
  end
             else zeichnen(grad,s);
end;

begin
 treiber:=detect;
 initgraph(treiber,modus,'c:\bp\bgi');
 setcolor(0);
 lineto(0,400);
 setcolor(7);
 grad:=0;
 generator(4,650);
 readln;
end.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How do I draw the Koch curve

2. Koch:s curve - needed

3. Delphi Learning Curve

4. Wanted: RNG with bell-curve distro

5. Help, With Quick Pascal - Curve Sketching

6. CURVE FITTER WANTED!

7. plot polar curve in delphi3.How do?

8. Need routine to draw bezier curves.

9. distribution curves?

10. A arcanoid clone with a curved surface

11. Polynomial Curve Fitting

12. Programming curves

 

 
Powered by phpBB® Forum Software