TCG top-level property

TimeInstantUnits TCG
final

Geocentric Coordinate Time (TCG): TCG = TDT + (6.969291e-10)(JD - 2443144.5)(86400)

Implementation

// ignore: non_constant_identifier_names
final TimeInstantUnits TCG =
    TimeInstantUnits('Geocentric Coordinate Time', null, 'TCG', null, 1.0, false, 0.0, (dynamic val) {
  // TCG = TAI + 32.184 + (6.969291e-10)(JD - 2443144.5)(86400)... where the Julian Date is in the TAI scale
  final d = val is num
      ? val.toDouble()
      : val is Number
          ? val.toDouble()
          : 0.0;
  return Double(d + 32.184 + (6.969291e-10 * (d - 599616000.0)));
}, (dynamic val) {
  // TAI = TCG - 32.184 - (6.969291e-10)(JD - 2443144.5)(86400)... where the Julian Date is in the TAI scale
  final d = val is num
      ? val.toDouble()
      : val is Number
          ? val.toDouble()
          : 0.0;
  final taiApprox = d - 32.184 - (6.969291e-10 * (d - 599616000.0)); // get closer to the actual JD TAI (s)
  return Double(d - 32.184 - (6.969291e-10 * (taiApprox - 599616000.0)));
});