Курсовая работа: Система координат канви
if (b.ID = Bl.ID) or (not b.exist)
continue;
d := sqrt(sqr(b.x-Bl.x)+sqr(b.y-Bl.y));
if d < minD then
begin
minD := d;
nearestBall := b;
end;
end;
dx := Bl.x - ToLz.x;
dy := Bl.y - ToLz.y;
d := sqrt(dx*dx+dy*dy);
if (dy)>0
a2Lz := arccos(dx/d)
else a2Lz := -arccos(dx/d);
hitX := Bl.x + cos(a2Lz)*Bl.R;
hitY := Bl.y + sin(a2Lz)*Bl.R;
dx := nearestBall.x - hitX;
dy := nearestBall.y - hitY;
d := sqrt(dx*dx+dy*dy);
if (dy)>0
then a := arccos(dx/d)
else a := -arccos(dx/d);
Result := a;}
void ComputerMove(){
Cue->visible = True;
CompAngle = CalculateAngle;
if(CompAngle > Cue->angle)
CompMove = 1;