import math


def latlong_to_tile_coords(zoom, latitude, longitude):
    """Find tile coordinates of a given position.

    Notes:
        https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames

    Args:
        zoom (int): zoom level
        latitude (float): latitude in degrees
        longitude (float): longitude in degrees

    Returns:
        (int, int): tile column, tile row
    """
    lat_rad = math.radians(latitude)
    n = 2.0 ** zoom
    tile_col = int((longitude + 180.0) / 360.0 * n)
    tile_row = int((1.0 - math.log(math.tan(lat_rad) + (1 / math.cos(lat_rad))) / math.pi) / 2.0 * n)
    return tile_col, tile_row