unit Unit13; { This software has been designed and it is CopyLefted by Han de Bruijn: (===) @-O^O-@ #/_\# ### } INTERFACE uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, Grafisch; type TForm1 = class(TForm) Image1: TImage; procedure Toetsdruk(Sender: TObject; var Key: Char); procedure Scheppen(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; IMPLEMENTATION {$R *.dfm} var veel : integer; r : double; procedure proef; const dik : integer = 3; var a,l2,l3,lr : double; m,n : integer; begin with Form1.Image1.Canvas do begin Brush.Color := clBlack; Pen.Width := 1; Pen.Color := clBlack; end; l2 := ln(2); l3 := ln(3); lr := ln(r); m := 0; n := 0; while true do begin with Form1.Image1.Canvas do Ellipse(x2i(m)-dik,y2j(n)-dik,x2i(m)+dik,y2j(n)+dik); if (m > veel) or (n > veel) then Break; a := m*l2 - n*l3 - lr; if a < 0 then m := m + 1 else n := n + 1; end; end; procedure tekenen; var i,j : integer; x,y : double; begin with Form1.Image1.Canvas do begin Brush.Color := clWhite; Pen.Width := 1; Pen.Color := clBlack; end; for i := 0 to veel do begin for j := -10 to veel-10 do begin with Form1.Image1.Canvas do Ellipse(x2i(i)-2,y2j(j)-2,x2i(i)+2,y2j(j)+2); end; end; with Form1.Image1.Canvas do begin Pen.Width := 2; Pen.Color := clYellow; MoveTo(x2i(0),y2j(ymin)); LineTo(x2i(0),y2j(ymax)); MoveTo(x2i(xmin),y2j(0)); LineTo(x2i(xmax),y2j(0)); Pen.Color := clRed; y := -ln(r)/ln(3); MoveTo(x2i(0),y2j(y)); x := xmax; y := ln(2)/ln(3)*x - ln(r)/ln(3); LineTo(x2i(x),y2j(y)); end; proef; end; procedure TForm1.Toetsdruk(Sender: TObject; var Key: Char); { Inactive } var x,y : double; begin with Form1.Image1.Canvas do begin Pen.Color := clBlue; y := -ln(r)/ln(3)+1; MoveTo(x2i(0),y2j(y)); x := xmax; y := ln(2)/ln(3)*x - ln(r)/ln(3)+1; LineTo(x2i(x),y2j(y)); y := -ln(r)/ln(3)-ln(2)/ln(3); MoveTo(x2i(0),y2j(y)); x := xmax; y := ln(2)/ln(3)*x - ln(r)/ln(3)-ln(2)/ln(3); LineTo(x2i(x),y2j(y)); end; Form1.Image1.Picture.SaveToFile('unit13a.bmp'); end; procedure TForm1.Scheppen(Sender: TObject); { At moment of creation } begin veel := 50; r := 100; xmin := 0; xmax := veel; ymin := -10 ; ymax := veel-10; TV(Form1.Image1); ClearDevice; tekenen; Form1.Image1.Picture.SaveToFile('unit13.bmp'); end; END.