def point_on_segment(s, p):
    """
    Check if a point lies on a segment.

    Parameters
    ----------
    s: numpy.array
        A 2D line segment represented by its two endpoints.
    p: numpy.array
        The point that will be checked if in segment.
    """
    is_on_segment = (p[0] >= s[:, 0].min()) & (p[0] <= s[:, 0].max()) & (
        p[1] >= s[:, 1].min()) & (p[1] <= s[:, 1].max())
    return is_on_segment