Polygon function

py-eddy-tracker is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

py-eddy-tracker is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with py-eddy-tracker. If not, see <http://www.gnu.org/licenses/>.

Copyright (c) 2014-2020 by Evan Mason Email: evanmason@gmail.com ===========================================================================

py_eddy_tracker.poly.bbox_intersection[source]

compute bbox to check if there are a bbox intersection

py_eddy_tracker.poly.create_vertice[source]
py_eddy_tracker.poly.create_vertice_from_2darray[source]
py_eddy_tracker.poly.get_wrap_vertice[source]
py_eddy_tracker.poly.is_left[source]

http://geomalgorithms.com/a03-_inclusion.html isLeft(): tests if a point is Left|On|Right of an infinite line. Input: three points P0, P1, and P2 Return: >0 for P2 left of the line through P0 and P1

=0 for P2 on the line <0 for P2 right of the line

See: Algorithm 1 “Area of Triangles and Polygons”

py_eddy_tracker.poly.poly_area[source]
py_eddy_tracker.poly.poly_contain_poly[source]
py_eddy_tracker.poly.polygon_overlap(p0, p1, minimal_area=False)[source]
py_eddy_tracker.poly.vertice_overlap(x0, y0, x1, y1, minimal_area=False)[source]
py_eddy_tracker.poly.winding_number_grid_in_poly[source]

http://geomalgorithms.com/a03-_inclusion.html wn_PnPoly(): winding number test for a point in a polygon

Input: P = a point,
V[] = vertex points of a polygon V[n+1] with V[n]=V[0]

Return: wn = the winding number (=0 only when P is outside)

py_eddy_tracker.poly.winding_number_poly[source]