Skip to content

list-centroid

list-centroid calculates the centroid, or center of mass, of a list using sum(mi * i) / sum(mi), with indices starting at 0. It outputs a float result, while an undefined result—such as when all values sum to 0—is indicated by a bang; centroids may be negative.


AI Generated

This content was generated with the assistance of AI. If you notice any errors, please report them or submit a fix using Submit. Check the prompt used here.


  • Download via Deken.

    Open Pd and go to ToolsFind Externals. Search for list-abs and install it. Then create an object with declare -lib list-abs -path list-abs. Finally, use list-centroid or any other object from list-abs.


Similar


    Comments

    Contributors