Project/ray_casting_algorithm.py
def isPointInside(p, poly):
    """
    Define if a point (p) if include in a polygon

    :param p: coordinates x, y
    :param poly: Polygon : list of points(x,y)
    :return: True if p is include in the polygon
    """



    ln = len(poly)
    count = 0
    for i in range(ln - 1):
        Ax = poly[i][0]
        Bx = poly[i + 1][0]
        Ay = poly[i][1]
        By = poly[i + 1][1]
        A = [Ax, Ay]
        B = [Bx, By]

        if rayIntersectSegment(p, A, B):
            count += 1

    return not isOdd(count)

    Define if a point (p) if include in a polygon

    :param p: coordinates x, y
    :param poly: Polygon : list of points(x,y)
    :return: True if p is include in the polygon
    
Define if a point (p) if include in a polygon
Define if a point ( p ) if include in a polygon
def isPointInside(p, poly):
    ln = len(poly)
    count = 0
    for i in range(ln - 1):
        Ax = poly[i][0]
        Bx = poly[i + 1][0]
        Ay = poly[i][1]
        By = poly[i + 1][1]
        A = [Ax, Ay]
        B = [Bx, By]
        if rayIntersectSegment(p, A, B):
            count += 1
    return not isOdd(count)
def isPointInside ( p , poly ) : ln = len ( poly ) count = 0 for i in range ( ln - 1 ) : Ax = poly [ i ] [ 0 ] Bx = poly [ i + 1 ] [ 0 ] Ay = poly [ i ] [ 1 ] By = poly [ i + 1 ] [ 1 ] A = [ Ax , Ay ] B = [ Bx , By ] if rayIntersectSegment ( p , A , B ) : count += 1 return not isOdd ( count )
Define if a point (p) if include in a polygon
Define if a point ( p ) if include in a polygon
"""
    Define if a point (p) if include in a polygon

    :param p: coordinates x, y
    :param poly: Polygon : list of points(x,y)
    :return: True if p is include in the polygon
    """
True if p is include in the polygon
True if p is include in the polygon
p
coordinates x, y
coordinates x y
poly
Polygon : list of points(x,y)
Polygon : list of points ( x y )