def eps2chi(eps):
    """Calculate chi ellipticity from epsilon.
    
    Args:
        eps: a real or complex number, or a numpy array thereof.

    Returns:
        The chi ellipticity in the same shape as the input.
    """
    return 2*eps/(1 + abs(eps)**2)