@Override
  public double pTurningR(double rayParameter) {
    for (int i = structure.getNzone() - 1; 0 <= i; i--) {
      double vpA = structure.getVpA(i);
      double vpB = structure.getVpB(i);
      double r = Math.pow(1 / (vpA * rayParameter), 1 / (vpB - 1));
      // System.out.println(i+" "+structure.getBoundary(i)+" "+r+" "+structure.getBoundary(i+1));

      if (structure.getBoundary(i) <= r && r < structure.getBoundary(i + 1)) return r;
    }
    return -1;
  }
  /*
   * (non-Javadoc)
   *
   * @see traveltime.manhattan.VelocityStructure#shTurningR(double)
   */
  @Override
  public double shTurningR(double rayParameter) {
    // System.out.println(rayParameter);
    for (int i = structure.getNzone() - 1; 0 <= i; i--) {
      double vsA = structure.getVsA(i);
      double vsB = structure.getVsB(i);
      double r = Math.pow(1 / (vsA * rayParameter), 1 / (vsB - 1));
      //			System.out.println(i + " " + structure.getBoundary(i) + " "
      //					+ structure.getBoundary(i + 1) + " " + r);
      if (structure.getBoundary(i) <= r && r <= structure.getBoundary(i + 1)) return r;
    }

    return -1;
  }
 @Override
 public double earthRadius() {
   return structure.getBoundary(structure.getNzone());
 }