pysal.lib.cg.is_collinear

pysal.lib.cg.is_collinear(p1, p2, p3)[source]

Returns whether a triplet of points is collinear.

is_collinear(Point, Point, Point) -> bool

Parameters:
p1 : a point (Point)
p2 : another point (Point)
p3 : yet 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