### 26.5.10 Barycenter in the plane

See Section 27.3.6 for barycenters of objects in space.

The barycenter command returns and draws the barycenter of a set of weighted points.

- barycenter takes L1,L2,…,Ln, a sequence of lists of length two, where each list consists of a point and a weight. This information can also be given as a matrix with two columns (the first column the points and the second column the weights) or a matrix with two rows and more than two columns.
- barycenter(L1,L2,…,Ln) draws and returns the barycenter of the weighted points.

#### Example

The following commands will draw the barycenter of the points (1,1) with weight 1, (1,−1) with weight 1 and (1,4) with weight 2.

A:=point(1/2+i); B:=point(1-i); C:=point(4/3+4*i); barycenter([A,1],[B,1],[C,2])

or with the alternative second line:

barycenter([[A,1],[B,1],[C,2]])

or:

barycenter([[A,B,C],[1,1,2]])