def equality_constraints(bvecs, *args):
    """
    Spherical equality constraint. Returns 0 if bvecs lies on the unit sphere.

    Parameters
    ----------
    bvecs : array-like shape (N * 3)

    Returns
    -------
    array shape (N,) : Difference between squared vector norms and 1.
    """
    N = int(bvecs.shape[0] / 3)
    bvecs = bvecs.reshape((N, 3))
    return (bvecs ** 2).sum(1) - 1.0