def calculate_distance(p1, p2):
  """
  Calculates distance between two [x,y] coordinates.
  p1: the point (as list containing x and y values) from which to measure 
  p2: the point (as list containing x and y values) to which to measure
  returns: the distance
  """
  dx = p2[0] - p1[0]
  dy = p2[1] - p1[1]
  distance = (dx ** 2 + dy ** 2)**0.5
  return distance