import math


def pixel_coords_zoom_to_lat_lon(PixelX, PixelY, zoom):
    """
    The function to compute latitude, longituted from pixel coordinates at a given zoom level

    Parameters
    ----------
    PixelX : int
        x coordinate
    PixelY : int
        y coordinate
    zoom : int
        tile map service zoom level

    Returns
    -------
    lon : float
        the longitude in degree
    lat : float
        the latitude in degree
    """


    MapSize = 256 * math.pow(2, zoom)
    x = (PixelX / MapSize) - 0.5
    y = 0.5 - (PixelY / MapSize)
    lon = 360 * x
    lat = 90 - 360 * math.atan(math.exp(-y * 2 * math.pi)) / math.pi

    return lon, lat