mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-25 13:30:51 +08:00
Add doc string to point in polygon functions
This commit is contained in:
@@ -6,6 +6,17 @@
|
||||
|
||||
cdef inline unsigned char point_in_polygon(int nr_verts, double *xp, double *yp,
|
||||
double x, double y):
|
||||
"""Test whether point lies inside a polygon.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
nr_verts : int
|
||||
Number of vertices of polygon.
|
||||
xp, yp : double array
|
||||
Coordinates of polygon with length nr_verts.
|
||||
x, y : double
|
||||
Coordinates of point.
|
||||
"""
|
||||
cdef int i
|
||||
cdef unsigned char c = 0
|
||||
cdef int j = nr_verts - 1
|
||||
@@ -22,6 +33,21 @@ cdef inline unsigned char point_in_polygon(int nr_verts, double *xp, double *yp,
|
||||
cdef void points_in_polygon(int nr_verts, double *xp, double *yp,
|
||||
int nr_points, double *x, double *y,
|
||||
unsigned char *result):
|
||||
"""Test whether points lie inside a polygon.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
nr_verts : int
|
||||
Number of vertices of polygon.
|
||||
xp, yp : double array
|
||||
Coordinates of polygon with length nr_verts.
|
||||
nr_points : int
|
||||
Number of points to test.
|
||||
x, y : double array
|
||||
Coordinates of points.
|
||||
result : unsigned char array
|
||||
Test results for each point.
|
||||
"""
|
||||
cdef int n
|
||||
for n in range(nr_points):
|
||||
result[n] = point_in_polygon(nr_verts, xp, yp, x[n], y[n])
|
||||
|
||||
Reference in New Issue
Block a user