shape.py
def center_of_mass(shp, dims = 2):
    """
    Returns dims-dimensional center of mass of vertices in shape
    """
    com = [np.mean([shp.nodes[pt]["pos"][i] for pt in list(shp.nodes)]) \
           for i in range(dims)]
    com = np.asarray(com)
    return com

    Returns dims-dimensional center of mass of vertices in shape
    
Returns dims-dimensional center of mass of vertices in shape
Returns dims - dimensional center of mass of vertices in shape
def center_of_mass(shp, dims = 2):
    com = [np.mean([shp.nodes[pt]["pos"][i] for pt in list(shp.nodes)]) \
           for i in range(dims)]
    com = np.asarray(com)
    return com
def center_of_mass ( shp , dims = 2 ) : com = [ np . mean ( [ shp . nodes [ pt ] [ "pos" ] [ i ] for pt in list ( shp . nodes ) ] ) for i in range ( dims ) ] com = np . asarray ( com ) return com
Returns dims-dimensional center of mass of vertices in shape
Returns dims - dimensional center of mass of vertices in shape
"""
    Returns dims-dimensional center of mass of vertices in shape
    """
shp
dims