Procedure Rotation(var a,b:longint,x,y,n:longint,d:boolean);
Label
1,2,3,4,5,6; //标记
Var
Time,times,c,e,f,r:longint;
k:real;
Begin
R:=int(sqrt((x-a)*(x-a)+(y-b)*(y-b)));
Time:=4*r+2;
K:=n/360;
Times:=int(time*k);
If d=true then begin
1:
If b>y then
If a-times<x-r then
Begin
Times:=times-(a-x+r);
B:=y;
A:=x-r;
Goto 1;
End else
Begin
2:
A:=a-times;
B:=y+int(sqrt(r*r-(a-x)*(a-x)));
Exit;
End;
If b=y then
If a>x then goto 2 else goto3;
If b<y then
If a+times >x+r then
Begin
Times:=times-(x+r-a);
B:=y;
A:=x+r;
Goto 1;
End else
Begin
3:
A:=a+times;
B:=y-int(sqrt(r*r-(a-x)*(a-x)));
Exit;
End;
End;
If d=false then
Begin
4:
If b>y then
If a+tims>x+r then
Begin
Times:=times-(x+r-a);
B:=y;
A:=x+r;
Goto 4;
End else
Begin
5:
A:=a+times;
B:=y+int(sqrt(r*r-(a-x)*(a-x)));
Exit;
End;
If b=y then
If a>x then goto 6 else goto 5;
If b<y then
If a-times<x-r then
Begin
Times:=times-(a-x+r);
B:=y;
A:=x-r;
Goto 4;
End else
Begin
6:
A:=a-times;
B:=y-int(sqrt(r*r-(x-a)*(x-a)));
Exit;
End;
End;
End;
Label
1,2,3,4,5,6; //标记
Var
Time,times,c,e,f,r:longint;
k:real;
Begin
R:=int(sqrt((x-a)*(x-a)+(y-b)*(y-b)));
Time:=4*r+2;
K:=n/360;
Times:=int(time*k);
If d=true then begin
1:
If b>y then
If a-times<x-r then
Begin
Times:=times-(a-x+r);
B:=y;
A:=x-r;
Goto 1;
End else
Begin
2:
A:=a-times;
B:=y+int(sqrt(r*r-(a-x)*(a-x)));
Exit;
End;
If b=y then
If a>x then goto 2 else goto3;
If b<y then
If a+times >x+r then
Begin
Times:=times-(x+r-a);
B:=y;
A:=x+r;
Goto 1;
End else
Begin
3:
A:=a+times;
B:=y-int(sqrt(r*r-(a-x)*(a-x)));
Exit;
End;
End;
If d=false then
Begin
4:
If b>y then
If a+tims>x+r then
Begin
Times:=times-(x+r-a);
B:=y;
A:=x+r;
Goto 4;
End else
Begin
5:
A:=a+times;
B:=y+int(sqrt(r*r-(a-x)*(a-x)));
Exit;
End;
If b=y then
If a>x then goto 6 else goto 5;
If b<y then
If a-times<x-r then
Begin
Times:=times-(a-x+r);
B:=y;
A:=x-r;
Goto 4;
End else
Begin
6:
A:=a-times;
B:=y-int(sqrt(r*r-(x-a)*(x-a)));
Exit;
End;
End;
End;