property Y1: Integer read FY1 write SetY1;
property X2: Integer read FX2 write SetX2;
property Y2: Integer read FY2 write SetY2;
function CalculateLineLength: Double;
end;
function TLine. CalculateLineLength: Double;
begin
if not LengthCalculated then
begin
LineLength:= Sqrt(Sqr(X2 — X1) + Sqr(Y2 — Y1));
LengthCalculated:= True;
end;
Result:= LineLength;
end;
procedure TLine. SetX1(const Value: Integer);
begin
LengthCalculated:= False;
FX1:= Value;
end;
procedure TLine. SetX2(const Value: Integer);
begin
LengthCalculated:= False;
FX2:= Value;
end;
procedure TLine. SetY1(const Value: Integer);
begin
LengthCalculated:= False;
FY1:= Value;
end;
procedure TLine. SetY2(const Value: Integer);