Текущий архив: 2003.07.14;
Скачать: CL | DM;
Вниз
Invalid Floating operation ??? Найти похожие ветки
← →
Demetrius2003 (2003-07-01 01:06) [0]Function Searching(stor:rebro;var x,y:integer):boolean;
var
angle,x1,y1,startx,alfa,beta,rad:real;
i,k,cx,cy,curX,curY:integer;
Fnd:boolean;
begin
cx:=(stor.x1+stor.x2) div 2;
cy:=(stor.y1+stor.y2) div 2;
if stor.x1-stor.x2=0 then begin
if stor.y1-stor.y2>=0 then angle:=pi else angle:=0
end
else
angle:=pi/2-arctan((stor.y1-stor.y2)/(stor.x1-stor.x2));
StartX:=cx;
x1:=StartX;
fnd:=False;
repeat
if cos(angle)=0 then y1:=cy else
y1:=sin(angle)/cos(angle)*x1+cy;
rad:=len(round(x1),round(y1),stor.x1,stor.y1);
if (sqr(stor.y1-y1)/sqr(rad)=1.0) then begin // Invalid Floating Operation
if (stor.y1-y1)>=0 then alfa:=pi/2
else alfa:=-pi/2;
end
else
alfa:=arctan(abs( ((stor.y1-y1)/rad)/sqrt(1-(sqr(stor.y1-y1)/sqr(rad))) ));
if x1-stor.x1>0 then alfa:=pi-abs(alfa);
Fnd:=ParamCircle(round(x1),round(y1),-alfa,alfa,len(round(x1),round(y1),stor.x1,stor.y1),x,y);
x1:=x1+0.1;
until (fnd=true) or (x1>=1024) or (x1<=0) or (y1<=0) or (y1>=728);
if fnd then begin
curx:=x;
cury:=y;
end
else
begin
curx:=32000;
cury:=32000;
end;
if Fnd then Searching:=True;
StartX:=cx;
x1:=StartX;
fnd:=False;
repeat
if cos(angle)=0 then y1:=cy else
y1:=sin(angle)/cos(angle)*x1+cy;
rad:=len(round(x1),round(y1),stor.x1,stor.y1);
if (sqr(stor.y1-y1)/sqr(rad)=1) then begin
if (stor.y1-y1)>=0 then alfa:=pi/2
else alfa:=-pi/2;
end
else
alfa:=arctan(abs( ((stor.y1-y1)/rad)/sqrt(1-(sqr(stor.y1-y1)/sqr(rad)))) );
if x1-stor.x1>0 then alfa:=pi-abs(alfa);
Fnd:=ParamCircle(round(x1),round(y1),-alfa,alfa,len(round(x1),round(y1),stor.x1,stor.y1),x,y);
x1:=x1-0.1;
until (fnd=true) or (alfa<=pi/360*5);
if Fnd then Searching:=True;
if Fnd and (curx<>32000) then
if len(cx,cy,round(curx),round(cury)) < len(cx,cy,x,y)
then begin x:=curx; y:=cury end;
if not(Fnd) and (curx<>32000) then begin x:=curx; y:=cury end;
if not(Fnd) and (curx=32000) then Searching:=False else Searching:=True;
end;
← →
Beginner3000 (2003-07-01 01:20) [1]Перевожу:
99.9% деление на ноль
← →
Palladin (2003-07-01 01:20) [2]
> Invalid Floating operation ???
Invalid Floating operation !!!
ЗЫ: Щаз все бросил и начал логику рыхлить... ни строчки коментария, ни строчки поста...
← →
Beginner3000 (2003-07-01 01:25) [3]Наврал
ещё корень из отрицательного числа
Страницы: 1 вся ветка
Текущий архив: 2003.07.14;
Скачать: CL | DM;
Память: 0.44 MB
Время: 0.007 c