nutation function
- double t
Nutation in longitude Δψ and in obliquity Δε (radians), tables 5.3a and 5.3b.
The series have about 1400 terms, and one chart asks for nutation at the same few moments dozens of times (each body, speeds at t ± step, sidereal time) – hence a cache of recent results.
Implementation
({double longitude, double obliquity}) nutation(double t) {
for (var i = 0; i < _nutationCacheSize; i++) {
if (_nutationCacheT[i] == t) return _nutationCacheValue[i]!;
}
final args = _fundamentalArguments(t);
final value = (
longitude: _series(nutationInLongitude, args, t),
obliquity: _series(nutationInObliquity, args, t),
);
_nutationCacheT[_nutationCacheNext] = t;
_nutationCacheValue[_nutationCacheNext] = value;
_nutationCacheNext = (_nutationCacheNext + 1) % _nutationCacheSize;
return value;
}