/* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:595.3pt 841.9pt; margin:2.0cm 42.5pt 2.0cm 3.0cm; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->

unit Unit1;

interface

uses

а Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

а Dialogs, ExtCtrls, StdCtrls;

type

а TForm1 = class(TForm)

ааа Timer1: TTimer;

ааа Image1: TImage;

ааа procedure Timer1Timer(Sender: TObject);

ааа procedure FormCreate(Sender: TObject);

ааа procedure Image1Click(Sender: TObject);

а private

ааа { Private declarations }

а public

ааа { Public declarations }

а end;

а const colvo =6;

var

а Form1: TForm1;

аа var

ааааа a:array[1..colvo] of tpoint;

ааааа v,rad,num,r,g,b:integer;

ааааа s:real;

implementation

{$R *.dfm}

procedure init;

var i,j:integer;

begin

а v:=15;

а rad:=300;

а randomize;

а for i:=1 to colvo do

а begin

ааа a[i].x:=(round(rad*cos(pi*i*(360 div colvo)/180))+1048 div 2);

ааа a[i].y:=(round(rad*sin(pi*i*(360 div colvo)/180))+768 div 2);

а end;

а form1.image1.canvas.moveto(a[1].x,a[1].Y);

а form1.image1.canvas.Brush.Color:=clblack;

а form1.image1.canvas.Rectangle(0,0,form1.image1.Width,form1.image1.Height);

end;

procedure move(var n,v:integer);

var x2,y2:real;

begin

а if n=1 then

а begin

ааа x2:=a[colvo].X;y2:=a[colvo].Y;

а end else

а begin

ааа x2:=a[n-1].x;

ааа y2:=a[n-1].Y;

а end;

а s:=sqrt(sqr(x2-a[n].x)+sqr(y2-a[n].y));

а if s<=v then exit;

а a[n].x:=round(a[n].x+v*(-a[n].x+x2)/s);

а a[n].y:=round(a[n].y+v*(y2-a[n].y)/s);

end;

procedure draw(x1,y1,n1,n2,n3:integer);

begin

а form1.image1.Canvas.brush.Color:=tcolor(rgb(n1,n2,n3));

а form1.image1.Canvas.Pen.Color:=tcolor(rgb(n1,n2,n3));

а form1.Image1.Canvas.LineTo(x1,y1);

а form1.image1.Canvas.Ellipse(x1-5,y1-5,x1+5,y1+5);

end;

procedure cikl;

var i:integer;

begin

а for i:=1 to colvo do

а begin

ааа r:=255;

ааа g:=round(s/2);

ааа b:=round(s/2);

ааа draw(a[i].x,a[i].Y,r,g,b);

ааа move(i,v);

а end;

end;

procedure TForm1.Timer1Timer(Sender: TObject);

var i:integer;

begin

а cikl;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

а init;

end;

procedure TForm1.Image1Click(Sender: TObject);

begin

а form1.image1.picture.savetofile('c:\ьюш фюъєьхэЄ√\ъЁєЄю.bmp');

а close;

end;

end.

Hosted by uCoz