def compute_thigh_origin(lat_fem_ep, med_fem_ep):
    """
    Compute the origin of the thigh.

    Parameters
    ----------
    lat_fem_ep : numpy.ndarray
        1 or 2D (Nx3) array of positions of the lateral femoral epicondyle marker.
    med_fem_ep : numpy.ndarray
        1 or 2D (Nx3) array of positions of the medial femoral epicondyle marker.

    Returns
    -------
    origin : numpy.ndarray
        Array of the position of the thigh origin

    References
    ----------
    Ren et al.  "Whole body inverse dynamics over a complete gait cycle based only on measured kinematics."
    *J. of Biomech*. 2008
    """
    origin = (lat_fem_ep + med_fem_ep) / 2
    return origin
