### 5.11.10 Barycenter of complex numbers : barycenter

barycenter takes as argument two lists of the same size (resp. a matrix with two columns):

- the elements of the first list (resp. column) are points Aj or complex numbers aj (the affixes of the points),
- the elements of the second list (resp. column) are real coefficients αj such that ∑αj ≠ 0.

barycenter returns the barycenter point of the points Aj weighted by the real coefficients αj. If ∑αj = 0, barycenter returns an error.
Warning To have a complex number in the output, the input must be :
affix(barycenter(...,...)) because barycenter(...,...) returns a point, not a complex number.
Input :

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

or :

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

Output :

i