Skip to content

Instantly share code, notes, and snippets.

@robban
robban / poly_clockwise.py
Last active December 22, 2022 15:35 — forked from ChrisBarker-NOAA/poly_clockwise.py
clockwise tests for polygons
#!/usr/bin/env python
"""
code for checking if a polygon is cockwise or counter-clockwise
There are two versions:
is_clockwise_convex only works for convex polygons -- but is faster,
it only needs to check three points.