# Path: prosoar/geopoint.py
# class GeoPoint:
#     def __init__(self, lon, lat):
#         self.lon = lon
#         self.lat = lat
# 
#     def __str__(self):
#         return '{}, {}'.format(self.lat, self.lon)


import math
from prosoar.geopoint import GeoPoint
        )

        lon2 = ((-lon1 - math.asin(
            math.sin(direction) * math.sin(distance_rad) / math.cos(lat2)
        ) + math.pi) % (2 * math.pi)) - math.pi

        lat2 = lat2 * (180 / math.pi)
        lon2 = -lon2 * (180 / math.pi)

        return [lat2, lon2]

    def expand(self, distance):
        midlat = (self.top + self.bottom) / 2.
        midlon = (self.top + self.bottom) / 2.

        left = self.__get_projected_point([midlat, self.left], distance, 270)
        right = self.__get_projected_point([midlat, self.right], distance, 90)
        top = self.__get_projected_point([self.top, midlon], distance, 0)
        bottom = self.__get_projected_point(
            [self.bottom, midlon], distance, 180)

        self.left = left[1]
        self.right = right[1]
        self.top = top[0]
        self.bottom = bottom[0]

    def inside(self, y, x):
        return (
            y <= self.top and y >= self.bottom and
            x <= self.right and x >= self.left

# Path: prosoar/geopoint.py
# class GeoPoint:
#     def __init__(self, lon, lat):
#         self.lon = lon
#         self.lat = lat
# 
#     def __str__(self):
#         return '{}, {}'.format(self.lat, self.lon)


# Path: prosoar/georect.py
import math
from prosoar.geopoint import GeoPoint

        )

        lon2 = ((-lon1 - math.asin(
            math.sin(direction) * math.sin(distance_rad) / math.cos(lat2)
        ) + math.pi) % (2 * math.pi)) - math.pi

        lat2 = lat2 * (180 / math.pi)
        lon2 = -lon2 * (180 / math.pi)

        return [lat2, lon2]

    def expand(self, distance):
        midlat = (self.top + self.bottom) / 2.
        midlon = (self.top + self.bottom) / 2.

        left = self.__get_projected_point([midlat, self.left], distance, 270)
        right = self.__get_projected_point([midlat, self.right], distance, 90)
        top = self.__get_projected_point([self.top, midlon], distance, 0)
        bottom = self.__get_projected_point(
            [self.bottom, midlon], distance, 180)

        self.left = left[1]
        self.right = right[1]
        self.top = top[0]
        self.bottom = bottom[0]

    def inside(self, y, x):
        return (
            y <= self.top and y >= self.bottom and
            x <= self.right and x >= self.left

        )