# libpysal.cg.get_ray_segment_intersect

libpysal.cg.get_ray_segment_intersect(ray, seg)

  Returns the intersection of a ray and line segment.

  Parameters:
    ray `libpysal.cg.Ray`

      A ray to check for an intersection.

    seg `libpysal.cg.LineSegment`

      A segment to check for an intersection against `ray`.

  Returns:
    intersection{`libpysal.cg.Point`, `libpysal.cg.LineSegment`, `python:None`}

      The intersecting point or line between `ray` and `seg` if an intersection exists or `None` if `ray` and `seg` do not intersect.

  See also

  `libpysal.cg.get_segments_intersect`

  Examples

      >>> ray = Ray(Point((0, 0)), Point((0, 1)))
      >>> seg = LineSegment(Point((-1, 10)), Point((1, 10)))
      >>> i = get_ray_segment_intersect(ray, seg)
      >>> isinstance(i, Point)
      True

      >>> str(i)
      '(0.0, 10.0)'

      >>> seg2 = LineSegment(Point((10, 10)), Point((10, 11)))
      >>> get_ray_segment_intersect(ray, seg2)