def impact_parameter(a, R, inc, ecc=0, w=0, return_occ=False):
    """a in AU, R in Rsun, inc & w in radians
    """
    b_tra = a*AU*np.cos(inc)/(R*RSUN) * (1-ecc**2)/(1 + ecc*np.sin(w))

    if return_occ:
        b_tra = a*AU*np.cos(inc)/(R*RSUN) * (1-ecc**2)/(1 - ecc*np.sin(w))
        return b_tra, b_occ
    else:
        return b_tra
a in AU, R in Rsun, inc & w in radians