예제 #1
0
  /**
   * note that ADD returns a new object, this remains constant
   *
   * @param delta the offset to add to this point
   * @return a new point
   */
  public final WorldLocation add(final WorldVector delta) {
    // check we have our model
    if (_model == null) {
      _model = new MWC.Algorithms.EarthModels.FlatEarth();
    }

    // do the calculation with our current model

    // do we have a range?
    final WorldLocation res;

    if ((delta.getRange() == 0) && (delta.getDepth() == 0)) {
      res = new WorldLocation(this);
    } else {
      res = new WorldLocation(_model.add(this, delta));
    }

    // and return the resutls
    return res;
  }