code: public boolean isNearTo(Location location, double distance) {
          if (this.is2DLocation() && location.is2DLocation()) {
              return this.isNearTo(location.getLocation2D(), distance);
          } else if (this.is3DLocation() && location.is3DLocation()) {
              return this.isNearTo(location.getLocation3D(), 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