Use isInsideArray function to check if point is inside array