pysal.lib.cg.get_segment_point_intersect

pysal.lib.cg.get_segment_point_intersect(seg, pt)[source]

Returns the intersection of a segment and point.

get_segment_point_intersect(LineSegment, Point) -> Point

Parameters:
seg : a segment to check intersection for
pt : a point to check intersection for

Examples

>>> seg = LineSegment(Point((0, 0)), Point((0, 10)))
>>> pt = Point((0, 5))
>>> i = get_segment_point_intersect(seg, pt)
>>> str(i)
'(0.0, 5.0)'
>>> pt2 = Point((5, 5))
>>> get_segment_point_intersect(seg, pt2)