Procedure tform12. BitBtn1Click(Sender: tobject)


Download 0.64 Mb.
bet1/3
Sana05.06.2020
Hajmi0.64 Mb.
#115240
  1   2   3
Bog'liq
chizma


Sin(x)

procedure TForm12.BitBtn1Click(Sender: TObject);

var

y,x:integer;



xx,yy:real;

begin


Canvas.MoveTo(0,ClientHeight div 2);

Canvas.LineTo(ClientWidth,ClientHeight div 2);

Canvas.MoveTo(ClientWidth div 2 , 0);

Canvas.LineTo(ClientWidth div 2,ClientHeight);

Canvas.Pen.Color := clNavy;

Canvas.MoveTo(0,0);

for x:= 1 to ClientWidth do begin

xx := x * 8 * 3.1415 / ClientWidth;

yy := sin(xx);

y := trunc(ClientHeight - (yy + 1) * (ClientHeight / 2));

// Pixels orqali chizish

Canvas.LineTo(x,y); sleep(9);



end;

end;




Cos(x)

procedure TForm13.BitBtn1Click(Sender: TObject);

var x,y:integer;

xx,yy:real;

begin

Canvas.MoveTo(0,ClientHeight div 2);



Canvas.LineTo(ClientWidth,ClientHeight div 2);

Canvas.MoveTo(ClientWidth div 2 , 0);

Canvas.LineTo(ClientWidth div 2,ClientHeight);

Canvas.Pen.Color := clNavy;

Canvas.MoveTo(0,0);

for x:= 1 to ClientWidth do begin

xx := x * 8 * 3.1415 / ClientWidth;

yy := cos(xx);

y:=trunc(ClientHeight - (yy + 1) * ClientHeight / 2);

// LineTo orqali chizish afzal

Canvas.LineTo(x,y); sleep(9);

end;


end;



Download 0.64 Mb.

Do'stlaringiz bilan baham:
  1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling