Closed mta102 closed 8 months ago
Sorry what's the issue exactly?
Have you read the docstring?
STAT, BNDS = INPOLY2(..., FTOL) also returns an N-by-1
boolean array BNDS, with BNDS[II] = TRUE if VERT[II, :]
lies "on" a boundary segment, where FTOL is a floating-
point tolerance for boundary comparisons. By default,
FTOL ~ EPS ^ 0.85.
Closing --- not clear there's an issue, though note that the polygon is defined with duplicate nodes.
xmin, xmax, ymin, ymax = 0, 0.00002, 0, 0.00002 x0, y0, x1, y1 = 0.00005, 0.00005, 0, 1
define any n-sided polygon
p = np.array([[xmin, ymin], [xmax, ymin], [xmax, ymax], [xmin, ymax], [xmin, ymin]])
define some coords
coords = np.array([[x0, y0], [x1, y1]])
get boolean mask for points if in or on polygon perimeter
isin, ison = inpoly2(coords, p) isin.sum()