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
Pdand go toToolsFind Externals. Search forlist-absand install it. Then create an object withdeclare -lib list-abs -path list-abs. Finally, uselist-centroidor any other object fromlist-abs.