import math


def get_flat_earth_coord(origin, the_pt):
    """
    Get the flat earth coordinates (x,y) from a given (lng,lat) point "pt".
    The (x,y) is the offset in lng and lat dimensions (in meters or km)
    from a given origin point (olng, olat)

    Arguments:
        origin {list} -- (lng,lat) of the origin point
        pt {list} -- (lnt,lat) of the point

    Returns:
        [type] -- [description]
    """
    vardx = ((origin[0] - the_pt[0]) * 40000.0 *
             math.cos((origin[1] + the_pt[1]) * math.pi / 360) / 360)
    vardy = (origin[1] - the_pt[1]) * 40000.0 / 360
    return vardx, vardy