def is_point_in_polygon(point, polygon):
    """
    test wether point lie in polygon

    :param point: pypex.poly2d.point.Point
    :param polygon: pypex.poly2d.polygon.Polygon
    :return:
    """
    if len(polygon) < 3:
        raise ValueError(
            'invalid polygon shape, expected at least 3 corners polygon')
    return polygon.mplpath.contains_point(point.to_array())
