libpysal.cg.get_segment_point_intersect¶
- libpysal.cg.get_segment_point_intersect(seg, pt)[source]¶
Returns the intersection of a segment and point.
- Parameters:
- seg
libpysal.cg.LineSegment
A segment to check for an intersection.
- pt
libpysal.cg.Point
A point to check
seg
for an intersection.
- seg
- Returns:
- pt{
libpysal.cg.Point
,None
} The intersection of a
seg
andpt
if one exists, otherwiseNone
.
- pt{
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)