def compute_shank_origin(lat_mall, med_mall):
    """
    Compute the origin of the shank.

    Parameters
    ----------
    lat_mall : numpy.ndarray
        1 or 2D (Nx3) array of positions of the lateral malleolus marker.
    med_mall : numpy.ndarray
        1 or 2D (Nx3) array of positions of the medial malleolus marker.

    Returns
    -------
    origin : numpy.ndarray
        Array of the position of the pelvis 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_mall + med_mall) / 2
    return origin
