Previous Up Next

6.10.8  Barycenter of complex numbers: barycenter

The barycenter, or center of mass, of a set of points A1, A2,…,An with masses α12,…,αn is

α1A1+⋯ + αnAn
α1+⋯ + αn
 

This formula makes sense even if the αj are not positive real numbers, and is still called the barycenter of the weighted points.

The barycenter command computes the barycenter of a set of weighted points.


Warning.
The barycenter command returns a point, not a complex number. To have a complex number in the output, the input must be affix(barycenter(l1,l2)) (see Section 13.13.1).


Example.
Input:

affix(barycenter([1+i,2],[1-i,1]))

or:

affix(barycenter([[1+i,2],[1-i,1]]))

Output:

3+i
3

Previous Up Next