libpysal.cg.is_collinear¶
- libpysal.cg.is_collinear(p1, p2, p3)[source]¶
Returns whether a triplet of points is collinear.
- Parameters:
- p1
libpysal.cg.Point
A point.
- p2
libpysal.cg.Point
A point.
- p3
libpysal.cg.Point
A point.
- p1
- Returns:
- collinearbool
True
if{p1, p2, p3}
are collinear, otherwiseFalse
.
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