libpysal.cg.is_collinear¶
-
libpysal.cg.
is_collinear
(p1, p2, p3)[source]¶ Returns whether a triplet of points is collinear.
is_collinear(Point, Point, Point) -> bool
- Parameters
- p1a point (Point)
- p2another point (Point)
- p3yet another point (Point)
Examples
>>> is_collinear(Point((0, 0)), Point((1, 1)), Point((5, 5))) True >>> is_collinear(Point((0, 0)), Point((1, 1)), Point((5, 0))) False