title: Shortest representation of this function in Python
body: <p><img src="https://i.stack.imgur.com/7Fdks.gif" alt="equation"></p>
  
  <p>Currently I have:</p>
  
  <pre><code>def func(points): #Input is a matrix with n lines and 2 columns.
      centroid = numpy.mean(points, axis=0)
      sum = 0
      for point in points:
          x = point[0] - centroid[0]
          y = point[1] - centorid[1]
          sum += x**2 + y**2
      return math.sqrt(sum)
  </code></pre>