dtCalc static method

double dtCalc(
  1. double y
)

Implementation

static double dtCalc(double y) {
  int size = DT_AT.length;
  double y0 = DT_AT[size - 2];
  double t0 = DT_AT[size - 1];
  if (y >= y0) {
    double jsd = 31;
    if (y > y0 + 100) {
      return dtExt(y, jsd);
    }
    return dtExt(y, jsd) - (dtExt(y0, jsd) - t0) * (y0 + 100 - y) / 100;
  }
  int i;
  for (i = 0; i < size; i += 5) {
    if (y < DT_AT[i + 5]) {
      break;
    }
  }
  double t1 = (y - DT_AT[i]) / (DT_AT[i + 5] - DT_AT[i]) * 10,
      t2 = t1 * t1,
      t3 = t2 * t1;
  return DT_AT[i + 1] +
      DT_AT[i + 2] * t1 +
      DT_AT[i + 3] * t2 +
      DT_AT[i + 4] * t3;
}