-- If the point 'p' is colinear with line segment 'i-ip',
-- then check if it lies on segment. If it lies, return true,
-- otherwise false
-- If the point 'p' is colinear with line segment 'i-ip',
-- then check if it lies on segment. If it lies, return true,
-- otherwise false
if (orientation(listPoints[i], p, listPoints[ip]) == 0) then
return onSegment(listPoints[i], p, listPoints[ip])
end
if (orientation(listPoints[i], p, listPoints[ip]) == 0) then
return onSegment(listPoints[i], p, listPoints[ip])
end