from matplotlib import path

class FlightBoundary(object):
    """
    Provides an interface for flight zone boundaries
    """

    def __init__(self, min_altitude, max_altitude, boundary_waypoints):
        """
        Initialize the flight boundaries object with the different requirements

        :param min_altitude: The minimum flying altitude
        :type min_altitude: Float
        :param max_altitude: The maximum flying altitude
        :type max_altitude: Float
        :param boundary_waypoints: The boundary waypoints. Outside of this polygon
            of waypoints exists the no flight zone
        :type boundary_waypoints: Numpy Array
        """
        self.min_altitude = min_altitude
        self.max_altitude = max_altitude
        self.boundary_path = path.Path(boundary_waypoints)

    def is_point_in_bounds(self, point):
        """
        Returns True if the passed point is in the boundaries, False if not

        :param point: The point to test
        :type point: Numpy Array
        """
        dim_reduced_point = point[:2]
        is_point_in_polygon = self.point_in_polygon(dim_reduced_point)
        is_point_in_alts = (point[2] > self.min_altitude and point[2] < self.max_altitude)

        if is_point_in_polygon and is_point_in_alts:
            return True

        return False

    def point_in_polygon(self, point):
        """
        Returns True if the point is in the bounding polygon, false if it is
        outside of it.

        :param point: The point
        :type point: Numpy Array
        """
        return self.boundary_path.contains_point(point)

@@ -1,33 +1,4 @@
-from matplotlib import path%0A%0A
 clas
@@ -747,18 +747,8 @@
 h = 
-path.Path(
 boun
@@ -761,17 +761,16 @@
 aypoints
-)
 %0A%0A    de
@@ -1051,33 +1051,57 @@
  = self.
-point_in_polygon(
+ray_tracing_method(dim_reduced_point%5B0%5D, 
 dim_redu
@@ -1109,16 +1109,19 @@
 ed_point
+%5B1%5D
 )%0A      
@@ -1318,36 +1318,36 @@
 def 
-point_in_polygon
+ray_tracing_method
 (self, 
-point
+x,y
 ):%0A 
@@ -1477,57 +1477,131 @@
 ram 
-point: The point%0A        :type point: Numpy Array
+x: The X-coordinate of the point%0A        :type x: int%0A        :param y: They Y-coordinate of the point%0A        :type y: int
 %0A   
@@ -1617,22 +1617,22 @@
         
-return
+poly =
  self.bo
@@ -1646,27 +1646,522 @@
 path
-.contains_point(point)
+%0A        n = len(poly)%0A        inside = False%0A%0A        p1x,p1y = poly%5B0%5D%0A        for i in range(n+1):%0A            p2x,p2y = poly%5Bi %25 n%5D%0A            if y %3E min(p1y,p2y):%0A                if y %3C= max(p1y,p2y):%0A                    if x %3C= max(p1x,p2x):%0A                        if p1y != p2y:%0A                            xints = (y-p1y)*(p2x-p1x)/(p2y-p1y)+p1x%0A                            if p1x == p2x or x %3C= xints:%0A                                inside = not inside%0A            p1x,p1y = p2x,p2y%0A%0A        return inside
 %0A

Update point in polygon detection method