function in_out = insidePoly( pt, a, b )
% The insidePloy(pt,a,b) function determines whether a point 
% is inside or outside of a ploygon.
%
% A point that is on the boundary is considered to be inside the polygon.
% If the point is inside the polygon, 1 is returned.
% If the point is outside the polygon, 0 is returned.
% NOTE: this function will not always work correctly for non-convex
% polygons.
%
% pt - must be a vector with the x and y coordinates of a single point
% a - must be a row vector with the x-coordinates of all vertices of a convex polygon
% b - must be a row vector with the y-coordinates of all vertices of a convex polygon
%
% Usage: to see if point (0.5,1.25) is inside the polygon formed by
%        the points (0,0), (2,1), (2,2), (0.5,2), and (-1,1) use the command:
%
%          >> insideTri( [0.5,1.25], [0 2 2 0.5 -1], [0 1 2 2 1] ) 
%
%        The result of 1.0 indicates that this point is in the polygon.
%

% This function will only work for triangles until changes are made 
% as described in 4.a and 4.b of Team Lab 11
in_out = insideTri( pt, a, b );


