Skip to content
Snippets Groups Projects
Commit 228ab67c authored by Ivar Stefansson's avatar Ivar Stefansson
Browse files

Update check_points.m

parent 3d5ea98a
No related branches found
No related tags found
No related merge requests found
function [ nw, on] = check_points( x, a,b , isvertical)
function [ northWest, on] = check_points( x, a,b , isVertical)
%check_points Determines which of a number of 2D points in x lie north (west)
% of the line ax + b and if any points lie on the line
% If the line is vertical, the constant x-value goes in the input a
if isvertical
nw = x(:,1) < a;
on = x(:,1) == a;
if isVertical
northWest = x(:,1) < a;
on = x(:,1) == a;
elseif a == 0
nw = x(:,2) > b;
on = x(:,2) == b;
northWest = x(:,2) > b;
on = x(:,2) == b;
else
nw = a*x(:,1) + b < x(:,2);
on = a*x(:,1) + b == x(:,2);
northWest = a*x(:,1) + b < x(:,2);
on = a*x(:,1) + b == x(:,2);
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment