code: function getDistance(position1, position2) {
    var _getDistanceVector = getDistanceVector(position1, position2),
        x = _getDistanceVector.x,
        y = _getDistanceVector.y;
  
    return sqrt(x * x + y * y);
  }
docs: Calculate the distance from the origin position to the destination position.