Курсовая работа: Простая замкнутая ломаная кривая
Begin
{Проверка 1- го случая}
if (A.x=C.x)and(A.y=C.y) and (B.x=D.x)and(B.y=D.y) then Peres:=False
else
if (A.x=D.x)and(A.y=D.y) and (B.x=C.x)and(B.y=C.y) then Peres:=False
else
{Проверка 2- го случая}
If (A.x=C.x)and(A.y=C.y) then if Prin(D,A,B) or Prin(B,C,D) then Peres:=true else Peres:=False
else
If (A.x=D.x) and (A.y=D.y) then if Prin(C, A, B) or Prin (B,C,D) then Peres:=true else Peres:=False
else
If (B.x=C.x)and(B.y=C.y) then if Prin(D,A,B) or Prin(A,C,D) then Peres:=true else Peres:=False
else
If (B.x=D.x)and(B.y=D.y) then if Prin(C,A,B) or Prin(A,C,D) then Peres:=true else Peres:=False
else { общейслучай }
If A.x=B.x then begin if C.x=D.x then if Prin(A,C,D) or
Prin(B,C,D) or
Prin(C,A,B) or
Prin(D,A,B) then Peres:=true else Peres:=false
else begin
k2:=(C.y-D.y)/(C.x-D.x);
b2:=C.y-k2*C.x;
O.x:=A.x;
O.y:=k2*O.x+b2;
if Prin(O,C,D) and Prin(O,A,B) then Peres:=true
else Peres:=False
end end
else if C.x=D.x then begin
k1:=(A.y-B.y)/(A.x-B.x);