code: public boolean isNearTo(Double2D location, double distance) {
          if (this.is2DLocation()) {
              return this.getLocation2D().distance(location) < distance;
          } else {
              return false;
          }
      }
docs: Compare two locations and return if the locations are near or not
  
  @param location Location to compare with
  @param distance The distance between two locations
  @return true is the real distance is lower or equals than the distance parameter