import math


def xyz_from_dif(d, i, f):
    """
    north- east-, down- pointing components
    from
            * declination- `d`
            * inclination- `i`
            * total field strength- `f`
    with `d` and `i` given in degrees
    """
    d = math.radians(d)
    i = math.radians(i)
    horiz = abs(f * math.cos(i))
    north = horiz * math.cos(d)
    east = horiz * math.sin(d)
    down = f * math.sin(i)
    return north, east, down