Center of Mass from a list of coordinates and their masses
MATL, 6 5 bytes

ys/Y*


Input format is a row vector with the masses, then a two-column matrix with the coordinates (in which spaces or commas are optional).


First example:

[2, 6, 2, 10]
[0,2; 3,4; 0,1; 1,1]

Second example:

[2, 4, 1]
[3,1; 0,0; 1,4]



Try it online!

Explanation

Let m denote the vector of masses (first input) and c the matrix of coordinates (second input).

y     % implicitly take two inputs. Duplicate the first.
      % (Stack contains, bottom to top: m, c, m)
s     % sum of m.
      % (Stack: m, c, sum-of-m)
/     % divide.
      % (Stack: m, c-divided-by-sum-of-m)
Y*    % matrix multiplication.
      % (Stack: final result)
      % implicitly display