dX1,dY1,dX2,dY2 是矩形
function IsPtInRect(dX, dY: Double; dX1,dY1,dX2,dY2 : double):Boolean;
const
dBuf : double = 10e-10;
begin
Result := (dX > MinValue([dX1,dX2])- dBuf) and (dX < MaxValue([dX1,dX2]) + dBuf) and
(dY > MinValue([dY1,dY2]) - dBuf) and (dY < MaxValue([dY1,dY2]) + dBuf);
end;