import math


def distance(points):
  """
  calculate the distance of two points

  Parameters
  ----------
  points : list
    a list of two points. E.g. `[[x1, y1], [x2, y2]]`

  Returns
  -------
  float
    the distance of two points
  """
  p1, p2 = points
  return math.sqrt(math.pow(p1[0]-p2[0],2) + math.pow(p1[1]-p2[1],2))