unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, math;
type
TForm1 = class(TForm)
PB1: TPaintBox;
B1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Timer1: TTimer;
procedure B1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
x, y, x1, y1, x2, y2, x3, y3, x4, y4, r, r1, i: Integer;
Alpha,Alpha1: Real;
implementation
{$R *.dfm}
procedure TForm1.B1Click(Sender: TObject);
begin
x:=Round(PB1.Width/2);
y:=Round(PB1.Height/2);
r:=150;
r1:=100;
Alpha:=0;
Timer1.Enabled:=true;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
PB1.Canvas.Pen.Color:=clBtnFace;
PB1.Canvas.Brush.Style:=bsSolid;
PB1.Canvas.Brush.Color:=clBtnFace;
PB1.Canvas.FillRect(Rect(0,0 , PB1.Width,PB1.Height));
If (Alpha>=2*pi) then Alpha:=0;
Alpha:=Alpha+pi/180;
Alpha1:=Alpha;
PB1.Canvas.Pen.Width:=2;
PB1.Canvas.Pen.Color:=clPurple;
PB1.Canvas.Brush.Color:=clPurple;
For i:=1 to 12 do
begin
x1:=x+Round(Cos(Alpha1)*r1);
y1:=y+Round(Sin(Alpha1)*r1);
x2:=x+Round(Cos(Alpha1+190*(pi/180))*r1);
y2:=y+Round(Sin(Alpha1+190*(pi/180))*r1);
x3:=x+Round(Cos(Alpha1-25*(pi/180))*20*r1);
y3:=y+Round(Sin(Alpha1-25*(pi/180))*20*r1);
x4:=x+Round(Cos(Alpha1+25*(pi/180))*20*r1);
y4:=y+Round(Sin(Alpha1+25*(pi/180))*20*r1);
If (i Mod 2=0) then
begin
PB1.Canvas.Arc(x1-r,y1-r,x1+r,y1+r , x2,y2,x3,y3); //Внешняя
end
else
begin
PB1.Canvas.Arc(x1-r,y1-r,x1+r,y1+r , x2,y2,x4,y4);
end;
Alpha1:=Alpha1+(360/12)*(pi/180);
end;
end;
end.