function success = checkRange(ptX, ptY, valX, valY, xLim, yLim)
% checkRange
%   checks whether it is range

%   Project: IMPACT
%   Title of Code: checkRange
%   Relevant additional documentation:
%   Developer: Carlos Gonzalez
%   External Dependencies: NA
%
%   Disclaimer
%   CAUTION: It is strongly recommended that changes to this code
%   should be avoided without first consulting with authors.

% to check if point x and y are withine a small range

% success: 0 - not withine the range
% 1 - withine the range


% integrator or differentiator is not checked
if isequal(valX, 0)
    success = 0;
    return;
end
success = (abs(log10(valX)-log10(ptX)) < 0.02*(log10(xLim(2))-log10(xLim(1))))...
            &&(abs(valY - ptY) < 0.05*(yLim(2)-yLim(1)));
% warning('on', 'MATLAB:log:logOfZero');
