import math


def solar_declination(doy):
    """
    Calculate the solar declination for a given day of the year
    (Allen et al. 1998).

    Parameters
    ----------
    doy : int
        Julian day of the year (-).

    Returns
    -------
    float
        Solar declination (rad).

    """
    return 0.409 * math.sin(((2 * math.pi) / 365) * doy - 1.39)