Julian.fromYearDoy constructor
Creates a Julian date from year
and day-of-year.
Implementation
factory Julian.fromYearDoy(int year, double doy) {
year--;
// Centuries are not leap years unless they divide by 400
int A = year ~/ 100;
int B = 2 - A + (A ~/ 4);
double jan01 =
(365.25 * year).toInt() + (30.6001 * 14).toInt() + 1720994.5 + B;
return Julian(jan01 + doy);
}