planetary function
({double deltaD, double t})
planetary(
- double t1,
- double t5,
- List<
Equatorial> cs1, - List<
Equatorial> cs2,
Computes a conjunction between two moving objects (e.g. planets).
Conjunction is found with interpolation against length-5 ephemerides.
t1, t5 are times of first and last rows.
cs1, cs2 are 5-row ephemerides as Equatorial coordinates.
Returns time of conjunction t and the amount deltaD that object 2
was "above" object 1 at the time of conjunction (in declination, radians).
Implementation
({double t, double deltaD}) planetary(
double t1, double t5, List<Equatorial> cs1, List<Equatorial> cs2) {
if (cs1.length != 5 || cs2.length != 5) {
throw ArgumentError('Five rows required in ephemerides');
}
final dr = List<double>.generate(5, (i) => cs2[i].ra - cs1[i].ra);
final dd = List<double>.generate(5, (i) => cs2[i].dec - cs1[i].dec);
return _conj(t1, t5, dr, dd);
}