code: function (pt1, pt2) {
  	return Math.sqrt((pt2.x -= pt1.x) * pt2.x + (pt2.y -= pt1.y) * pt2.y);
  }
docs: ref: http://stackoverflow.com/questions/20916953/get-distance-between-two-points-in-canvas get distance between two points with x, y coordinates