:py:mod:`gnome.utilities.geometry` ================================== .. py:module:: gnome.utilities.geometry .. autoapi-nested-parse:: geometry package This package has: A few higher-level objects for geometry: a Bounding Box class and a Polygon class. It also has some lover level code basic geometry that acts on numpy arrays of points: i.e. a polygon is expressed as a Nx2 numpy array of float64 Some of these are in Cython for speed. Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 BBox/index.rst PinP/index.rst geo_routines/index.rst poly_clockwise/index.rst polygons/index.rst setup/index.rst Package Contents ---------------- Functions ~~~~~~~~~ .. autoapisummary:: gnome.utilities.geometry.is_clockwise_convex gnome.utilities.geometry.is_clockwise .. py:function:: is_clockwise_convex(poly) returns True if the polygon is clockwise ordered, false if not expects a sequence of tuples, or something like it, of the points: [ (x1, y1), (x2, y2), (x3, y3), ...(xi, yi) ] This only works for concave polygons. See: http://paulbourke.net/geometry/clockwise/ .. py:function:: is_clockwise(poly) returns True if the polygon is clockwise ordered, false if not expects a sequence of tuples, or something like it (Nx2 array for instance), of the points: [ (x1, y1), (x2, y2), (x3, y3), ...(xi, yi) ] See: http://paulbourke.net/geometry/clockwise/