import math


def computeTelescopeTransmission(pars, offAxis):
    """
    Compute tel. transmission (0 < T < 1) for a given set of parameters
    as defined by the MC model and for a given off-axis angle.

    Parameters
    ----------
    pars: list of float
        Parameters of the telescope transmission. Len(pars) should be 4.
    offAxis: float
        Off-axis angle in deg.

    Returns
    -------
    float
        Telescope transmission.
    """
    _degToRad = math.pi / 180.0
    if pars[1] == 0:
        return pars[0]
    else:
        t = math.sin(offAxis * _degToRad) / (pars[3] * _degToRad)
        return pars[0] / (1.0 + pars[2] * t ** pars[4])