def METHOD_NAME(x, y, z):
    """ Fits a great circle to points in 3D space. 
    Arguments:
        x: [float] X coordiantes of points on the great circle.
        y: [float] Y coordiantes of points on the great circle.
        z: [float] Z coordiantes of points on the great circle.
    Return: 
        X, theta0, phi0: [tuple of floats] Great circle parameters.
    """
    # Add (0, 0, 0) to the data, as the great circle should go through the origin
    x = np.append(x, 0)
    y = np.append(y, 0)
    z = np.append(z, 0)
    # Fit a linear plane through the data points
    A = np.c_[x, y, np.ones(x.shape[0])]
    C,_,_,_ = scipy.linalg.lstsq(A, z)
    # Calculate the great circle parameters
    z2 = C[0]**2 + C[1]**2
    theta0 = np.arcsin(z2/np.sqrt(z2 + z2**2))
    phi0 = np.arctan2(C[1], C[0])
    return C, theta0, phi0