unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
Bt1: TButton;
Button2: TButton;
Timer1: TTimer;
procedure Button2Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
i:Integer;
implementation
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
begin
Timer1.OnTimer(self);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var xstart, ystart, xradius, yradius, aufloesung: Integer;
begin
ystart:=100;
xstart:=100;
yradius:=100;
xradius:=100;
aufloesung:=100;
i:=i+1;
bt1.Top:=round(ystart+xradius+(xradius*sin(i/aufloesung)));
bt1.Left:=round(xstart+yradius+(yradius*cos(i/aufloesung)));
end;
end.