From 3ed2bc3974d227b6d717df428aade34cc746c645 Mon Sep 17 00:00:00 2001 From: Don Cross Date: Fri, 5 Jun 2020 15:44:42 -0400 Subject: [PATCH] Implemented JS GlobalSolarEclipse. --- generate/template/astronomy.js | 311 ++++++++++++++++++++++++++++++--- generate/template/astronomy.py | 8 - generate/test.js | 138 +++++++++++++-- generate/test.py | 12 +- source/js/README.md | 81 +++++++++ source/js/astronomy.js | 311 ++++++++++++++++++++++++++++++--- source/js/astronomy.min.js | 291 +++++++++++++++--------------- source/python/astronomy.py | 8 - 8 files changed, 939 insertions(+), 221 deletions(-) diff --git a/generate/template/astronomy.js b/generate/template/astronomy.js index 83ab518b..5dcd9db7 100644 --- a/generate/template/astronomy.js +++ b/generate/template/astronomy.js @@ -4273,48 +4273,82 @@ class LunarEclipseInfo { } } -class EarthShadowInfo { - constructor(time, u, r, k, p) { +class ShadowInfo { + constructor(time, u, r, k, p, target, dir) { this.time = time; this.u = u; // dot product of (heliocentric earth) and (geocentric moon): defines the shadow plane where the Moon is this.r = r; // km distance between center of Moon and the line passing through the centers of the Sun and Earth. this.k = k; // umbra radius in km, at the shadow plane this.p = p; // penumbra radius in km, at the shadow plane + this.target = target; + this.dir = dir; } } + +function CalcShadow(body_radius_km, time, target, dir) { + const u = (dir.x*target.x + dir.y*target.y + dir.z*target.z) / (dir.x*dir.x + dir.y*dir.y + dir.z*dir.z); + const dx = (u * dir.x) - target.x; + const dy = (u * dir.y) - target.y; + const dz = (u * dir.z) - target.z; + const r = KM_PER_AU * Math.sqrt(dx*dx + dy*dy + dz*dz); + const k = +SUN_RADIUS_KM - (1.0 + u)*(SUN_RADIUS_KM - body_radius_km); + const p = -SUN_RADIUS_KM + (1.0 + u)*(SUN_RADIUS_KM + body_radius_km); + return new ShadowInfo(time, u, r, k, p, target, dir); +} + + function EarthShadow(time) { const e = CalcVsop(vsop.Earth, time); const m = Astronomy.GeoMoon(time); - const u = (e.x*m.x + e.y*m.y + e.z*m.z) / (e.x*e.x + e.y*e.y + e.z*e.z); - const dx = (u * e.x) - m.x; - const dy = (u * e.y) - m.y; - const dz = (u * e.z) - m.z; - const r = KM_PER_AU * Math.sqrt(dx*dx + dy*dy + dz*dz); - const k = +SUN_RADIUS_KM - (1.0 + u)*(SUN_RADIUS_KM - EARTH_ECLIPSE_RADIUS_KM); - const p = -SUN_RADIUS_KM + (1.0 + u)*(SUN_RADIUS_KM + EARTH_ECLIPSE_RADIUS_KM); - - return new EarthShadowInfo(time, u, r, k, p); + return CalcShadow(EARTH_ECLIPSE_RADIUS_KM, time, m, e); } -function PeakEarthShadow(search_center_time) { - function slope(time) { - const dt = 1.0 / 86400.0; - const t1 = time.AddDays(-dt); - const t2 = time.AddDays(+dt); - const shadow1 = EarthShadow(t1); - const shadow2 = EarthShadow(t2); - return (shadow2.r - shadow1.r) / dt; - } +function MoonShadow(time) { + // This is a variation on the logic in _EarthShadow(). + // Instead of a heliocentric Earth and a geocentric Moon, + // we want a heliocentric Moon and a lunacentric Earth. + const h = CalcVsop(vsop.Earth, time); // heliocentric Earth + const m = Astronomy.GeoMoon(time); // geocentric Moon + // Calculate lunacentric Earth. + const e = new Vector(-m.x, -m.y, -m.z, m.t); + // Convert geocentric moon to heliocentric Moon. + m.x += h.x; + m.y += h.y; + m.z += h.z; + return CalcShadow(MOON_MEAN_RADIUS_KM, time, e, m); +} + + +function ShadowDistanceSlope(shadowfunc, time) { + const dt = 1.0 / 86400.0; + const t1 = time.AddDays(-dt); + const t2 = time.AddDays(+dt); + const shadow1 = shadowfunc(t1); + const shadow2 = shadowfunc(t2); + return (shadow2.r - shadow1.r) / dt; +} + + +function PeakEarthShadow(search_center_time) { const window = 0.03; /* initial search window, in days, before/after given time */ const t1 = search_center_time.AddDays(-window); const t2 = search_center_time.AddDays(+window); - - const tx = Astronomy.Search(slope, t1, t2, 1.0); + const tx = Astronomy.Search(time => ShadowDistanceSlope(EarthShadow, time), t1, t2, 1.0); return EarthShadow(tx); } + +function PeakMoonShadow(search_center_time) { + const window = 0.03; /* initial search window, in days, before/after given time */ + const t1 = search_center_time.AddDays(-window); + const t2 = search_center_time.AddDays(+window); + const tx = Astronomy.Search(time => ShadowDistanceSlope(MoonShadow, time), t1, t2, 1.0); + return MoonShadow(tx); +} + + function ShadowSemiDurationMinutes(center_time, radius_limit, window_minutes) { // Search backwards and forwards from the center time until shadow axis distance crosses radius limit. const window = window_minutes / (24.0 * 60.0); @@ -4393,6 +4427,169 @@ Astronomy.SearchLunarEclipse = function(date) { } +/** + Reports the time and geographic location of the peak of a solar eclipse. + + Returned by {@link Astronomy.SearchGlobalSolarEclipse} or {@link Astronomy.NextGlobalSolarEclipse} + to report information about a solar eclipse event. + + Field `peak` holds the date and time of the peak of the eclipse, defined as + the instant when the axis of the Moon's shadow cone passes closest to the Earth's center. + + The eclipse is classified as partial, annular, or total, depending on the + maximum amount of the Sun's disc obscured, as seen at the peak location + on the surface of the Earth. + + The `kind` field thus holds one of the strings `"partial"`, `"annular"`, or `"total"`. + A total eclipse is when the peak observer sees the Sun completely blocked by the Moon. + An annular eclipse is like a total eclipse, but the Moon is too far from the Earth's surface + to completely block the Sun; instead, the Sun takes on a ring-shaped appearance. + A partial eclipse is when the Moon blocks part of the Sun's disc, but nobody on the Earth + observes either a total or annular eclipse. + + If `kind` is `"total"` or `"annular"`, the `latitude` and `longitude` + fields give the geographic coordinates of the center of the Moon's shadow projected + onto the daytime side of the Earth at the instant of the eclipse's peak. + If `kind` has any other value, `latitude` and `longitude` are undefined and should + not be used. + + @class + @memberof Astronomy + + @property {string} kind + One of the following string values: `"partial"`, `"annular"`, `"total"`. + + @property {Astronomy.AstroTime} peak + The date and time of the peak of the eclipse, defined as the instant + when the axis of the Moon's shadow cone passes closest to the Earth's center. + + @property {number} distance + The distance in kilometers between the axis of the Moon's shadow cone + and the center of the Earth at the time indicated by `peak`. + + @property {(undefined|number)} latitude + If `kind` holds `"total"`, the geographic latitude in degrees + where the center of the Moon's shadow falls on the Earth at the + time indicated by `peak`; otherwise, `latitude` holds `undefined`. + + @property {(undefined|number)} longitude + If `kind` holds `"total"`, the geographic longitude in degrees + where the center of the Moon's shadow falls on the Earth at the + time indicated by `peak`; otherwise, `longitude` holds `undefined`. +*/ +class GlobalSolarEclipseInfo { + constructor(kind, peak, distance, latitude, longitude) { + this.kind = kind; + this.peak = peak; + this.distance = distance; + this.latitude = latitude; + this.longitude = longitude; + } +} + + +function EclipseKindFromUmbra(k) { + // The umbra radius tells us what kind of eclipse the observer sees. + // If the umbra radius is positive, this is a total eclipse. Otherwise, it's annular. + // HACK: I added a tiny bias (14 meters) to match Espenak test data. + return (k > 0.014) ? 'total' : 'annular'; +} + + +function GeoidIntersect(shadow) { + let kind = 'partial'; + let peak = shadow.time; + let distance = shadow.r; + let latitude; // left undefined for partial eclipses + let longitude; // left undefined for partial eclipses + + // We want to calculate the intersection of the shadow axis with the Earth's geoid. + // First we must convert EQJ (equator of J2000) coordinates to EQD (equator of date) + // coordinates that are perfectly aligned with the Earth's equator at this + // moment in time. + const rot = Astronomy.Rotation_EQJ_EQD(shadow.time); + const v = Astronomy.RotateVector(rot, shadow.dir); // shadow-axis vector in equator-of-date coordinates + const e = Astronomy.RotateVector(rot, shadow.target); // lunacentric Earth in equator-of-date coordinates + + // Convert all distances from AU to km. + // But dilate the z-coordinates so that the Earth becomes a perfect sphere. + // Then find the intersection of the vector with the sphere. + // See p 184 in Montenbruck & Pfleger's "Astronomy on the Personal Computer", second edition. + v.x *= KM_PER_AU; + v.y *= KM_PER_AU; + v.z *= KM_PER_AU / EARTH_FLATTENING; + e.x *= KM_PER_AU; + e.y *= KM_PER_AU; + e.z *= KM_PER_AU / EARTH_FLATTENING; + + // Solve the quadratic equation that finds whether and where + // the shadow axis intersects with the Earth in the dilated coordinate system. + const R = EARTH_EQUATORIAL_RADIUS_KM; + const A = v.x*v.x + v.y*v.y + v.z*v.z; + const B = -2.0 * (v.x*e.x + v.y*e.y + v.z*e.z); + const C = (e.x*e.x + e.y*e.y + e.z*e.z) - R*R; + const radic = B*B - 4*A*C; + + if (radic > 0.0) { + // Calculate the closer of the two intersection points. + // This will be on the day side of the Earth. + const u = (-B - Math.sqrt(radic)) / (2 * A); + + // Convert lunacentric dilated coordinates to geocentric coordinates. + const px = u*v.x - e.x; + const py = u*v.y - e.y; + const pz = (u*v.z - e.z) * EARTH_FLATTENING; + + // Convert cartesian coordinates into geodetic latitude/longitude. + const proj = Math.sqrt(px*px + py*py) * (EARTH_FLATTENING * EARTH_FLATTENING); + if (proj == 0.0) { + latitude = (pz > 0.0) ? +90.0 : -90.0; + } else { + latitude = RAD2DEG * Math.atan(pz / proj); + } + + // Adjust longitude for Earth's rotation at the given UT. + const gast = sidereal_time(peak); + longitude = (RAD2DEG * Math.atan2(py, px) - (15*gast)) % 360.0; + if (longitude <= -180.0) { + longitude += 360.0; + } else if (longitude > +180.0) { + longitude -= 360.0; + } + + // We want to determine whether the observer sees a total eclipse or an annular eclipse. + // We need to perform a series of vector calculations... + // Calculate the inverse rotation matrix, so we can convert EQD to EQJ. + const inv = Astronomy.InverseRotation(rot); + + // Put the EQD geocentric coordinates of the observer into the vector 'o'. + // Also convert back from kilometers to astronomical units. + let o = new Vector(px / KM_PER_AU, py / KM_PER_AU, pz / KM_PER_AU, shadow.time); + + // Rotate the observer's geocentric EQD back to the EQJ system. + o = Astronomy.RotateVector(inv, o); + + // Convert geocentric vector to lunacentric vector. + o.x += shadow.target.x; + o.y += shadow.target.y; + o.z += shadow.target.z; + + // Recalculate the shadow using a vector from the Moon's center toward the observer. + const surface = CalcShadow(MOON_POLAR_RADIUS_KM, shadow.time, o, shadow.dir); + + // If we did everything right, the shadow distance should be very close to zero. + // That's because we already determined the observer 'o' is on the shadow axis! + if (surface.r > 1.0e-9 || surface.r < 0.0) { + throw `Unexpected shadow distance from geoid intersection = ${surface.r}`; + } + + kind = EclipseKindFromUmbra(surface.k); + } + + return new GlobalSolarEclipseInfo(kind, peak, distance, latitude, longitude); +} + + /** * @brief Searches for the next lunar eclipse in a series. * @@ -4412,5 +4609,75 @@ Astronomy.NextLunarEclipse = function(prevEclipseTime) { return Astronomy.SearchLunarEclipse(startTime); } +/** + * @brief Searches for a solar eclipse visible anywhere on the Earth's surface. + * + * This function finds the first solar eclipse that occurs after `startTime`. + * A solar eclipse found may be partial, annular, or total. + * See {@link Astronomy.GlobalSolarEclipseInfo} for more information. + * To find a series of solar eclipses, call this function once, + * then keep calling {@link Astronomy.NextGlobalSolarEclipse} as many times as desired, + * passing in the `peak` value returned from the previous call. + * + * @param {Astronomy.AstroTime} startTime + * The date and time for starting the search for a solar eclipse. + * + * @returns {Astronomy.GlobalSolarEclipseInfo} + */ +Astronomy.SearchGlobalSolarEclipse = function(startTime) { + const PruneLatitude = 1.8; // Moon's ecliptic latitude beyond which eclipse is impossible + // Iterate through consecutive new moons until we find a solar eclipse visible somewhere on Earth. + let nmtime = startTime; + let nmcount; + for (nmcount=0; nmcount < 12; ++nmcount) { + // Search for the next new moon. Any eclipse will be near it. + const newmoon = Astronomy.SearchMoonPhase(0.0, nmtime, 40.0); + if (newmoon === null) { + throw 'Cannot find new moon'; + } + + // Pruning: if the new moon's ecliptic latitude is too large, a solar eclipse is not possible. + const mp = CalcMoon(newmoon); + if (RAD2DEG * Math.abs(mp.geo_eclip_lat) < PruneLatitude) { + // Search near the new moon for the time when the center of the Earth + // is closest to the line passing through the centers of the Sun and Moon. + const shadow = PeakMoonShadow(newmoon); + if (shadow.r < shadow.p + EARTH_MEAN_RADIUS_KM) { + // This is at least a partial solar eclipse visible somewhere on Earth. + // Try to find an intersection between the shadow axis and the Earth's oblate geoid. + return GeoidIntersect(shadow); + } + } + + // We didn't find an eclipse on this new moon, so search for the next one. + nmtime = newmoon.AddDays(10.0); + } + + // Safety valve to prevent infinite loop. + // This should never happen, because at least 2 solar eclipses happen per year. + throw 'Failed to find solar eclipse within 12 full moons.'; +} + + +/** + * @brief Searches for the next global solar eclipse in a series. + * + * After using {@link Astronomy.SearchGlobalSolarEclipse} to find the first solar eclipse + * in a series, you can call this function to find the next consecutive solar eclipse. + * Pass in the `peak` value from the {@link Astronomy.GlobalSolarEclipseInfo} returned by the + * previous call to `SearchGlobalSolarEclipse` or `NextGlobalSolarEclipse` + * to find the next solar eclipse. + * + * @param {Astronomy.AstroTime} prevEclipseTime + * A date and time near a new moon. Solar eclipse search will start at the next new moon. + * + * @returns {Astronomy.GlobalSolarEclipseInfo} + */ +Astronomy.NextGlobalSolarEclipse = function(prevEclipseTime) { + const startTime = prevEclipseTime.AddDays(10.0); + return Astronomy.SearchGlobalSolarEclipse(startTime); +} + + })(typeof exports==='undefined' ? (this.Astronomy={}) : exports); diff --git a/generate/template/astronomy.py b/generate/template/astronomy.py index 969b26cb..168af844 100644 --- a/generate/template/astronomy.py +++ b/generate/template/astronomy.py @@ -4291,14 +4291,6 @@ def _EclipseKindFromUmbra(k): def _GeoidIntersect(shadow): - #astro_global_solar_eclipse_t eclipse; - #astro_rotation_t rot, inv; - #astro_vector_t v, e, o; - #shadow_t surface; - #double A, B, C, radic, u, R; - #double px, py, pz, proj; - #double gast; - kind = EclipseKind.Partial peak = shadow.time distance = shadow.r diff --git a/generate/test.js b/generate/test.js index c8cdc5f8..ecb2e039 100644 --- a/generate/test.js +++ b/generate/test.js @@ -2,6 +2,8 @@ const fs = require('fs'); const Astronomy = require('../source/js/astronomy.min.js'); let Verbose = false; +const DEG2RAD = 0.017453292519943296; +const RAD2DEG = 57.295779513082321; function Fail(message) { console.log(`FATAL(test.js): ${message}`); @@ -345,6 +347,119 @@ function LunarEclipse() { return 0; } +function VectorFromAngles(lat, lon) { + const coslat = Math.cos(DEG2RAD * lat); + return [ + Math.cos(DEG2RAD * lon) * coslat, + Math.sin(DEG2RAD * lon) * coslat, + Math.sin(DEG2RAD * lat) + ]; +} + + +function AngleDiff(alat, alon, blat, blon) { + const a = VectorFromAngles(alat, alon); + const b = VectorFromAngles(blat, blon); + const dot = a[0]*b[0] + a[1]*b[1] + a[2]*b[2]; + if (dot <= -1.0) { + return 180.0; + } + if (dot >= +1.0) { + return 0.0; + } + return RAD2DEG * Math.acos(dot); +} + + +function GlobalSolarEclipse() { + const expected_count = 1180; + const filename = 'eclipse/solar_eclipse.txt'; + const text = fs.readFileSync(filename, {encoding:'utf8'}); + const lines = text.trim().split(/\r?\n/); + let max_minutes = 0.0; + let max_angle = 0.0; + let skip_count = 0; + let eclipse = Astronomy.SearchGlobalSolarEclipse(new Date(Date.UTC(1701, 0))); + let lnum = 0; + for (let line of lines) { + ++lnum; + // 1889-12-22T12:54:15Z -6 T -12.7 -12.8 + let token = line.trim().split(/\s+/); + if (token.length !== 5) { + console.error(`JS GlobalSolarEclipse(${filename} line ${lnum}): invalid token count = ${token.length}`); + return 1; + } + const peak = Astronomy.MakeTime(new Date(token[0])); + const typeChar = token[2]; + const lat = parseFloat(token[3]); + const lon = parseFloat(token[4]); + const expected_kind = { + 'P': 'partial', + 'A': 'annular', + 'T': 'total', + 'H': 'total' + }[typeChar]; + + let diff_days = eclipse.peak.tt - peak.tt; + // Sometimes we find marginal eclipses that aren't listed in the test data. + // Ignore them if the distance between the Sun/Moon shadow axis and the Earth's center is large. + while (diff_days < -25.0 && eclipse.distance > 9000.0) { + ++skip_count; + eclipse = Astronomy.NextGlobalSolarEclipse(eclipse.peak); + diff_days = eclipse.peak.ut - peak.ut; + } + + // Validate the eclipse prediction. + const diff_minutes = (24 * 60) * Math.abs(diff_days); + if (diff_minutes > 6.93) { + console.error(`JS GlobalSolarEclipseTest(${filename} line ${lnum}): EXCESSIVE TIME ERROR = ${diff_minutes} minutes`); + return 1; + } + + if (diff_minutes > max_minutes) { + max_minutes = diff_minutes; + } + + // Validate the eclipse kind, but only when it is not a "glancing" eclipse. + if ((eclipse.distance < 6360) && (eclipse.kind != expected_kind)) { + console.error(`JS GlobalSolarEclipseTest(${filename} line ${lnum}): WRONG ECLIPSE KIND: expected ${expected_kind}, found ${eclipse.kind}`); + return 1; + } + + if (eclipse.kind === 'total' || eclipse.kind === 'annular') { + // When the distance between the Moon's shadow ray and the Earth's center is beyond 6100 km, + // it creates a glancing blow whose geographic coordinates are excessively sensitive to + // slight changes in the ray. Therefore, it is unreasonable to count large errors there. + if (eclipse.distance < 6100.0) { + const diff_angle = AngleDiff(lat, lon, eclipse.latitude, eclipse.longitude); + if (diff_angle > 0.247) { + console.error(`PY GlobalSolarEclipseTest(${filename} line ${lnum}): EXCESSIVE GEOGRAPHIC LOCATION ERROR = ${diff_angle} degrees`); + console.log(` calculated lat=${eclipse.latitude}, lon=${eclipse.longitude}; expected ${lat}, ${lon}`); + return 1; + } + if (diff_angle > max_angle) { + max_angle = diff_angle; + } + } + } + + eclipse = Astronomy.NextGlobalSolarEclipse(eclipse.peak); + } + + if (lnum != expected_count) { + console.error(`JS GlobalSolarEclipse: WRONG LINE COUNT = ${lnum}, expected ${expected_count}`); + return 1; + } + + if (skip_count > 2) { + console.error(`PY GlobalSolarEclipse: EXCESSIVE SKIP COUNT = ${skip_count}`); + return 1; + } + + console.log(`JS GlobalSolarEclipse: PASS (${lnum} verified, ${skip_count} skipped, max minutes = ${max_minutes}, max angle = ${max_angle})`); + return 0; +} + function PlanetApsis() { const Planet = { @@ -1299,17 +1414,18 @@ function Constellation() { } const UnitTests = { - constellation: Constellation, - elongation: Elongation, - lunar_apsis: LunarApsis, - lunar_eclipse: LunarEclipse, - planet_apsis: PlanetApsis, - magnitude: Magnitude, - moon_phase: MoonPhase, - refraction: Refraction, - rise_set: RiseSet, - rotation: Rotation, - seasons: Seasons, + constellation: Constellation, + elongation: Elongation, + global_solar_eclipse: GlobalSolarEclipse, + lunar_apsis: LunarApsis, + lunar_eclipse: LunarEclipse, + planet_apsis: PlanetApsis, + magnitude: Magnitude, + moon_phase: MoonPhase, + refraction: Refraction, + rise_set: RiseSet, + rotation: Rotation, + seasons: Seasons, }; diff --git a/generate/test.py b/generate/test.py index 7864bc89..db4671d7 100755 --- a/generate/test.py +++ b/generate/test.py @@ -1279,7 +1279,7 @@ def GlobalSolarEclipse(): # Validate the eclipse prediction. diff_minutes = (24 * 60) * abs(diff_days) if diff_minutes > 6.93: - print('PY GlobalSolarEclipseTest({} line {}): EXCESSIVE TIME ERROR = {} minutes'.format(filename, lnum, diff_minutes)) + print('PY GlobalSolarEclipse({} line {}): EXCESSIVE TIME ERROR = {} minutes'.format(filename, lnum, diff_minutes)) return 1 if diff_minutes > max_minutes: @@ -1287,7 +1287,7 @@ def GlobalSolarEclipse(): # Validate the eclipse kind, but only when it is not a "glancing" eclipse. if (eclipse.distance < 6360) and (eclipse.kind != expected_kind): - print('PY GlobalSolarEclipseTest({} line {}): WRONG ECLIPSE KIND: expected {}, found {}'.format(filename, lnum, expected_kind, eclipse.kind)) + print('PY GlobalSolarEclipse({} line {}): WRONG ECLIPSE KIND: expected {}, found {}'.format(filename, lnum, expected_kind, eclipse.kind)) return 1 if eclipse.kind == astronomy.EclipseKind.Total or eclipse.kind == astronomy.EclipseKind.Annular: @@ -1297,7 +1297,7 @@ def GlobalSolarEclipse(): if eclipse.distance < 6100.0: diff_angle = AngleDiff(lat, lon, eclipse.latitude, eclipse.longitude) if diff_angle > 0.247: - print('PY GlobalSolarEclipseTest({} line {}): EXCESSIVE GEOGRAPHIC LOCATION ERROR = {} degrees'.format(filename, lnum, diff_angle)) + print('PY GlobalSolarEclipse({} line {}): EXCESSIVE GEOGRAPHIC LOCATION ERROR = {} degrees'.format(filename, lnum, diff_angle)) return 1 if diff_angle > max_angle: max_angle = diff_angle @@ -1305,14 +1305,14 @@ def GlobalSolarEclipse(): eclipse = astronomy.NextGlobalSolarEclipse(eclipse.peak) if lnum != expected_count: - print('PY GlobalSolarEclipseTest: WRONG LINE COUNT = {}, expected {}'.format(lnum, expected_count)) + print('PY GlobalSolarEclipse: WRONG LINE COUNT = {}, expected {}'.format(lnum, expected_count)) return 1 if skip_count > 2: - print('PY GlobalSolarEclipseTest: EXCESSIVE SKIP COUNT = {}'.format(skip_count)) + print('PY GlobalSolarEclipse: EXCESSIVE SKIP COUNT = {}'.format(skip_count)) return 1 - print('PY GlobalSolarEclipseTest: PASS ({} verified, {} skipped, max minutes = {}, max angle = {})'.format(lnum, skip_count, max_minutes, max_angle)) + print('PY GlobalSolarEclipse: PASS ({} verified, {} skipped, max minutes = {}, max angle = {})'.format(lnum, skip_count, max_minutes, max_angle)) return 0 #----------------------------------------------------------------------------------------------------------- diff --git a/source/js/README.md b/source/js/README.md index 9d8ecb80..bd486ce7 100644 --- a/source/js/README.md +++ b/source/js/README.md @@ -514,6 +514,48 @@ may determine the date and time of the beginning/end of each eclipse phase. | sd_total | number | The semi-duration of the penumbral phase in minutes, or 0.0 if none. | +* * * + + + +### Astronomy.GlobalSolarEclipseInfo +Reports the time and geographic location of the peak of a solar eclipse. + + Returned by [SearchGlobalSolarEclipse](#Astronomy.SearchGlobalSolarEclipse) or [NextGlobalSolarEclipse](#Astronomy.NextGlobalSolarEclipse) + to report information about a solar eclipse event. + + Field `peak` holds the date and time of the peak of the eclipse, defined as + the instant when the axis of the Moon's shadow cone passes closest to the Earth's center. + + The eclipse is classified as partial, annular, or total, depending on the + maximum amount of the Sun's disc obscured, as seen at the peak location + on the surface of the Earth. + + The `kind` field thus holds one of the strings `"partial"`, `"annular"`, or `"total"`. + A total eclipse is when the peak observer sees the Sun completely blocked by the Moon. + An annular eclipse is like a total eclipse, but the Moon is too far from the Earth's surface + to completely block the Sun; instead, the Sun takes on a ring-shaped appearance. + A partial eclipse is when the Moon blocks part of the Sun's disc, but nobody on the Earth + observes either a total or annular eclipse. + + If `kind` is `"total"` or `"annular"`, the `latitude` and `longitude` + fields give the geographic coordinates of the center of the Moon's shadow projected + onto the daytime side of the Earth at the instant of the eclipse's peak. + If `kind` has any other value, `latitude` and `longitude` are undefined and should + not be used. + +**Kind**: static class of [Astronomy](#Astronomy) +**Properties** + +| Name | Type | Description | +| --- | --- | --- | +| kind | string | One of the following string values: `"partial"`, `"annular"`, `"total"`. | +| peak | [AstroTime](#Astronomy.AstroTime) | The date and time of the peak of the eclipse, defined as the instant when the axis of the Moon's shadow cone passes closest to the Earth's center. | +| distance | number | The distance in kilometers between the axis of the Moon's shadow cone and the center of the Earth at the time indicated by `peak`. | +| latitude | undefined \| number | If `kind` holds `"total"`, the geographic latitude in degrees where the center of the Moon's shadow falls on the Earth at the time indicated by `peak`; otherwise, `latitude` holds `undefined`. | +| longitude | undefined \| number | If `kind` holds `"total"`, the geographic longitude in degrees where the center of the Moon's shadow falls on the Earth at the time indicated by `peak`; otherwise, `longitude` holds `undefined`. | + + * * * @@ -1761,6 +1803,45 @@ to find the next lunar eclipse. | prevEclipseTime | [AstroTime](#Astronomy.AstroTime) | A date and time near a full moon. Lunar eclipse search will start at the next full moon. | +* * * + + + +### Astronomy.SearchGlobalSolarEclipse(startTime) ⇒ [GlobalSolarEclipseInfo](#Astronomy.GlobalSolarEclipseInfo) +**Kind**: static method of [Astronomy](#Astronomy) +**Brief**: Searches for a solar eclipse visible anywhere on the Earth's surface. + +This function finds the first solar eclipse that occurs after `startTime`. +A solar eclipse found may be partial, annular, or total. +See [GlobalSolarEclipseInfo](#Astronomy.GlobalSolarEclipseInfo) for more information. +To find a series of solar eclipses, call this function once, +then keep calling [NextGlobalSolarEclipse](#Astronomy.NextGlobalSolarEclipse) as many times as desired, +passing in the `peak` value returned from the previous call. + +| Param | Type | Description | +| --- | --- | --- | +| startTime | [AstroTime](#Astronomy.AstroTime) | The date and time for starting the search for a solar eclipse. | + + +* * * + + + +### Astronomy.NextGlobalSolarEclipse(prevEclipseTime) ⇒ [GlobalSolarEclipseInfo](#Astronomy.GlobalSolarEclipseInfo) +**Kind**: static method of [Astronomy](#Astronomy) +**Brief**: Searches for the next global solar eclipse in a series. + +After using [SearchGlobalSolarEclipse](#Astronomy.SearchGlobalSolarEclipse) to find the first solar eclipse +in a series, you can call this function to find the next consecutive solar eclipse. +Pass in the `peak` value from the [GlobalSolarEclipseInfo](#Astronomy.GlobalSolarEclipseInfo) returned by the +previous call to `SearchGlobalSolarEclipse` or `NextGlobalSolarEclipse` +to find the next solar eclipse. + +| Param | Type | Description | +| --- | --- | --- | +| prevEclipseTime | [AstroTime](#Astronomy.AstroTime) | A date and time near a new moon. Solar eclipse search will start at the next new moon. | + + * * * diff --git a/source/js/astronomy.js b/source/js/astronomy.js index 886fb1f9..baf65127 100644 --- a/source/js/astronomy.js +++ b/source/js/astronomy.js @@ -5703,48 +5703,82 @@ class LunarEclipseInfo { } } -class EarthShadowInfo { - constructor(time, u, r, k, p) { +class ShadowInfo { + constructor(time, u, r, k, p, target, dir) { this.time = time; this.u = u; // dot product of (heliocentric earth) and (geocentric moon): defines the shadow plane where the Moon is this.r = r; // km distance between center of Moon and the line passing through the centers of the Sun and Earth. this.k = k; // umbra radius in km, at the shadow plane this.p = p; // penumbra radius in km, at the shadow plane + this.target = target; + this.dir = dir; } } + +function CalcShadow(body_radius_km, time, target, dir) { + const u = (dir.x*target.x + dir.y*target.y + dir.z*target.z) / (dir.x*dir.x + dir.y*dir.y + dir.z*dir.z); + const dx = (u * dir.x) - target.x; + const dy = (u * dir.y) - target.y; + const dz = (u * dir.z) - target.z; + const r = KM_PER_AU * Math.sqrt(dx*dx + dy*dy + dz*dz); + const k = +SUN_RADIUS_KM - (1.0 + u)*(SUN_RADIUS_KM - body_radius_km); + const p = -SUN_RADIUS_KM + (1.0 + u)*(SUN_RADIUS_KM + body_radius_km); + return new ShadowInfo(time, u, r, k, p, target, dir); +} + + function EarthShadow(time) { const e = CalcVsop(vsop.Earth, time); const m = Astronomy.GeoMoon(time); - const u = (e.x*m.x + e.y*m.y + e.z*m.z) / (e.x*e.x + e.y*e.y + e.z*e.z); - const dx = (u * e.x) - m.x; - const dy = (u * e.y) - m.y; - const dz = (u * e.z) - m.z; - const r = KM_PER_AU * Math.sqrt(dx*dx + dy*dy + dz*dz); - const k = +SUN_RADIUS_KM - (1.0 + u)*(SUN_RADIUS_KM - EARTH_ECLIPSE_RADIUS_KM); - const p = -SUN_RADIUS_KM + (1.0 + u)*(SUN_RADIUS_KM + EARTH_ECLIPSE_RADIUS_KM); - - return new EarthShadowInfo(time, u, r, k, p); + return CalcShadow(EARTH_ECLIPSE_RADIUS_KM, time, m, e); } -function PeakEarthShadow(search_center_time) { - function slope(time) { - const dt = 1.0 / 86400.0; - const t1 = time.AddDays(-dt); - const t2 = time.AddDays(+dt); - const shadow1 = EarthShadow(t1); - const shadow2 = EarthShadow(t2); - return (shadow2.r - shadow1.r) / dt; - } +function MoonShadow(time) { + // This is a variation on the logic in _EarthShadow(). + // Instead of a heliocentric Earth and a geocentric Moon, + // we want a heliocentric Moon and a lunacentric Earth. + const h = CalcVsop(vsop.Earth, time); // heliocentric Earth + const m = Astronomy.GeoMoon(time); // geocentric Moon + // Calculate lunacentric Earth. + const e = new Vector(-m.x, -m.y, -m.z, m.t); + // Convert geocentric moon to heliocentric Moon. + m.x += h.x; + m.y += h.y; + m.z += h.z; + return CalcShadow(MOON_MEAN_RADIUS_KM, time, e, m); +} + + +function ShadowDistanceSlope(shadowfunc, time) { + const dt = 1.0 / 86400.0; + const t1 = time.AddDays(-dt); + const t2 = time.AddDays(+dt); + const shadow1 = shadowfunc(t1); + const shadow2 = shadowfunc(t2); + return (shadow2.r - shadow1.r) / dt; +} + + +function PeakEarthShadow(search_center_time) { const window = 0.03; /* initial search window, in days, before/after given time */ const t1 = search_center_time.AddDays(-window); const t2 = search_center_time.AddDays(+window); - - const tx = Astronomy.Search(slope, t1, t2, 1.0); + const tx = Astronomy.Search(time => ShadowDistanceSlope(EarthShadow, time), t1, t2, 1.0); return EarthShadow(tx); } + +function PeakMoonShadow(search_center_time) { + const window = 0.03; /* initial search window, in days, before/after given time */ + const t1 = search_center_time.AddDays(-window); + const t2 = search_center_time.AddDays(+window); + const tx = Astronomy.Search(time => ShadowDistanceSlope(MoonShadow, time), t1, t2, 1.0); + return MoonShadow(tx); +} + + function ShadowSemiDurationMinutes(center_time, radius_limit, window_minutes) { // Search backwards and forwards from the center time until shadow axis distance crosses radius limit. const window = window_minutes / (24.0 * 60.0); @@ -5823,6 +5857,169 @@ Astronomy.SearchLunarEclipse = function(date) { } +/** + Reports the time and geographic location of the peak of a solar eclipse. + + Returned by {@link Astronomy.SearchGlobalSolarEclipse} or {@link Astronomy.NextGlobalSolarEclipse} + to report information about a solar eclipse event. + + Field `peak` holds the date and time of the peak of the eclipse, defined as + the instant when the axis of the Moon's shadow cone passes closest to the Earth's center. + + The eclipse is classified as partial, annular, or total, depending on the + maximum amount of the Sun's disc obscured, as seen at the peak location + on the surface of the Earth. + + The `kind` field thus holds one of the strings `"partial"`, `"annular"`, or `"total"`. + A total eclipse is when the peak observer sees the Sun completely blocked by the Moon. + An annular eclipse is like a total eclipse, but the Moon is too far from the Earth's surface + to completely block the Sun; instead, the Sun takes on a ring-shaped appearance. + A partial eclipse is when the Moon blocks part of the Sun's disc, but nobody on the Earth + observes either a total or annular eclipse. + + If `kind` is `"total"` or `"annular"`, the `latitude` and `longitude` + fields give the geographic coordinates of the center of the Moon's shadow projected + onto the daytime side of the Earth at the instant of the eclipse's peak. + If `kind` has any other value, `latitude` and `longitude` are undefined and should + not be used. + + @class + @memberof Astronomy + + @property {string} kind + One of the following string values: `"partial"`, `"annular"`, `"total"`. + + @property {Astronomy.AstroTime} peak + The date and time of the peak of the eclipse, defined as the instant + when the axis of the Moon's shadow cone passes closest to the Earth's center. + + @property {number} distance + The distance in kilometers between the axis of the Moon's shadow cone + and the center of the Earth at the time indicated by `peak`. + + @property {(undefined|number)} latitude + If `kind` holds `"total"`, the geographic latitude in degrees + where the center of the Moon's shadow falls on the Earth at the + time indicated by `peak`; otherwise, `latitude` holds `undefined`. + + @property {(undefined|number)} longitude + If `kind` holds `"total"`, the geographic longitude in degrees + where the center of the Moon's shadow falls on the Earth at the + time indicated by `peak`; otherwise, `longitude` holds `undefined`. +*/ +class GlobalSolarEclipseInfo { + constructor(kind, peak, distance, latitude, longitude) { + this.kind = kind; + this.peak = peak; + this.distance = distance; + this.latitude = latitude; + this.longitude = longitude; + } +} + + +function EclipseKindFromUmbra(k) { + // The umbra radius tells us what kind of eclipse the observer sees. + // If the umbra radius is positive, this is a total eclipse. Otherwise, it's annular. + // HACK: I added a tiny bias (14 meters) to match Espenak test data. + return (k > 0.014) ? 'total' : 'annular'; +} + + +function GeoidIntersect(shadow) { + let kind = 'partial'; + let peak = shadow.time; + let distance = shadow.r; + let latitude; // left undefined for partial eclipses + let longitude; // left undefined for partial eclipses + + // We want to calculate the intersection of the shadow axis with the Earth's geoid. + // First we must convert EQJ (equator of J2000) coordinates to EQD (equator of date) + // coordinates that are perfectly aligned with the Earth's equator at this + // moment in time. + const rot = Astronomy.Rotation_EQJ_EQD(shadow.time); + const v = Astronomy.RotateVector(rot, shadow.dir); // shadow-axis vector in equator-of-date coordinates + const e = Astronomy.RotateVector(rot, shadow.target); // lunacentric Earth in equator-of-date coordinates + + // Convert all distances from AU to km. + // But dilate the z-coordinates so that the Earth becomes a perfect sphere. + // Then find the intersection of the vector with the sphere. + // See p 184 in Montenbruck & Pfleger's "Astronomy on the Personal Computer", second edition. + v.x *= KM_PER_AU; + v.y *= KM_PER_AU; + v.z *= KM_PER_AU / EARTH_FLATTENING; + e.x *= KM_PER_AU; + e.y *= KM_PER_AU; + e.z *= KM_PER_AU / EARTH_FLATTENING; + + // Solve the quadratic equation that finds whether and where + // the shadow axis intersects with the Earth in the dilated coordinate system. + const R = EARTH_EQUATORIAL_RADIUS_KM; + const A = v.x*v.x + v.y*v.y + v.z*v.z; + const B = -2.0 * (v.x*e.x + v.y*e.y + v.z*e.z); + const C = (e.x*e.x + e.y*e.y + e.z*e.z) - R*R; + const radic = B*B - 4*A*C; + + if (radic > 0.0) { + // Calculate the closer of the two intersection points. + // This will be on the day side of the Earth. + const u = (-B - Math.sqrt(radic)) / (2 * A); + + // Convert lunacentric dilated coordinates to geocentric coordinates. + const px = u*v.x - e.x; + const py = u*v.y - e.y; + const pz = (u*v.z - e.z) * EARTH_FLATTENING; + + // Convert cartesian coordinates into geodetic latitude/longitude. + const proj = Math.sqrt(px*px + py*py) * (EARTH_FLATTENING * EARTH_FLATTENING); + if (proj == 0.0) { + latitude = (pz > 0.0) ? +90.0 : -90.0; + } else { + latitude = RAD2DEG * Math.atan(pz / proj); + } + + // Adjust longitude for Earth's rotation at the given UT. + const gast = sidereal_time(peak); + longitude = (RAD2DEG * Math.atan2(py, px) - (15*gast)) % 360.0; + if (longitude <= -180.0) { + longitude += 360.0; + } else if (longitude > +180.0) { + longitude -= 360.0; + } + + // We want to determine whether the observer sees a total eclipse or an annular eclipse. + // We need to perform a series of vector calculations... + // Calculate the inverse rotation matrix, so we can convert EQD to EQJ. + const inv = Astronomy.InverseRotation(rot); + + // Put the EQD geocentric coordinates of the observer into the vector 'o'. + // Also convert back from kilometers to astronomical units. + let o = new Vector(px / KM_PER_AU, py / KM_PER_AU, pz / KM_PER_AU, shadow.time); + + // Rotate the observer's geocentric EQD back to the EQJ system. + o = Astronomy.RotateVector(inv, o); + + // Convert geocentric vector to lunacentric vector. + o.x += shadow.target.x; + o.y += shadow.target.y; + o.z += shadow.target.z; + + // Recalculate the shadow using a vector from the Moon's center toward the observer. + const surface = CalcShadow(MOON_POLAR_RADIUS_KM, shadow.time, o, shadow.dir); + + // If we did everything right, the shadow distance should be very close to zero. + // That's because we already determined the observer 'o' is on the shadow axis! + if (surface.r > 1.0e-9 || surface.r < 0.0) { + throw `Unexpected shadow distance from geoid intersection = ${surface.r}`; + } + + kind = EclipseKindFromUmbra(surface.k); + } + + return new GlobalSolarEclipseInfo(kind, peak, distance, latitude, longitude); +} + + /** * @brief Searches for the next lunar eclipse in a series. * @@ -5842,5 +6039,75 @@ Astronomy.NextLunarEclipse = function(prevEclipseTime) { return Astronomy.SearchLunarEclipse(startTime); } +/** + * @brief Searches for a solar eclipse visible anywhere on the Earth's surface. + * + * This function finds the first solar eclipse that occurs after `startTime`. + * A solar eclipse found may be partial, annular, or total. + * See {@link Astronomy.GlobalSolarEclipseInfo} for more information. + * To find a series of solar eclipses, call this function once, + * then keep calling {@link Astronomy.NextGlobalSolarEclipse} as many times as desired, + * passing in the `peak` value returned from the previous call. + * + * @param {Astronomy.AstroTime} startTime + * The date and time for starting the search for a solar eclipse. + * + * @returns {Astronomy.GlobalSolarEclipseInfo} + */ +Astronomy.SearchGlobalSolarEclipse = function(startTime) { + const PruneLatitude = 1.8; // Moon's ecliptic latitude beyond which eclipse is impossible + // Iterate through consecutive new moons until we find a solar eclipse visible somewhere on Earth. + let nmtime = startTime; + let nmcount; + for (nmcount=0; nmcount < 12; ++nmcount) { + // Search for the next new moon. Any eclipse will be near it. + const newmoon = Astronomy.SearchMoonPhase(0.0, nmtime, 40.0); + if (newmoon === null) { + throw 'Cannot find new moon'; + } + + // Pruning: if the new moon's ecliptic latitude is too large, a solar eclipse is not possible. + const mp = CalcMoon(newmoon); + if (RAD2DEG * Math.abs(mp.geo_eclip_lat) < PruneLatitude) { + // Search near the new moon for the time when the center of the Earth + // is closest to the line passing through the centers of the Sun and Moon. + const shadow = PeakMoonShadow(newmoon); + if (shadow.r < shadow.p + EARTH_MEAN_RADIUS_KM) { + // This is at least a partial solar eclipse visible somewhere on Earth. + // Try to find an intersection between the shadow axis and the Earth's oblate geoid. + return GeoidIntersect(shadow); + } + } + + // We didn't find an eclipse on this new moon, so search for the next one. + nmtime = newmoon.AddDays(10.0); + } + + // Safety valve to prevent infinite loop. + // This should never happen, because at least 2 solar eclipses happen per year. + throw 'Failed to find solar eclipse within 12 full moons.'; +} + + +/** + * @brief Searches for the next global solar eclipse in a series. + * + * After using {@link Astronomy.SearchGlobalSolarEclipse} to find the first solar eclipse + * in a series, you can call this function to find the next consecutive solar eclipse. + * Pass in the `peak` value from the {@link Astronomy.GlobalSolarEclipseInfo} returned by the + * previous call to `SearchGlobalSolarEclipse` or `NextGlobalSolarEclipse` + * to find the next solar eclipse. + * + * @param {Astronomy.AstroTime} prevEclipseTime + * A date and time near a new moon. Solar eclipse search will start at the next new moon. + * + * @returns {Astronomy.GlobalSolarEclipseInfo} + */ +Astronomy.NextGlobalSolarEclipse = function(prevEclipseTime) { + const startTime = prevEclipseTime.AddDays(10.0); + return Astronomy.SearchGlobalSolarEclipse(startTime); +} + + })(typeof exports==='undefined' ? (this.Astronomy={}) : exports); diff --git a/source/js/astronomy.min.js b/source/js/astronomy.min.js index 664563b7..6bcb8971 100644 --- a/source/js/astronomy.min.js +++ b/source/js/astronomy.min.js @@ -27,153 +27,156 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(d){var u=0;return function(){return uMath.abs(c))throw"AngleBetween: first vector is too short.";var e=b.x*b.x+b.y*b.y+b.z*b.z;if(1E-8>Math.abs(e))throw"AngleBetween: second vector is too short.";a=(a.x*b.x+a.y*b.y+a.z*b.z)/Math.sqrt(c*e);return-1>=a?180:1<=a?0:57.29577951308232*Math.acos(a)}function A(a){return a+da(a)/86400}function D(a){a=a.tt/36525;return(((((-4.34E-8*a-5.76E-7)*a+.0020034)*a-1.831E-4)*a-46.836769)*a+84381.406)/ -3600}function N(a){var b;if(!O||1E-6=b;++b)0!==a[b]&&k(g.x,g.y,e(r,a[b],b),e(t,a[b],b),function(a,b){return g.x=a,g.y=b});return g}function f(a,b,c,e,d,g,f,h){d=m(d,g,f,h);q+=a*d.y;V+=b*d.y;A+= -c*d.x;B+=e*d.x}++d.CalcMoonCount;a=a.tt/36525;var n,p,q,V,r=c(-6,6,1,4),t=c(-6,6,1,4);var v=a*a;var A=V=q=0;var B=3422.7;var w=l(.19833+.05611*a);var z=l(.27869+.04508*a);var x=l(.16827-.36903*a);var D=l(.34734-5.37261*a),E=l(.10498-5.37899*a),C=l(.42681-.41855*a),K=l(.14943-5.37511*a);var F=.84*w+.31*z+14.27*x+7.26*D+.28*E+.24*C;var I=2.94*w+.31*z+14.27*x+9.34*D+1.12*E+.83*C;var G=-6.4*w-1.89*C;x=.21*w+.31*z+14.27*x-88.7*D-15.3*E+.24*C-1.86*K;z=F-G;w=-3.332E-6*l(.59734-5.37261*a)-5.39E-7*l(.35498- -5.37899*a)-6.4E-8*l(.39943-5.37511*a);F=H*u(.60643382+1336.85522467*a-3.13E-6*v)+F/J;I=H*u(.37489701+1325.55240982*a+2.565E-5*v)+I/J;G=H*u(.99312619+99.99735956*a-4.4E-7*v)+G/J;x=H*u(.25909118+1342.2278298*a-8.92E-6*v)+x/J;v=H*u(.82736186+1236.85308708*a-3.97E-6*v)+z/J;for(n=1;4>=n;++n){switch(n){case 1:var L=I;var y=4;var M=1.000002208;break;case 2:L=G;y=3;M=.997504612-.002495388*a;break;case 3:L=x;y=4;M=1.000002708+139.978*w;break;case 4:L=v,y=6,M=1}g(0,n,1);g(1,n,Math.cos(L)*M);h(0,n,0);h(1,n, -Math.sin(L)*M);for(p=2;p<=y;++p)k(e(r,p-1,n),e(t,p-1,n),e(r,1,n),e(t,1,n),function(a,b){return g(p,n,a),h(p,n,b)});for(p=1;p<=y;++p)g(-p,n,e(r,p,n)),h(-p,n,-e(t,p,n))}f(13.902,14.06,-.001,.2607,0,0,0,4);f(.403,-4.01,.394,.0023,0,0,0,3);f(2369.912,2373.36,.601,28.2333,0,0,0,2);f(-125.154,-112.79,-.725,-.9781,0,0,0,1);f(1.979,6.98,-.445,.0433,1,0,0,4);f(191.953,192.72,.029,3.0861,1,0,0,2);f(-8.466,-13.51,.455,-.1093,1,0,0,1);f(22639.5,22609.07,.079,186.5398,1,0,0,0);f(18.609,3.59,-.094,.0118,1,0,0, +var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(e){var u=0;return function(){return uMath.abs(c))throw"AngleBetween: first vector is too short.";var d=b.x*b.x+b.y*b.y+b.z*b.z;if(1E-8>Math.abs(d))throw"AngleBetween: second vector is too short.";a=(a.x*b.x+a.y*b.y+a.z*b.z)/Math.sqrt(c*d);return-1>=a?180:1<=a?0:57.29577951308232*Math.acos(a)}function A(a){return a+ea(a)/86400}function E(a){a=a.tt/36525;return(((((-4.34E-8*a-5.76E-7)*a+.0020034)*a-1.831E-4)*a-46.836769)*a+84381.406)/ +3600}function N(a){var b;if(!O||1E-6=b;++b)0!==a[b]&&l(h.x,h.y,d(r,a[b],b),d(t,a[b],b),function(a,b){return h.x=a,h.y=b});return h}function f(a,b,c,d,e,h,f,g){e=m(e,h,f,g);q+=a*e.y;V+=b*e.y;A+= +c*e.x;B+=d*e.x}++e.CalcMoonCount;a=a.tt/36525;var n,p,q,V,r=c(-6,6,1,4),t=c(-6,6,1,4);var v=a*a;var A=V=q=0;var B=3422.7;var w=g(.19833+.05611*a);var z=g(.27869+.04508*a);var x=g(.16827-.36903*a);var C=g(.34734-5.37261*a),E=g(.10498-5.37899*a),D=g(.42681-.41855*a),K=g(.14943-5.37511*a);var F=.84*w+.31*z+14.27*x+7.26*C+.28*E+.24*D;var I=2.94*w+.31*z+14.27*x+9.34*C+1.12*E+.83*D;var G=-6.4*w-1.89*D;x=.21*w+.31*z+14.27*x-88.7*C-15.3*E+.24*D-1.86*K;z=F-G;w=-3.332E-6*g(.59734-5.37261*a)-5.39E-7*g(.35498- +5.37899*a)-6.4E-8*g(.39943-5.37511*a);F=H*u(.60643382+1336.85522467*a-3.13E-6*v)+F/J;I=H*u(.37489701+1325.55240982*a+2.565E-5*v)+I/J;G=H*u(.99312619+99.99735956*a-4.4E-7*v)+G/J;x=H*u(.25909118+1342.2278298*a-8.92E-6*v)+x/J;v=H*u(.82736186+1236.85308708*a-3.97E-6*v)+z/J;for(n=1;4>=n;++n){switch(n){case 1:var L=I;var y=4;var M=1.000002208;break;case 2:L=G;y=3;M=.997504612-.002495388*a;break;case 3:L=x;y=4;M=1.000002708+139.978*w;break;case 4:L=v,y=6,M=1}h(0,n,1);h(1,n,Math.cos(L)*M);k(0,n,0);k(1,n, +Math.sin(L)*M);for(p=2;p<=y;++p)l(d(r,p-1,n),d(t,p-1,n),d(r,1,n),d(t,1,n),function(a,b){return h(p,n,a),k(p,n,b)});for(p=1;p<=y;++p)h(-p,n,d(r,p,n)),k(-p,n,-d(t,p,n))}f(13.902,14.06,-.001,.2607,0,0,0,4);f(.403,-4.01,.394,.0023,0,0,0,3);f(2369.912,2373.36,.601,28.2333,0,0,0,2);f(-125.154,-112.79,-.725,-.9781,0,0,0,1);f(1.979,6.98,-.445,.0433,1,0,0,4);f(191.953,192.72,.029,3.0861,1,0,0,2);f(-8.466,-13.51,.455,-.1093,1,0,0,1);f(22639.5,22609.07,.079,186.5398,1,0,0,0);f(18.609,3.59,-.094,.0118,1,0,0, -1);f(-4586.465,-4578.13,-.077,34.3117,1,0,0,-2);f(3.215,5.44,.192,-.0386,1,0,0,-3);f(-38.428,-38.64,.001,.6008,1,0,0,-4);f(-.393,-1.43,-.092,.0086,1,0,0,-6);f(-.289,-1.59,.123,-.0053,0,1,0,4);f(-24.42,-25.1,.04,-.3,0,1,0,2);f(18.023,17.93,.007,.1494,0,1,0,1);f(-668.146,-126.98,-1.302,-.3997,0,1,0,0);f(.56,.32,-.001,-.0037,0,1,0,-1);f(-165.145,-165.06,.054,1.9178,0,1,0,-2);f(-1.877,-6.46,-.416,.0339,0,1,0,-4);f(.213,1.02,-.074,.0054,2,0,0,4);f(14.387,14.78,-.017,.2833,2,0,0,2);f(-.586,-1.2,.054,-.01, 2,0,0,1);f(769.016,767.96,.107,10.1657,2,0,0,0);f(1.75,2.01,-.018,.0155,2,0,0,-1);f(-211.656,-152.53,5.679,-.3039,2,0,0,-2);f(1.225,.91,-.03,-.0088,2,0,0,-3);f(-30.773,-34.07,-.308,.3722,2,0,0,-4);f(-.57,-1.4,-.074,.0109,2,0,0,-6);f(-2.921,-11.75,.787,-.0484,1,1,0,2);f(1.267,1.52,-.022,.0164,1,1,0,1);f(-109.673,-115.18,.461,-.949,1,1,0,0);f(-205.962,-182.36,2.056,1.4437,1,1,0,-2);f(.233,.36,.012,-.0025,1,1,0,-3);f(-4.391,-9.66,-.471,.0673,1,1,0,-4);f(.283,1.53,-.111,.006,1,-1,0,4);f(14.577,31.7,-1.54, .2302,1,-1,0,2);f(147.687,138.76,.679,1.1528,1,-1,0,0);f(-1.089,.55,.021,0,1,-1,0,-1);f(28.475,23.59,-.443,-.2257,1,-1,0,-2);f(-.276,-.38,-.006,-.0036,1,-1,0,-3);f(.636,2.27,.146,-.0102,1,-1,0,-4);f(-.189,-1.68,.131,-.0028,0,2,0,2);f(-7.486,-.66,-.037,-.0086,0,2,0,0);f(-8.096,-16.35,-.74,.0918,0,2,0,-2);f(-5.741,-.04,0,-9E-4,0,0,2,2);f(.255,0,0,0,0,0,2,1);f(-411.608,-.2,0,-.0124,0,0,2,0);f(.584,.84,0,.0071,0,0,2,-1);f(-55.173,-52.14,0,-.1052,0,0,2,-2);f(.254,.25,0,-.0017,0,0,2,-3);f(.025,-1.67,0, .0031,0,0,2,-4);f(1.06,2.96,-.166,.0243,3,0,0,2);f(36.124,50.64,-1.3,.6215,3,0,0,0);f(-13.193,-16.4,.258,-.1187,3,0,0,-2);f(-1.187,-.74,.042,.0074,3,0,0,-4);f(-.293,-.31,-.002,.0046,3,0,0,-6);f(-.29,-1.45,.116,-.0051,2,1,0,2);f(-7.649,-10.56,.259,-.1038,2,1,0,0);f(-8.627,-7.59,.078,-.0192,2,1,0,-2);f(-2.74,-2.54,.022,.0324,2,1,0,-4);f(1.181,3.32,-.212,.0213,2,-1,0,2);f(9.703,11.67,-.151,.1268,2,-1,0,0);f(-.352,-.37,.001,-.0028,2,-1,0,-1);f(-2.494,-1.17,-.003,-.0017,2,-1,0,-2);f(.36,.2,-.012,-.0043, 2,-1,0,-4);f(-1.167,-1.25,.008,-.0106,1,2,0,0);f(-7.412,-6.12,.117,.0484,1,2,0,-2);f(-.311,-.65,-.032,.0044,1,2,0,-4);f(.757,1.82,-.105,.0112,1,-2,0,2);f(2.58,2.32,.027,.0196,1,-2,0,0);f(2.533,2.4,-.014,-.0212,1,-2,0,-2);f(-.344,-.57,-.025,.0036,0,3,0,-2);f(-.992,-.02,0,0,1,0,2,2);f(-45.099,-.02,0,-.001,1,0,2,0);f(-.179,-9.52,0,-.0833,1,0,2,-2);f(-.301,-.33,0,.0014,1,0,2,-4);f(-6.382,-3.37,0,-.0481,1,0,-2,2);f(39.528,85.13,0,-.7136,1,0,-2,0);f(9.366,.71,0,-.0112,1,0,-2,-2);f(.202,.02,0,0,1,0,-2,-4); f(.415,.1,0,.0013,0,1,2,0);f(-2.152,-2.26,0,-.0066,0,1,2,-2);f(-1.44,-1.3,0,.0014,0,1,-2,2);f(.384,-.04,0,0,0,1,-2,-2);f(1.938,3.6,-.145,.0401,4,0,0,0);f(-.952,-1.58,.052,-.013,4,0,0,-2);f(-.551,-.94,.032,-.0097,3,1,0,0);f(-.482,-.57,.005,-.0045,3,1,0,-2);f(.681,.96,-.026,.0115,3,-1,0,0);f(-.297,-.27,.002,-9E-4,2,2,0,-2);f(.254,.21,-.003,0,2,-2,0,-2);f(-.25,-.22,.004,.0014,1,3,0,-2);f(-3.996,0,0,4E-4,2,0,2,0);f(.557,-.75,0,-.009,2,0,2,-2);f(-.459,-.38,0,-.0053,2,0,-2,2);f(-1.298,.74,0,4E-4,2,0,-2, -0);f(.538,1.14,0,-.0141,2,0,-2,-2);f(.263,.02,0,0,1,1,2,0);f(.426,.07,0,-6E-4,1,1,-2,-2);f(-.304,.03,0,3E-4,1,-1,2,0);f(-.372,-.19,0,-.0027,1,-1,-2,2);f(.418,0,0,0,0,0,4,0);f(-.33,-.04,0,0,3,0,2,0);y=-526.069*m(0,0,1,-2).y;y+=-3.352*m(0,0,1,-4).y;y+=44.297*m(1,0,1,-2).y;y+=-6*m(1,0,1,-4).y;y+=20.599*m(-1,0,1,0).y;y+=-30.598*m(-1,0,1,-2).y;y+=-24.649*m(-2,0,1,0).y;y+=-2*m(-2,0,1,-2).y;y+=-22.571*m(0,1,1,-2).y;y+=10.985*m(0,-1,1,-2).y;q+=.82*l(.7736-62.5512*a)+.31*l(.0466-125.1025*a)+.35*l(.5785-25.1042* -a)+.66*l(.4591+1335.8075*a)+.64*l(.313-91.568*a)+1.14*l(.148+1331.2898*a)+.21*l(.5918+1056.5859*a)+.44*l(.5784+1322.8595*a)+.24*l(.2275-5.7374*a)+.28*l(.2965+2.6929*a)+.33*l(.3132+6.3368*a);a=x+V/J;a=(1.000002708+139.978*w)*(18518.511+1.189+A)*Math.sin(a)-6.24*Math.sin(3*a)+y;return{geo_eclip_lon:H*u((F+q/J)/H),geo_eclip_lat:Math.PI/648E3*a,distance_au:4.263520978299708E-5*J/(.999953253*B)}}function P(a,b,c){a=W(a,c);return[a.rot[0][0]*b[0]+a.rot[1][0]*b[1]+a.rot[2][0]*b[2],a.rot[0][1]*b[0]+a.rot[1][1]* -b[1]+a.rot[2][1]*b[2],a.rot[0][2]*b[0]+a.rot[1][2]*b[1]+a.rot[2][2]*b[2]]}function W(a,b){var c=84381.406;if(0!==a&&0!==b)throw"One of (tt1, tt2) must be 0.";a=(b-a)/36525;0===b&&(a=-a);var e=((((3.337E-7*a-4.67E-7)*a-.00772503)*a+.0512623)*a-.025754)*a+c;c*=4.84813681109536E-6;var d=((((-9.51E-8*a+1.32851E-4)*a-.00114045)*a-1.0790069)*a+5038.481507)*a*4.84813681109536E-6;e*=4.84813681109536E-6;var h=((((-5.6E-8*a+1.70663E-4)*a-.00121197)*a-2.3814292)*a+10.556403)*a*4.84813681109536E-6;a=Math.sin(c); -c=Math.cos(c);var k=Math.sin(-d);d=Math.cos(-d);var l=Math.sin(-e);var m=Math.cos(-e);var f=Math.sin(h);var n=Math.cos(h);h=n*d-k*f*m;e=n*k*c+f*m*d*c-a*f*l;var p=n*k*a+f*m*d*a+c*f*l;var q=-f*d-k*n*m;var r=-f*k*c+n*m*d*c-a*n*l;f=-f*k*a+n*m*d*a+c*n*l;k*=l;n=-l*d*c-a*m;a=-l*d*a+m*c;return 0===b?new B([[h,e,p],[q,r,f],[k,n,a]]):new B([[h,q,k],[e,r,n],[p,f,a]])}function Q(a){var b=a.tt/36525,c=15*N(a).ee;a=(.779057273264+.00273781191135448*a.ut+a.ut%1)%1*360;0>a&&(a+=360);b=((c+.014506+((((-3.68E-8*b- -2.9956E-5)*b-4.4E-7)*b+1.3915817)*b+4612.156534)*b)/3600+a)%360/15;0>b&&(b+=24);return b}function X(a,b,c){a=Y(a,b);return[a.rot[0][0]*c[0]+a.rot[1][0]*c[1]+a.rot[2][0]*c[2],a.rot[0][1]*c[0]+a.rot[1][1]*c[1]+a.rot[2][1]*c[2],a.rot[0][2]*c[0]+a.rot[1][2]*c[1]+a.rot[2][2]*c[2]]}function Y(a,b){a=N(a);var c=.017453292519943295*a.mobl,e=.017453292519943295*a.tobl,d=4.84813681109536E-6*a.dpsi;a=Math.cos(c);c=Math.sin(c);var h=Math.cos(e),k=Math.sin(e);e=Math.cos(d);var l=Math.sin(d);d=-l*a;var m=-l*c, -f=l*h,n=e*a*h+c*k,p=e*c*h-a*k;l*=k;var q=e*a*k-c*h;a=e*c*k+a*h;return 0===b?new B([[e,f,l],[d,n,q],[m,p,a]]):new B([[e,d,m],[f,n,p],[l,q,a]])}function oa(a){if(!(a instanceof Array)||3!==a.length)return!1;for(var b=0;3>b;++b){if(!(a[b]instanceof Array)||3!==a[b].length)return!1;for(var c=0;3>c;++c)if("number"!==typeof a[b][c])return!1}return!0}function fa(a){var b=a[0]*a[0]+a[1]*a[1],c=Math.sqrt(b+a[2]*a[2]);if(0===b){if(0===a[2])throw"Indeterminate sky coordinates";return 0>a[2]?{ra:0,dec:-90,dist:c}: -{ra:0,dec:90,dist:c}}var e=Math.atan2(a[1],a[0])/.2617993877991494;0>e&&(e+=24);return new Z(e,Math.atan2(a[2],Math.sqrt(b))/.017453292519943295,c)}function C(a,b){var c=.017453292519943295*a;a=Math.cos(c);c=Math.sin(c);return[a*b[0]+c*b[1]+0*b[2],-c*b[0]+a*b[1]+0*b[2],0*b[0]+0*b[1]+1*b[2]]}function ha(a,b,c,e,d){var g=b*e+c*d;b=-b*d+c*e;c=Math.sqrt(a*a+g*g);e=0;0e&&(e+=360));return new pa(a,g,b,57.29577951308232*Math.atan2(b,c),e)}function K(a,b){var c= -1,e=0;a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next()){var h=0;d=$jscomp.makeIterator(d.value);for(var k=d.next();!k.done;k=d.next())k=k.value,h+=k[0]*Math.cos(k[1]+b*k[2]);e+=c*h;c*=b}return e}function w(a,b){var c=b.tt/365250,e=[];a=$jscomp.makeIterator(a);for(var d=a.next();!d.done;d=a.next())e.push(K(d.value,c));c=e[2]*Math.cos(e[1]);e=[c*Math.cos(e[0]),c*Math.sin(e[0]),e[2]*Math.sin(e[1])];return new r(e[0]+4.4036E-7*e[1]-1.90919E-7*e[2],-4.79966E-7*e[0]+.917482137087*e[1]-.397776982902* -e[2],.397776982902*e[1]+.917482137087*e[2],b)}function R(a,b,c,e){e/=e+333054.25318;b=w(t[c],b);a.x+=e*b.x;a.y+=e*b.y;a.z+=e*b.z}function qa(a,b,c,e,d){var g=(d+c)/2-e;c=(d-c)/2;if(0==g){if(0==c)return null;e=-e/c;if(-1>e||1=e)return null;d=Math.sqrt(e);e=(-c+d)/(2*g);d=(-c-d)/(2*g);if(-1<=e&&1>=e){if(-1<=d&&1>=d)return null}else if(-1<=d&&1>=d)e=d;else return null}return{x:e,t:a+e*b,df_dt:(2*g*e+c)/b}}function F(a){for(;-180>=a;)a+=360;for(;180k;++k){var l=b.AddDays(k*c);l=e*K(t.Neptune[2],l.tt/365250);if(0==k||l>h)d=k,h=l}b=b.AddDays((d-1)*c);c*= -2}}function ra(a){var b=a.AddDays(-30/360*z.Neptune.OrbitalPeriod),c=a.AddDays(.75*z.Neptune.OrbitalPeriod),e=b,d=b,h=-1,k=-1;c=(c.ut-b.ut)/99;for(var l=0;100>l;++l){var m=b.AddDays(l*c),f=K(t.Neptune[2],m.tt/365250);0===l?k=h=f:(f>k&&(k=f,d=m),f=a.tt)return d.time.tt>=a.tt&&d.time.tt=a.tt)return d;throw"Internal error: failed to find Neptune apsis.";}function ja(a){a=360-a;360<=a?a-=360: -0>a&&(a+=360);return a}function G(a){var b=w(t.Earth,a),c=d.GeoMoon(a),e=(b.x*c.x+b.y*c.y+b.z*c.z)/(b.x*b.x+b.y*b.y+b.z*b.z),g=e*b.x-c.x,h=e*b.y-c.y;b=e*b.z-c.z;return new sa(a,e,1.4959787069098932E8*Math.sqrt(g*g+h*h+b*b),695700-689241*(1+e),-695700+702159*(1+e))}function ta(a){var b=a.AddDays(-.03);a=a.AddDays(.03);b=d.Search(function(a){var b=1/86400,c=a.AddDays(-b);a=a.AddDays(+b);c=G(c);return(G(a).r-c.r)/b},b,a,1);return G(b)}function aa(a,b,c){var e=c/1440;c=a.AddDays(-e);e=a.AddDays(+e);c= -d.Search(function(a){return-(G(a).r-b)},c,a,1);a=d.Search(function(a){return+(G(a).r-b)},a,e,1);if(null===c||null===a)throw"Failed to find shadow semiduration";return 720*(a.ut-c.ut)}var ba=new Date("2000-01-01T12:00:00Z"),H=2*Math.PI,J=180/Math.PI*3600,ua=-.17-5*Math.log10(648E3/Math.PI),va=34/60,T,ka,la;d.Bodies="Sun Moon Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto SSB EMB".split(" ");var z={Mercury:{OrbitalPeriod:87.969},Venus:{OrbitalPeriod:224.701},Earth:{OrbitalPeriod:365.256}, -Mars:{OrbitalPeriod:686.98},Jupiter:{OrbitalPeriod:4332.589},Saturn:{OrbitalPeriod:10759.22},Uranus:{OrbitalPeriod:30685.4},Neptune:{OrbitalPeriod:60189},Pluto:{OrbitalPeriod:90560}},t={Mercury:[[[[4.40250710144,0,0],[.40989414977,1.48302034195,26087.9031415742],[.050462942,4.47785489551,52175.8062831484],[.00855346844,1.16520322459,78263.70942472259],[.00165590362,4.11969163423,104351.61256629678],[3.4561897E-4,.77930768443,130439.51570787099],[7.583476E-5,3.71348404924,156527.41884944518]],[[26087.90313685529, -0,0],[.01131199811,6.21874197797,26087.9031415742],[.00292242298,3.04449355541,52175.8062831484],[7.5775081E-4,6.08568821653,78263.70942472259],[1.9676525E-4,2.80965111777,104351.61256629678]]],[[[.11737528961,1.98357498767,26087.9031415742],[.02388076996,5.03738959686,52175.8062831484],[.01222839532,3.14159265359,0],[.0054325181,1.79644363964,78263.70942472259],[.0012977877,4.83232503958,104351.61256629678],[3.1866927E-4,1.58088495658,130439.51570787099],[7.963301E-5,4.60972126127,156527.41884944518]], -[[.00274646065,3.95008450011,26087.9031415742],[9.9737713E-4,3.14159265359,0]]],[[[.39528271651,0,0],[.07834131818,6.19233722598,26087.9031415742],[.00795525558,2.95989690104,52175.8062831484],[.00121281764,6.01064153797,78263.70942472259],[2.1921969E-4,2.77820093972,104351.61256629678],[4.354065E-5,5.82894543774,130439.51570787099]],[[.0021734774,4.65617158665,26087.9031415742],[4.4141826E-4,1.42385544001,52175.8062831484]]]],Venus:[[[[3.17614666774,0,0],[.01353968419,5.59313319619,10213.285546211], -[8.9891645E-4,5.30650047764,20426.571092422],[5.477194E-5,4.41630661466,7860.4193924392],[3.455741E-5,2.6996444782,11790.6290886588],[2.372061E-5,2.99377542079,3930.2096962196],[1.317168E-5,5.18668228402,26.2983197998],[1.664146E-5,4.25018630147,1577.3435424478],[1.438387E-5,4.15745084182,9683.5945811164],[1.200521E-5,6.15357116043,30639.856638633]],[[10213.28554621638,0,0],[9.5617813E-4,2.4640651111,10213.285546211],[7.787201E-5,.6247848222,20426.571092422]]],[[[.05923638472,.26702775812,10213.285546211], -[4.0107978E-4,1.14737178112,20426.571092422],[3.2814918E-4,3.14159265359,0]],[[.00287821243,1.88964962838,10213.285546211]]],[[[.72334820891,0,0],[.00489824182,4.02151831717,10213.285546211],[1.658058E-5,4.90206728031,20426.571092422],[1.378043E-5,1.12846591367,11790.6290886588],[1.632096E-5,2.84548795207,7860.4193924392],[4.98395E-6,2.58682193892,9683.5945811164],[2.21985E-6,2.01346696541,19367.1891622328],[2.37454E-6,2.55136053886,15720.8387848784]],[[3.4551041E-4,.89198706276,10213.285546211]]]], -Earth:[[[[1.75347045673,0,0],[.03341656453,4.66925680415,6283.0758499914],[3.4894275E-4,4.62610242189,12566.1516999828],[3.417572E-5,2.82886579754,3.523118349],[3.497056E-5,2.74411783405,5753.3848848968],[3.135899E-5,3.62767041756,77713.7714681205],[2.676218E-5,4.41808345438,7860.4193924392],[2.342691E-5,6.13516214446,3930.2096962196],[1.273165E-5,2.03709657878,529.6909650946],[1.324294E-5,.74246341673,11506.7697697936],[9.01854E-6,2.04505446477,26.2983197998],[1.199167E-5,1.10962946234,1577.3435424478], -[8.57223E-6,3.50849152283,398.1490034082],[7.79786E-6,1.17882681962,5223.6939198022],[9.9025E-6,5.23268072088,5884.9268465832],[7.53141E-6,2.53339052847,5507.5532386674],[5.05267E-6,4.58292599973,18849.2275499742],[4.92392E-6,4.20505711826,775.522611324],[3.56672E-6,2.91954114478,.0673103028],[2.84125E-6,1.89869240932,796.2980068164],[2.42879E-6,.34481445893,5486.777843175],[3.17087E-6,5.84901948512,11790.6290886588],[2.71112E-6,.31486255375,10977.078804699],[2.06217E-6,4.80646631478,2544.3144198834], -[2.05478E-6,1.86953770281,5573.1428014331],[2.02318E-6,2.45767790232,6069.7767545534],[1.26225E-6,1.08295459501,20.7753954924],[1.55516E-6,.83306084617,213.299095438]],[[6283.0758499914,0,0],[.00206058863,2.67823455808,6283.0758499914],[4.303419E-5,2.63512233481,12566.1516999828]],[[8.721859E-5,1.07253635559,6283.0758499914]]],[[],[[.00227777722,3.4137662053,6283.0758499914],[3.805678E-5,3.37063423795,12566.1516999828]]],[[[1.00013988784,0,0],[.01670699632,3.09846350258,6283.0758499914],[1.3956024E-4, -3.05524609456,12566.1516999828],[3.08372E-5,5.19846674381,77713.7714681205],[1.628463E-5,1.17387558054,5753.3848848968],[1.575572E-5,2.84685214877,7860.4193924392],[9.24799E-6,5.45292236722,11506.7697697936],[5.42439E-6,4.56409151453,3930.2096962196],[4.7211E-6,3.66100022149,5884.9268465832],[8.5831E-7,1.27079125277,161000.6857376741],[5.7056E-7,2.01374292245,83996.84731811189],[5.5736E-7,5.2415979917,71430.69561812909],[1.74844E-6,3.01193636733,18849.2275499742],[2.43181E-6,4.2734953079,11790.6290886588]], -[[.00103018607,1.10748968172,6283.0758499914],[1.721238E-5,1.06442300386,12566.1516999828]],[[4.359385E-5,5.78455133808,6283.0758499914]]]],Mars:[[[[6.20347711581,0,0],[.18656368093,5.0503710027,3340.6124266998],[.01108216816,5.40099836344,6681.2248533996],[9.1798406E-4,5.75478744667,10021.8372800994],[2.7744987E-4,5.97049513147,3.523118349],[1.0610235E-4,2.93958560338,2281.2304965106],[1.2315897E-4,.84956094002,2810.9214616052],[8.926784E-5,4.15697846427,.0172536522],[8.715691E-5,6.11005153139,13362.4497067992], -[6.797556E-5,.36462229657,398.1490034082],[7.774872E-5,3.33968761376,5621.8429232104],[3.575078E-5,1.6618650571,2544.3144198834],[4.161108E-5,.22814971327,2942.4634232916],[3.075252E-5,.85696614132,191.4482661116],[2.628117E-5,.64806124465,3337.0893083508],[2.937546E-5,6.07893711402,.0673103028],[2.389414E-5,5.03896442664,796.2980068164],[2.579844E-5,.02996736156,3344.1355450488],[1.528141E-5,1.14979301996,6151.533888305],[1.798806E-5,.65634057445,529.6909650946],[1.264357E-5,3.62275122593,5092.1519581158], -[1.286228E-5,3.06796065034,2146.1654164752],[1.546404E-5,2.91579701718,1751.539531416],[1.024902E-5,3.69334099279,8962.4553499102],[8.91566E-6,.18293837498,16703.062133499],[8.58759E-6,2.4009381194,2914.0142358238],[8.32715E-6,2.46418619474,3340.5951730476],[8.3272E-6,4.49495782139,3340.629680352],[7.12902E-6,3.66335473479,1059.3819301892],[7.48723E-6,3.82248614017,155.4203994342],[7.23861E-6,.67497311481,3738.761430108],[6.35548E-6,2.92182225127,8432.7643848156],[6.55162E-6,.48864064125,3127.3133312618], -[5.50474E-6,3.81001042328,.9803210682],[5.5275E-6,4.47479317037,1748.016413067],[4.25966E-6,.55364317304,6283.0758499914],[4.15131E-6,.49662285038,213.299095438],[4.72167E-6,3.62547124025,1194.4470102246],[3.06551E-6,.38052848348,6684.7479717486],[3.12141E-6,.99853944405,6677.7017350506],[2.93198E-6,4.22131299634,20.7753954924],[3.02375E-6,4.48618007156,3532.0606928114],[2.74027E-6,.54222167059,3340.545116397],[2.81079E-6,5.88163521788,1349.8674096588],[2.31183E-6,1.28242156993,3870.3033917944],[2.83602E-6, -5.7688543494,3149.1641605882],[2.36117E-6,5.75503217933,3333.498879699],[2.74033E-6,.13372524985,3340.6797370026],[2.99395E-6,2.78323740866,6254.6266625236]],[[3340.61242700512,0,0],[.01457554523,3.60433733236,3340.6124266998],[.00168414711,3.92318567804,6681.2248533996],[2.0622975E-4,4.26108844583,10021.8372800994],[3.452392E-5,4.7321039319,3.523118349],[2.586332E-5,4.60670058555,13362.4497067992],[8.41535E-6,4.45864030426,2281.2304965106]],[[5.8152577E-4,2.04961712429,3340.6124266998],[1.3459579E-4, -2.45738706163,6681.2248533996]]],[[[.03197134986,3.76832042431,3340.6124266998],[.00298033234,4.10616996305,6681.2248533996],[.00289104742,0,0],[3.1365539E-4,4.4465105309,10021.8372800994],[3.4841E-5,4.7881254926,13362.4497067992]],[[.00217310991,6.04472194776,3340.6124266998],[2.0976948E-4,3.14159265359,0],[1.2834709E-4,1.60810667915,6681.2248533996]]],[[[1.53033488271,0,0],[.1418495316,3.47971283528,3340.6124266998],[.00660776362,3.81783443019,6681.2248533996],[4.6179117E-4,4.15595316782,10021.8372800994], -[8.109733E-5,5.55958416318,2810.9214616052],[7.485318E-5,1.77239078402,5621.8429232104],[5.523191E-5,1.3643630377,2281.2304965106],[3.82516E-5,4.49407183687,13362.4497067992],[2.306537E-5,.09081579001,2544.3144198834],[1.999396E-5,5.36059617709,3337.0893083508],[2.484394E-5,4.9254563992,2942.4634232916],[1.960195E-5,4.74249437639,3344.1355450488],[1.167119E-5,2.11260868341,5092.1519581158],[1.102816E-5,5.00908403998,398.1490034082],[8.99066E-6,4.40791133207,529.6909650946],[9.92252E-6,5.83861961952, -6151.533888305],[8.07354E-6,2.10217065501,1059.3819301892],[7.97915E-6,3.44839203899,796.2980068164],[7.40975E-6,1.49906336885,2146.1654164752]],[[.01107433345,2.03250524857,3340.6124266998],[.00103175887,2.37071847807,6681.2248533996],[1.28772E-4,0,0],[1.081588E-4,2.70888095665,10021.8372800994]],[[4.4242249E-4,.47930604954,3340.6124266998],[8.138042E-5,.86998389204,6681.2248533996]]]],Jupiter:[[[[.59954691494,0,0],[.09695898719,5.06191793158,529.6909650946],[.00573610142,1.44406205629,7.1135470008], -[.00306389205,5.41734730184,1059.3819301892],[9.7178296E-4,4.14264726552,632.7837393132],[7.2903078E-4,3.64042916389,522.5774180938],[6.4263975E-4,3.41145165351,103.0927742186],[3.9806064E-4,2.29376740788,419.4846438752],[3.8857767E-4,1.27231755835,316.3918696566],[2.7964629E-4,1.7845459182,536.8045120954],[1.358973E-4,5.7748104079,1589.0728952838],[8.246349E-5,3.5822792584,206.1855484372],[8.768704E-5,3.63000308199,949.1756089698],[7.368042E-5,5.0810119427,735.8765135318],[6.26315E-5,.02497628807, -213.299095438],[6.114062E-5,4.51319998626,1162.4747044078],[4.905396E-5,1.32084470588,110.2063212194],[5.305285E-5,1.30671216791,14.2270940016],[5.305441E-5,4.18625634012,1052.2683831884],[4.647248E-5,4.69958103684,3.9321532631],[3.045023E-5,4.31676431084,426.598190876],[2.609999E-5,1.56667394063,846.0828347512],[2.028191E-5,1.06376530715,3.1813937377],[1.764763E-5,2.14148655117,1066.49547719],[1.722972E-5,3.88036268267,1265.5674786264],[1.920945E-5,.97168196472,639.897286314],[1.633223E-5,3.58201833555, -515.463871093],[1.431999E-5,4.29685556046,625.6701923124],[9.73272E-6,4.09764549134,95.9792272178]],[[529.69096508814,0,0],[.00489503243,4.2208293947,529.6909650946],[.00228917222,6.02646855621,7.1135470008],[3.0099479E-4,4.54540782858,1059.3819301892],[2.072092E-4,5.45943156902,522.5774180938],[1.2103653E-4,.16994816098,536.8045120954],[6.067987E-5,4.42422292017,103.0927742186],[5.433968E-5,3.98480737746,419.4846438752],[4.237744E-5,5.89008707199,14.2270940016]],[[4.7233601E-4,4.32148536482,7.1135470008], -[3.0649436E-4,2.929777887,529.6909650946],[1.4837605E-4,3.14159265359,0]]],[[[.02268615702,3.55852606721,529.6909650946],[.00109971634,3.90809347197,1059.3819301892],[.00110090358,0,0],[8.101428E-5,3.60509572885,522.5774180938],[6.043996E-5,4.25883108339,1589.0728952838],[6.437782E-5,.30627119215,536.8045120954]],[[7.8203446E-4,1.52377859742,529.6909650946]]],[[[5.20887429326,0,0],[.25209327119,3.49108639871,529.6909650946],[.00610599976,3.84115365948,1059.3819301892],[.00282029458,2.57419881293, -632.7837393132],[.00187647346,2.07590383214,522.5774180938],[8.6792905E-4,.71001145545,419.4846438752],[7.2062974E-4,.21465724607,536.8045120954],[6.5517248E-4,5.9799588479,316.3918696566],[2.9134542E-4,1.67759379655,103.0927742186],[3.0135335E-4,2.16132003734,949.1756089698],[2.3453271E-4,3.54023522184,735.8765135318],[2.2283743E-4,4.19362594399,1589.0728952838],[2.3947298E-4,.2745803748,7.1135470008],[1.3032614E-4,2.96042965363,1162.4747044078],[9.70336E-5,1.90669633585,206.1855484372],[1.2749023E-4, -2.71550286592,1052.2683831884],[7.057931E-5,2.18184839926,1265.5674786264],[6.137703E-5,6.26418240033,846.0828347512],[2.616976E-5,2.00994012876,1581.959348283]],[[.0127180152,2.64937512894,529.6909650946],[6.1661816E-4,3.00076460387,1059.3819301892],[5.3443713E-4,3.89717383175,522.5774180938],[3.1185171E-4,4.88276958012,536.8045120954],[4.1390269E-4,0,0]]]],Saturn:[[[[.87401354025,0,0],[.11107659762,3.96205090159,213.299095438],[.01414150957,4.58581516874,7.1135470008],[.00398379389,.52112032699, -206.1855484372],[.00350769243,3.30329907896,426.598190876],[.00206816305,.24658372002,103.0927742186],[7.92713E-4,3.84007056878,220.4126424388],[2.3990355E-4,4.66976924553,110.2063212194],[1.6573588E-4,.43719228296,419.4846438752],[1.4906995E-4,5.76903183869,316.3918696566],[1.582029E-4,.93809155235,632.7837393132],[1.4609559E-4,1.56518472,3.9321532631],[1.3160301E-4,4.44891291899,14.2270940016],[1.5053543E-4,2.71669915667,639.897286314],[1.3005299E-4,5.98119023644,11.0457002639],[1.0725067E-4,3.12939523827, -202.2533951741],[5.863206E-5,.23656938524,529.6909650946],[5.227757E-5,4.20783365759,3.1813937377],[6.126317E-5,1.76328667907,277.0349937414],[5.019687E-5,3.17787728405,433.7117378768],[4.59255E-5,.61977744975,199.0720014364],[4.005867E-5,2.24479718502,63.7358983034],[2.953796E-5,.98280366998,95.9792272178],[3.87367E-5,3.22283226966,138.5174968707],[2.461186E-5,2.03163875071,735.8765135318],[3.269484E-5,.77492638211,949.1756089698],[1.758145E-5,3.2658010994,522.5774180938],[1.640172E-5,5.5050445305, -846.0828347512],[1.391327E-5,4.02333150505,323.5054166574],[1.580648E-5,4.37265307169,309.2783226558],[1.123498E-5,2.83726798446,415.5524906121],[1.017275E-5,3.71700135395,227.5261894396],[8.48642E-6,3.1915017083,209.3669421749]],[[213.2990952169,0,0],[.01297370862,1.82834923978,213.299095438],[.00564345393,2.88499717272,7.1135470008],[9.3734369E-4,1.06311793502,426.598190876],[.00107674962,2.27769131009,206.1855484372],[4.0244455E-4,2.04108104671,220.4126424388],[1.9941774E-4,1.2795439047,103.0927742186], -[1.0511678E-4,2.7488034213,14.2270940016],[6.416106E-5,.38238295041,639.897286314],[4.848994E-5,2.43037610229,419.4846438752],[4.056892E-5,2.92133209468,110.2063212194],[3.768635E-5,3.6496533078,3.9321532631]],[[.0011644133,1.17988132879,7.1135470008],[9.1841837E-4,.0732519584,213.299095438],[3.6661728E-4,0,0],[1.5274496E-4,4.06493179167,206.1855484372]]],[[[.04330678039,3.60284428399,213.299095438],[.00240348302,2.85238489373,426.598190876],[8.4745939E-4,0,0],[3.0863357E-4,3.48441504555,220.4126424388], -[3.4116062E-4,.57297307557,206.1855484372],[1.473407E-4,2.11846596715,639.897286314],[9.916667E-5,5.79003188904,419.4846438752],[6.993564E-5,4.7360468972,7.1135470008],[4.807588E-5,5.43305312061,316.3918696566]],[[.00198927992,4.93901017903,213.299095438],[3.6947916E-4,3.14159265359,0],[1.7966989E-4,.5197943111,426.598190876]]],[[[9.55758135486,0,0],[.52921382865,2.39226219573,213.299095438],[.01873679867,5.2354960466,206.1855484372],[.01464663929,1.64763042902,426.598190876],[.00821891141,5.93520042303, -316.3918696566],[.00547506923,5.0153261898,103.0927742186],[.0037168465,2.27114821115,220.4126424388],[.00361778765,3.13904301847,7.1135470008],[.00140617506,5.70406606781,632.7837393132],[.00108974848,3.29313390175,110.2063212194],[6.9006962E-4,5.94099540992,419.4846438752],[6.1053367E-4,.94037691801,639.897286314],[4.8913294E-4,1.55733638681,202.2533951741],[3.4143772E-4,.19519102597,277.0349937414],[3.2401773E-4,5.47084567016,949.1756089698],[2.0936596E-4,.46349251129,735.8765135318],[9.796004E-5, -5.20477537945,1265.5674786264],[1.1993338E-4,5.98050967385,846.0828347512],[2.08393E-4,1.52102476129,433.7117378768],[1.5298404E-4,3.0594381494,529.6909650946],[6.465823E-5,.17732249942,1052.2683831884],[1.1380257E-4,1.7310542704,522.5774180938],[3.419618E-5,4.94550542171,1581.959348283]],[[.0618298134,.2584351148,213.299095438],[.00506577242,.71114625261,206.1855484372],[.00341394029,5.79635741658,426.598190876],[.00188491195,.47215589652,220.4126424388],[.00186261486,3.14159265359,0],[.00143891146, -1.40744822888,7.1135470008]],[[.00436902572,4.78671677509,213.299095438]]]],Uranus:[[[[5.48129294297,0,0],[.09260408234,.89106421507,74.7815985673],[.01504247898,3.6271926092,1.4844727083],[.00365981674,1.89962179044,73.297125859],[.00272328168,3.35823706307,149.5631971346],[7.0328461E-4,5.39254450063,63.7358983034],[6.8892678E-4,6.09292483287,76.2660712756],[6.1998615E-4,2.26952066061,2.9689454166],[6.1950719E-4,2.85098872691,11.0457002639],[2.646877E-4,3.14152083966,71.8126531507],[2.5710476E-4, -6.11379840493,454.9093665273],[2.107885E-4,4.36059339067,148.0787244263],[1.7818647E-4,1.74436930289,36.6485629295],[1.4613507E-4,4.73732166022,3.9321532631],[1.1162509E-4,5.8268179635,224.3447957019],[1.099791E-4,.48865004018,138.5174968707],[9.527478E-5,2.95516862826,35.1640902212],[7.545601E-5,5.236265824,109.9456887885],[4.220241E-5,3.23328220918,70.8494453042],[4.0519E-5,2.277550173,151.0476698429],[3.354596E-5,1.0654900738,4.4534181249],[2.926718E-5,4.62903718891,9.5612275556],[3.49034E-5,5.48306144511, -146.594251718],[3.144069E-5,4.75199570434,77.7505439839],[2.922333E-5,5.35235361027,85.8272988312],[2.272788E-5,4.36600400036,70.3281804424],[2.051219E-5,1.51773566586,.1118745846],[2.148602E-5,.60745949945,38.1330356378],[1.991643E-5,4.92437588682,277.0349937414],[1.376226E-5,2.04283539351,65.2203710117],[1.666902E-5,3.62744066769,380.12776796],[1.284107E-5,3.11347961505,202.2533951741],[1.150429E-5,.93343589092,3.1813937377],[1.533221E-5,2.58594681212,52.6901980395],[1.281604E-5,.54271272721,222.8603229936], -[1.372139E-5,4.19641530878,111.4301614968],[1.221029E-5,.1990065003,108.4612160802],[9.46181E-6,1.19253165736,127.4717966068],[1.150989E-5,4.17898916639,33.6796175129]],[[74.7815986091,0,0],[.00154332863,5.24158770553,74.7815985673],[2.4456474E-4,1.71260334156,1.4844727083],[9.258442E-5,.4282973235,11.0457002639],[8.265977E-5,1.50218091379,63.7358983034],[9.15016E-5,1.41213765216,149.5631971346]]],[[[.01346277648,2.61877810547,74.7815985673],[6.23414E-4,5.08111189648,149.5631971346],[6.1601196E-4, -3.14159265359,0],[9.963722E-5,1.61603805646,76.2660712756],[9.92616E-5,.57630380333,73.297125859]],[[3.4101978E-4,.01321929936,74.7815985673]]],[[[19.21264847206,0,0],[.88784984413,5.60377527014,74.7815985673],[.03440836062,.32836099706,73.297125859],[.0205565386,1.7829515933,149.5631971346],[.0064932241,4.52247285911,76.2660712756],[.00602247865,3.86003823674,63.7358983034],[.00496404167,1.40139935333,454.9093665273],[.00338525369,1.58002770318,138.5174968707],[.00243509114,1.57086606044,71.8126531507], -[.00190522303,1.99809394714,1.4844727083],[.00161858838,2.79137786799,148.0787244263],[.00143706183,1.38368544947,11.0457002639],[9.3192405E-4,.17437220467,36.6485629295],[7.1424548E-4,4.24509236074,224.3447957019],[8.9806014E-4,3.66105364565,109.9456887885],[3.9009723E-4,1.66971401684,70.8494453042],[4.6677296E-4,1.39976401694,35.1640902212],[3.9025624E-4,3.36234773834,277.0349937414],[3.6755274E-4,3.88649278513,146.594251718],[3.0348723E-4,.70100838798,151.0476698429],[2.9156413E-4,3.180563367, -77.7505439839],[2.2637073E-4,.72518687029,529.6909650946],[1.1959076E-4,1.7504339214,984.6003316219],[2.5620756E-4,5.25656086672,380.12776796]],[[.01479896629,3.67205697578,74.7815985673]]]],Neptune:[[[[5.31188633046,0,0],[.0179847553,2.9010127389,38.1330356378],[.01019727652,.48580922867,1.4844727083],[.00124531845,4.83008090676,36.6485629295],[4.2064466E-4,5.41054993053,2.9689454166],[3.7714584E-4,6.09221808686,35.1640902212],[3.3784738E-4,1.24488874087,76.2660712756],[1.6482741E-4,7.727998E-5, -491.5579294568],[9.198584E-5,4.93747051954,39.6175083461],[8.99425E-5,.27462171806,175.1660598002]],[[38.13303563957,0,0],[1.6604172E-4,4.86323329249,1.4844727083],[1.5744045E-4,2.27887427527,38.1330356378]]],[[[.03088622933,1.44104372644,38.1330356378],[2.7780087E-4,5.91271884599,76.2660712756],[2.7623609E-4,0,0],[1.5355489E-4,2.52123799551,36.6485629295],[1.5448133E-4,3.50877079215,39.6175083461]]],[[[30.07013205828,0,0],[.27062259632,1.32999459377,38.1330356378],[.01691764014,3.25186135653,36.6485629295], -[.00807830553,5.18592878704,1.4844727083],[.0053776051,4.52113935896,35.1640902212],[.00495725141,1.5710564165,491.5579294568],[.00274571975,1.84552258866,175.1660598002],[1.201232E-4,1.92059384991,1021.2488945514],[.00121801746,5.79754470298,76.2660712756],[.00100896068,.3770272493,73.297125859],[.00135134092,3.37220609835,39.6175083461],[7.571796E-5,1.07149207335,388.4651552382]]]]},ma={Pluto:[{tt:-109573.5,ndays:22873.4,coeff:[[-38.379127948969,-15.540131600164,6.713024498471],[14.305366595998, --27.805310343824,-12.981888636985],[7.92543601413,3.90369116971,-1.168958644595],[-.442101048338,1.685913511618,.659210430825],[-.373216809055,-.063688373891,.09326048306],[-.009972684884,-.081495131522,-.021987413967],[.018367454594,-.004930958318,-.007352983738],[.003427373209,.005473507308,.001034839203],[-.001351484381,.001104099542,6.8778874E-4],[5.7615664E-5,9.46156502E-4,5.07901883E-4],[-.002112022612,6.29887022E-4,3.15500774E-4],[-5.11474378E-4,-.001320928726,-5.62497776E-4],[-1.98663925E-4, -6.8936041E-5,3.6709195E-5],[-5.40552292E-4,-.001503978652,-6.30773819E-4],[.002437160925,-7.63631463E-4,-3.87861693E-4],[8.16305566E-4,.0022053374,9.25670951E-4],[-.002021926086,6.22387047E-4,3.16528605E-4],[-5.05895596E-4,-.00120561281,-5.04580853E-4],[.00112639953,-3.61584688E-4,-1.8281778E-4]]},{tt:-86700.1,ndays:22873.4,coeff:[[55.447823115293,-27.26640657528,-25.207542726969],[21.019137449061,20.342364979145,.014098785243],[-4.74970160852,2.918129180139,2.342054849317],[-.152026133726,-.860351920073, --.222763626308],[.103419154134,.07573598087,-.007005683084],[-.022470674224,.003007617977,.007032450935],[.001163669493,-.003189922026,-.00162464862],[-.001137731669,2.62288216E-4,3.8087641E-5],[4.3103328E-5,-5.3509763E-4,-2.06619902E-4],[-.001261838718,3.04538227E-4,1.56262972E-4],[-3.86936271E-4,-.002058845083,-8.71353485E-4],[.001504572723,-2.67222447E-4,-1.51193739E-4],[6.9990356E-5,-1.84521171E-4,-8.1257481E-5],[.001713840868,-2.27638497E-4,-1.39809761E-4],[3.80695392E-4,.002350810217,9.98895521E-4], -[-.002512724805,3.68540417E-4,2.1974477E-4],[-3.57746385E-4,-.001951245887,-8.27980927E-4],[.001367155227,-1.2706759E-4,-8.800842E-5],[1.73137697E-4,.00108470877,4.60942958E-4]]},{tt:-63826.8,ndays:22873.4,coeff:[[69.634036499141,57.372230785853,-3.077375595621],[-12.411985665793,17.572931987772,9.221186946545],[-3.0908312584,-2.512294626088,.146706800235],[.21836223463,-.226221283768,-.1364778982],[8.80517265E-4,.010681097884,.002725741572],[-.001291221881,-.003106227879,-.001273733378],[-5.00284392E-4, --.001446751396,-6.35982028E-4],[.001105591622,-.001683856224,-7.68604544E-4],[9.38522644E-4,5.05869572E-4,1.86404007E-4],[-2.11177024E-4,-.001065799522,-4.46266661E-4],[.002134035294,-2.965848E-5,-6.3643319E-5],[3.5325265E-5,.001388374194,5.92202743E-4],[1.16349193E-4,6.1976724E-5,2.3376874E-5],[-7.2445415E-5,.001636213289,7.04241568E-4],[-.00257574516,-1.05513632E-4,1.7803397E-5],[7.2226632E-5,-.002387946399,-.001025976586],[.002194786367,7.253094E-5,-2.2483321E-5],[-5.3247082E-5,.001177229455,5.06221758E-4], -[-.001172329523,-4.5691921E-5,8.994465E-6]]},{tt:-40953.4,ndays:22873.4,coeff:[[-8.991435374359,72.522929925849,25.335167039777],[-23.717658611798,-11.790452911233,3.467137945519],[.826017751998,-4.641123526666,-1.697326777915],[.560746056871,-.090150086821,-.197072243469],[.053367643147,.030287157582,-.006883260629],[.004886534342,.006021189196,3.75548379E-4],[.001517320916,-4.31833409E-4,-3.66094177E-4],[.002577336038,.001237262625,4.56269058E-4],[-6.69267838E-4,.00116915309,5.26044269E-4],[9.41669987E-4, -5.2324731E-5,6.451966E-6],[-3.08122555E-4,.001907421829,8.24565883E-4],[-.001450786896,-2.41544461E-4,-6.9557948E-5],[-2.1044193E-5,1.76079825E-4,7.6920928E-5],[-.001711364848,-4.0687798E-4,-1.32083416E-4],[5.50039252E-4,-.002319991661,-.001008513611],[.002503893667,5.58897059E-4,1.78233903E-4],[-4.87607379E-4,.001932237958,8.40475179E-4],[-.001325885344,-2.11156037E-4,-5.8139585E-5],[2.3697721E-4,-.001063738969,-4.61951831E-4]]},{tt:-18080,ndays:22873.4,coeff:[[-36.087786489549,-19.321019448663, -4.842126256045],[16.674527202393,-26.439741396846,-13.273510277928],[7.640949973276,4.666665369749,-.845879718769],[-.675046527214,1.618348207499,.708326066983],[-.374519038689,-.128911510322,.072787764393],[.008450995489,-.086316399102,-.029607183244],[.023560644312,.001433948061,-.005972909639],[1.23688589E-4,.008108170319,.002548003443],[-.002730297048,-3.9481707E-5,3.90047845E-4],[-5.77835152E-4,3.77966419E-4,2.71660666E-4],[-.001872062542,-8.07048678E-4,-3.23879099E-4],[5.47521881E-4,-.001220942947, --5.46774321E-4],[-2.38935039E-4,-1.36260249E-4,-4.7363292E-5],[6.86748774E-4,-.001467331313,-6.44194239E-4],[.002396569437,9.52782447E-4,3.4755804E-4],[-9.69645524E-4,.002136243261,9.38808719E-4],[-.00197156823,-7.68658104E-4,-2.8052153E-4],[5.50474324E-4,-.001191027208,-5.23701526E-4],[.001103417783,4.33385295E-4,1.58034752E-4]]},{tt:4793.4,ndays:22873.4,coeff:[[58.755369508116,-24.2646689693,-25.275084172155],[19.497987169479,21.276853294102,.764723273399],[-4.823126413932,2.498256389201,2.232355462314], -[-.08614098399,-.813675478819,-.227988579141],[.085311207859,.074538364204,-.002854595841],[-.01705162038,-.002540894346,.004208292723],[.002769861771,-1.4329185E-5,-4.77592398E-4],[-.002551661001,6.9089826E-5,4.6330164E-5],[6.9355992E-5,-.001265302658,-5.03662137E-4],[-7.39467933E-4,-6.80968125E-4,-2.81115427E-4],[.001236770708,-.001567842762,-7.03898847E-4],[.001243060414,7.31613032E-4,2.83816485E-4],[1.74026399E-4,-9.3710964E-5,-4.4485803E-5],[.001493473235,9.02078907E-4,3.5003227E-4],[-.001429402935, -.001976479349,8.82105392E-4],[-.002183986564,-.001289554847,-4.9947593E-4],[.001157663206,-.001681190457,-7.48793883E-4],[.001077037844,7.20659055E-4,2.82739654E-4],[-6.50786278E-4,8.98878141E-4,4.01222494E-4]]},{tt:27666.8,ndays:22873.4,coeff:[[67.691164156698,60.055690812059,-1.653713469469],[-13.392561842793,16.736135121408,9.258008571303],[-2.979947432205,-2.623400069241,.078535157634],[.221140466168,-.219668370791,-.134946210351],[.002253370723,.006150902785,7.41705969E-4],[.003786183572,-.002028669517, --.001070817054],[-7.29683667E-4,.001185908944,4.59456376E-4],[2.14692528E-4,-.001514035337,-6.28903034E-4],[7.99410963E-4,1.14168654E-4,3.4870976E-5],[.001014080744,-7.07640463E-4,-3.3251734E-4],[.001555070571,.001399146449,5.60894218E-4],[-.001017832289,9.98745218E-4,4.51886947E-4],[1.05798659E-4,9.1126421E-5,3.6516053E-5],[-.0012650908,.001163905877,5.30521482E-4],[-.001874934335,-.001660517639,-6.65989341E-4],[.001807826027,-.001705845177,-7.75290385E-4],[.001582901643,.001412609292,5.6689363E-4], -[-8.63192985E-4,8.74901432E-4,3.96000392E-4],[-8.59691105E-4,-7.4306499E-4,-2.97495435E-4]]},{tt:50540.1,ndays:22873.4,coeff:[[-12.469752090089,70.481525173143,25.755334377455],[-23.370842315291,-13.264547442851,2.902657719838],[1.110867958719,-4.67270866565,-1.792706614402],[.596571797676,-.066313898032,-.200285819643],[.060080579048,.035889468333,-.006426562076],[.006591799109,.011099902718,.002309289562],[-9.68324396E-4,.001898382496,7.40088714E-4],[5.23251649E-4,8.12554121E-4,3.83725061E-4],[-3.19832676E-4, -1.99016237E-4,9.6616884E-5],[7.82553114E-4,.001015845568,4.12740772E-4],[-.00180181981,.001254101038,5.81678095E-4],[-9.05307447E-4,-.001101496166,-4.49936776E-4],[-1.83981908E-4,1.44296441E-4,6.71345E-5],[-.001000404967,-.001338920106,-5.49210134E-4],[.002108795205,-.001386328192,-6.45830667E-4],[.001472529436,.001926033725,7.8947952E-4],[-.001749726932,.001130345906,5.2704357E-4],[-8.62478053E-4,-.001013136301,-4.13188733E-4],[9.581099E-4,-6.47958487E-4,-3.00786397E-4]]}]};d.DeltaT_EspenakMeeus= -function(a){var b=2E3+(a-14)/365.24217;if(-500>b)return a=(b-1820)/100,-20+32*a*a;if(500>b){a=b/100;b=a*a;var c=a*b;return 10583.6-1014.41*a+33.78311*b-5.952053*c-.1798452*b*b+.022174192*b*c+.0090316521*c*c}if(1600>b)return a=(b-1E3)/100,b=a*a,c=a*b,1574.2-556.01*a+71.23472*b+.319781*c-.8503463*b*b-.005050998*b*c+.0083572073*c*c;if(1700>b)return a=b-1600,b=a*a,120-.9808*a-.01532*b+a*b/7129;if(1800>b)return a=b-1700,b=a*a,8.83+.1603*a-.0059285*b+1.3336E-4*a*b-b*b/1174E3;if(1860>b){a=b-1800;b=a*a;c= -a*b;var e=b*b;return 13.72-.332447*a+.0068612*b+.0041116*c-3.7436E-4*e+1.21272E-5*b*c-1.699E-7*c*c+8.75E-10*c*e}if(1900>b)return a=b-1860,b=a*a,c=a*b,7.62+.5737*a-.251754*b+.01680668*c-4.473624E-4*b*b+b*c/233174;if(1920>b)return a=b-1900,b=a*a,-2.79+1.494119*a-.0598939*b+.0061966*a*b-1.97E-4*b*b;if(1941>b)return a=b-1920,b=a*a,21.2+.84493*a-.0761*b+.0020936*a*b;if(1961>b)return a=b-1950,b=a*a,29.07+.407*a-b/233+a*b/2547;if(1986>b)return a=b-1975,b=a*a,45.45+1.067*a-b/260-a*b/718;if(2005>b)return a= -b-2E3,b=a*a,c=a*b,63.86+.3345*a-.060374*b+.0017275*c+6.51814E-4*b*b+2.373599E-5*b*c;if(2050>b)return a=b-2E3,62.92+.32217*a+.005589*a*a;if(2150>b)return a=(b-1820)/100,-20+32*a*a-.5628*(2150-b);a=(b-1820)/100;return-20+32*a*a};d.DeltaT_JplHorizons=function(a){return d.DeltaT_EspenakMeeus(Math.min(a,17*365.24217))};var da=d.DeltaT_EspenakMeeus;d.SetDeltaTFunction=function(a){da=a};var x=function(a){if(a instanceof Date)this.date=a,this.ut=(a-ba)/864E5,this.tt=A(this.ut);else if("number"===typeof a)this.date= -new Date(ba-864E5*-a),this.ut=a,this.tt=A(this.ut);else throw"Argument must be a Date object, an AstroTime object, or a numeric UTC Julian date.";};x.prototype.toString=function(){return this.date.toISOString()};x.prototype.AddDays=function(a){return new x(this.ut+a)};d.MakeTime=function(a){return a instanceof x?a:new x(a)};var ea=[{nals:[0,0,0,0,1],cls:[-172064161,-174666,33386,92052331,9086,15377]},{nals:[0,0,2,-2,2],cls:[-13170906,-1675,-13696,5730336,-3015,-4587]},{nals:[0,0,2,0,2],cls:[-2276413, --234,2796,978459,-485,1374]},{nals:[0,0,0,0,2],cls:[2074554,207,-698,-897492,470,-291]},{nals:[0,1,0,0,0],cls:[1475877,-3633,11817,73871,-184,-1924]},{nals:[0,1,2,-2,2],cls:[-516821,1226,-524,224386,-677,-174]},{nals:[1,0,0,0,0],cls:[711159,73,-872,-6750,0,358]},{nals:[0,0,2,0,1],cls:[-387298,-367,380,200728,18,318]},{nals:[1,0,2,0,2],cls:[-301461,-36,816,129025,-63,367]},{nals:[0,-1,2,-2,2],cls:[215829,-494,111,-95929,299,132]},{nals:[0,0,2,-2,1],cls:[128227,137,181,-68982,-9,39]},{nals:[-1,0,2, -0,2],cls:[123457,11,19,-53311,32,-4]},{nals:[-1,0,0,2,0],cls:[156994,10,-168,-1235,0,82]},{nals:[1,0,0,0,1],cls:[63110,63,27,-33228,0,-9]},{nals:[-1,0,0,0,1],cls:[-57976,-63,-189,31429,0,-75]},{nals:[-1,0,2,2,2],cls:[-59641,-11,149,25543,-11,66]},{nals:[1,0,2,0,1],cls:[-51613,-42,129,26366,0,78]},{nals:[-2,0,2,0,1],cls:[45893,50,31,-24236,-10,20]},{nals:[0,0,0,2,0],cls:[63384,11,-150,-1220,0,29]},{nals:[0,0,2,2,2],cls:[-38571,-1,158,16452,-11,68]},{nals:[0,-2,2,-2,2],cls:[32481,0,0,-13870,0,0]},{nals:[-2, -0,0,2,0],cls:[-47722,0,-18,477,0,-25]},{nals:[2,0,2,0,2],cls:[-31046,-1,131,13238,-11,59]},{nals:[1,0,2,-2,2],cls:[28593,0,-1,-12338,10,-3]},{nals:[-1,0,2,0,1],cls:[20441,21,10,-10758,0,-3]},{nals:[2,0,0,0,0],cls:[29243,0,-74,-609,0,13]},{nals:[0,0,2,0,0],cls:[25887,0,-66,-550,0,11]},{nals:[0,1,0,0,1],cls:[-14053,-25,79,8551,-2,-45]},{nals:[-1,0,0,2,1],cls:[15164,10,11,-8001,0,-1]},{nals:[0,2,2,-2,2],cls:[-15794,72,-16,6850,-42,-5]},{nals:[0,0,-2,2,0],cls:[21783,0,13,-167,0,13]},{nals:[1,0,0,-2,1], -cls:[-12873,-10,-37,6953,0,-14]},{nals:[0,-1,0,0,1],cls:[-12654,11,63,6415,0,26]},{nals:[-1,0,2,2,1],cls:[-10204,0,25,5222,0,15]},{nals:[0,2,0,0,0],cls:[16707,-85,-10,168,-1,10]},{nals:[1,0,2,2,2],cls:[-7691,0,44,3268,0,19]},{nals:[-2,0,2,0,0],cls:[-11024,0,-14,104,0,2]},{nals:[0,1,2,0,2],cls:[7566,-21,-11,-3250,0,-5]},{nals:[0,0,2,2,1],cls:[-6637,-11,25,3353,0,14]},{nals:[0,-1,2,0,2],cls:[-7141,21,8,3070,0,4]},{nals:[0,0,0,2,1],cls:[-6302,-11,2,3272,0,4]},{nals:[1,0,2,-2,1],cls:[5800,10,2,-3045, -0,-1]},{nals:[2,0,2,-2,2],cls:[6443,0,-7,-2768,0,-4]},{nals:[-2,0,0,2,1],cls:[-5774,-11,-15,3041,0,-5]},{nals:[2,0,2,0,1],cls:[-5350,0,21,2695,0,12]},{nals:[0,-1,2,-2,1],cls:[-4752,-11,-3,2719,0,-3]},{nals:[0,0,0,-2,1],cls:[-4940,-11,-21,2720,0,-9]},{nals:[-1,-1,0,2,0],cls:[7350,0,-8,-51,0,4]},{nals:[2,0,0,-2,1],cls:[4065,0,6,-2206,0,1]},{nals:[1,0,0,2,0],cls:[6579,0,-24,-199,0,2]},{nals:[0,1,2,-2,1],cls:[3579,0,5,-1900,0,1]},{nals:[1,-1,0,0,0],cls:[4725,0,-6,-41,0,3]},{nals:[-2,0,2,0,2],cls:[-3075, -0,-2,1313,0,-1]},{nals:[3,0,2,0,2],cls:[-2904,0,15,1233,0,7]},{nals:[0,-1,0,2,0],cls:[4348,0,-10,-81,0,2]},{nals:[1,-1,2,0,2],cls:[-2878,0,8,1232,0,4]},{nals:[0,0,0,1,0],cls:[-4230,0,5,-20,0,-2]},{nals:[-1,-1,2,2,2],cls:[-2819,0,7,1207,0,3]},{nals:[-1,0,2,0,0],cls:[-4056,0,5,40,0,-2]},{nals:[0,-1,2,2,2],cls:[-2647,0,11,1129,0,5]},{nals:[-2,0,0,0,1],cls:[-2294,0,-10,1266,0,-4]},{nals:[1,1,2,0,2],cls:[2481,0,-7,-1062,0,-3]},{nals:[2,0,0,0,1],cls:[2179,0,-2,-1129,0,-2]},{nals:[-1,1,0,1,0],cls:[3276, -0,1,-9,0,0]},{nals:[1,1,0,0,0],cls:[-3389,0,5,35,0,-2]},{nals:[1,0,2,0,0],cls:[3339,0,-13,-107,0,1]},{nals:[-1,0,2,-2,1],cls:[-1987,0,-6,1073,0,-2]},{nals:[1,0,0,0,2],cls:[-1981,0,0,854,0,0]},{nals:[-1,0,0,1,0],cls:[4026,0,-353,-553,0,-139]},{nals:[0,0,2,1,2],cls:[1660,0,-5,-710,0,-2]},{nals:[-1,0,2,4,2],cls:[-1521,0,9,647,0,4]},{nals:[-1,1,0,1,1],cls:[1314,0,0,-700,0,0]},{nals:[0,-2,2,-2,1],cls:[-1283,0,0,672,0,0]},{nals:[1,0,2,2,1],cls:[-1331,0,8,663,0,4]},{nals:[-2,0,2,2,2],cls:[1383,0,-2,-594, -0,-2]},{nals:[-1,0,0,0,2],cls:[1405,0,4,-610,0,2]},{nals:[1,1,2,-2,2],cls:[1290,0,0,-556,0,0]}],O;d.CalcMoonCount=0;var r=function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.t=e};r.prototype.Length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)};var U=function(a,b,c){this.lat=a;this.lon=b;this.dist=c};d.MakeSpherical=function(a,b,c){return new U(a,b,c)};var Z=function(a,b,c){this.ra=a;this.dec=b;this.dist=c},B=function(a){this.rot=a};d.MakeRotation=function(a){if(!oa(a))throw"Argument must be a [3][3] array of numbers"; -return new B(a)};var wa=function(a,b,c,e){this.azimuth=a;this.altitude=b;this.ra=c;this.dec=e},pa=function(a,b,c,e,d){this.ex=a;this.ey=b;this.ez=c;this.elat=e;this.elon=d};d.Horizon=function(a,b,c,e,g){a=d.MakeTime(a);var h=Math.sin(.017453292519943295*b.latitude),k=Math.cos(.017453292519943295*b.latitude),l=Math.sin(.017453292519943295*b.longitude),m=Math.cos(.017453292519943295*b.longitude);b=Math.sin(.017453292519943295*e);var f=Math.cos(.017453292519943295*e),n=Math.sin(.2617993877991494*c), -p=Math.cos(.2617993877991494*c),q=[k*m,k*l,h];h=[-h*m,-h*l,k];l=[l,-m,0];k=-15*Q(a);a=C(k,q);q=C(k,h);l=C(k,l);b=[f*p,f*n,b];n=b[0]*a[0]+b[1]*a[1]+b[2]*a[2];q=b[0]*q[0]+b[1]*q[1]+b[2]*q[2];l=b[0]*l[0]+b[1]*l[1]+b[2]*l[2];p=Math.sqrt(q*q+l*l);f=0;0f&&(f+=360),360<=f&&(f-=360));n=57.29577951308232*Math.atan2(p,n);p=e;if(g&&(e=n,g=d.Refraction(g,90-n),n-=g,0l;++l)g.push((b[l]-e*a[l])/q*c+a[l]*p);p=Math.sqrt(g[0]*g[0]+g[1]*g[1]);0c&&(c+=24),24<=c&&(c-=24)):c=0;p=57.29577951308232*Math.atan2(g[2],p)}return new wa(f,90-n,c,p)};var xa=function(a,b,c){this.latitude=a;this.longitude=b;this.height=c};d.MakeObserver=function(a,b,c){return new xa(a,b,c||0)};d.SunPosition=function(a){a=d.MakeTime(a).AddDays(-.005775518331089121);var b=w(t.Earth,a);b=P(0,[-b.x, --b.y,-b.z],a.tt);b=X(a,0,b);a=.017453292519943295*N(a).tobl;return ha(b[0],b[1],b[2],Math.cos(a),Math.sin(a))};d.Equator=function(a,b,c,e,g){b=d.MakeTime(b);var h=Q(b),k=.017453292519943295*c.latitude,l=Math.sin(k);k=Math.cos(k);var m=1/Math.sqrt(k*k+.9933056020041345*l*l),f=c.height/1E3,n=6378.1366*m+f;c=.017453292519943295*(15*h+c.longitude);c=X(b,-1,[n*k*Math.cos(c)/1.4959787069098932E8,n*k*Math.sin(c)/1.4959787069098932E8,(6335.438815127603*m+f)*l/1.4959787069098932E8]);c=P(b.tt,c,0);a=d.GeoVector(a, -b,g);a=[a.x-c[0],a.y-c[1],a.z-c[2]];if(!e)return fa(a);e=P(0,a,b.tt);e=X(b,0,e);return fa(e)};d.Ecliptic=function(a,b,c){void 0===T&&(T=.017453292519943295*N(d.MakeTime(ba)).mobl,ka=Math.cos(T),la=Math.sin(T));return ha(a,b,c,ka,la)};d.GeoMoon=function(a){a=d.MakeTime(a);var b=E(a),c=b.distance_au*Math.cos(b.geo_eclip_lat);b=[c*Math.cos(b.geo_eclip_lon),c*Math.sin(b.geo_eclip_lon),b.distance_au*Math.sin(b.geo_eclip_lat)];var e=.017453292519943295*D(a);c=Math.cos(e);e=Math.sin(e);b=P(a.tt,[b[0],b[1]* -c-b[2]*e,b[1]*e+b[2]*c],0);return new r(b[0],b[1],b[2],a)};d.HelioVector=function(a,b){b=d.MakeTime(b);if(a in t)return w(t[a],b);if(a in ma){a:{var c=$jscomp.makeIterator(ma[a]);for(a=c.next();!a.done;a=c.next()){a=a.value;var e=a.tt;var g=a.tt+a.ndays;e=(2*b.tt-(g+e))/(g-e);if(-1<=e&&1>=e){var h=[];for(g=0;3>g;++g){var k=1;var l=a.coeff[0][g];var m=e;l+=a.coeff[1][g]*m;for(c=2;cl;++l){g=d.HelioVector(a,k);c&&(e=w(t.Earth,k));h=new r(g.x-e.x,g.y-e.y,g.z-e.z,b);if("Sun"===a)return h;var m=b.AddDays(-h.Length()/173.1446326846693);g=Math.abs(m.tt-k.tt);if(1E-9>g)return h;k=m}throw"Light-travel time solver did not converge: dt="+g;};d.Search=function(a,b,c,e){var g=Math.abs((e&& -e.dt_tolerance_seconds||1)/86400),h=e&&e.init_f1||a(b),k=e&&e.init_f2||a(c),l,m=0;e=e&&e.iter_limit||20;for(var f=!0;;){if(++m>e)throw"Excessive iteration in Search()";var n=new x(b.ut+.5*(c.ut-b.ut)),p=n.ut-b.ut;if(Math.abs(p)(p.ut-b.ut)*(p.ut-c.ut)&&0>(r.ut-b.ut)*(r.ut-c.ut))){q=a(p); -var u=a(r);if(0>q&&0<=u){h=q;k=u;b=p;c=r;l=t;f=!1;continue}}}}if(0>h&&0<=l)c=n,k=l;else if(0>l&&0<=k)b=n,h=l;else return null}};d.SearchSunLongitude=function(a,b,c){b=d.MakeTime(b);c=b.AddDays(c);return d.Search(function(b){b=d.SunPosition(b);return F(b.elon-a)},b,c)};d.LongitudeFromSun=function(a,b){if("Earth"===a)throw"The Earth does not have a longitude as seen from itself.";b=d.MakeTime(b);a=d.GeoVector(a,b,!0);a=d.Ecliptic(a.x,a.y,a.z);b=d.GeoVector("Sun",b,!0);b=d.Ecliptic(b.x,b.y,b.z);for(b= -a.elon-b.elon;0>b;)b+=360;for(;360<=b;)b-=360;return b};d.AngleFromSun=function(a,b){if("Earth"==a)throw"The Earth does not have an angle as seen from itself.";var c=d.GeoVector("Sun",b,!0);a=d.GeoVector(a,b,!0);return v(c,a)};d.EclipticLongitude=function(a,b){if("Sun"===a)throw"Cannot calculate heliocentric longitude of the Sun.";a=d.HelioVector(a,b);return d.Ecliptic(a.x,a.y,a.z).elon};var ya=function(a,b,c,e,d,h,k,l){this.time=a;this.mag=b;this.phase_angle=c;this.phase_fraction=(1+Math.cos(.017453292519943295* -c))/2;this.helio_dist=e;this.geo_dist=d;this.gc=h;this.hc=k;this.ring_tilt=l};d.Illumination=function(a,b){if("Earth"===a)throw"The illumination of the Earth is not defined.";var c=d.MakeTime(b),e=w(t.Earth,c);if("Sun"===a){var g=new r(-e.x,-e.y,-e.z,c);b=new r(0,0,0,c);e=0}else"Moon"===a?(g=d.GeoMoon(c),b=new r(e.x+g.x,e.y+g.y,e.z+g.z,c)):(b=d.HelioVector(a,b),g=new r(b.x-e.x,b.y-e.y,b.z-e.z,c)),e=v(g,b);var h=g.Length(),k=b.Length(),l=null;if("Sun"===a)a=ua+5*Math.log10(h);else if("Moon"===a){a= -.017453292519943295*e;var m=a*a;a=-12.717+1.49*Math.abs(a)+.0431*m*m;a+=5*Math.log10(h/.002573570052980638*k)}else if("Saturn"===a)a=e,l=d.Ecliptic(g.x,g.y,g.z),m=.017453292519943295*l.elat,l=Math.asin(Math.sin(m)*Math.cos(.4897393881096089)-Math.cos(m)*Math.sin(.4897393881096089)*Math.sin(.017453292519943295*l.elon-.017453292519943295*(169.51+3.82E-5*c.tt))),m=Math.sin(Math.abs(l)),a=-9+.044*a+m*(-2.6+1.2*m)+5*Math.log10(k*h),l*=57.29577951308232;else{var f=m=0,n=0;switch(a){case "Mercury":a=-.6; -m=4.98;f=-4.88;n=3.02;break;case "Venus":163.6>e?(a=-4.47,m=1.03,f=.57,n=.13):(a=.98,m=-1.02);break;case "Mars":a=-1.52;m=1.6;break;case "Jupiter":a=-9.4;m=.5;break;case "Uranus":a=-7.19;m=.25;break;case "Neptune":a=-6.87;break;case "Pluto":a=-1;m=4;break;default:throw"VisualMagnitude: unsupported body "+a;}var p=e/100;a=a+p*(m+p*(f+p*n))+5*Math.log10(k*h)}return new ya(c,a,e,k,h,g,b,l)};d.SearchRelativeLongitude=function(a,b,c){function e(c){var e=d.EclipticLongitude(a,c);c=d.EclipticLongitude("Earth", -c);return F(h*(c-e)-b)}var g=z[a];if(!g)throw"Cannot search relative longitude because body is not a planet: "+a;if("Earth"===a)throw"Cannot search relative longitude for the Earth (it is always 0)";var h=g.OrbitalPeriod>z.Earth.OrbitalPeriod?1:-1;g=I(a);c=d.MakeTime(c);var k=e(c);0l;++l){var m=-k/360*g;c=c.AddDays(m);if(1>86400*Math.abs(m))return c;m=k;k=e(c);30>Math.abs(m)&&m!==k&&(m/=m-k,.5m&&(g*=m))}throw"Relative longitude search failed to converge for "+a+ -" near "+c.toString()+" (error_angle = "+k+").";};d.MoonPhase=function(a){return d.LongitudeFromSun("Moon",a)};d.SearchMoonPhase=function(a,b,c){function e(b){b=d.MoonPhase(b);return F(b-a)}b=d.MakeTime(b);var g=e(b);0c)return null;c=Math.min(c,h+.9);g=b.AddDays(g);b=b.AddDays(c);return d.Search(e,g,b)};var za=function(a,b){this.quarter=a;this.time=b};d.SearchMoonQuarter=function(a){var b=d.MoonPhase(a);b=(Math.floor(b/90)+1)%4;return(a=d.SearchMoonPhase(90* -b,a,10))&&new za(b,a)};d.NextMoonQuarter=function(a){a=new Date(a.time.date.getTime()+5184E5);return d.SearchMoonQuarter(a)};d.SearchRiseSet=function(a,b,c,e,g){function h(e){var f=d.Equator(a,e,b,!0,!0);e=d.Horizon(e,b,f.ra,f.dec).altitude+k/f.dist*57.29577951308232+va;return c*e}var k={Sun:.0046504672612422675,Moon:1.1618480877914597E-5}[a]||0;if("Earth"===a)throw"Cannot find rise or set time of the Earth.";if(1===c){var l=12;var m=0}else if(-1===c)l=0,m=12;else throw"Astronomy.SearchRiseSet: Invalid direction parameter "+ -c+" -- must be +1 or -1";e=d.MakeTime(e);var f=h(e);var n;if(0=f&&0=e.ut+g)return null;p=f.time;f=h(f.time);n=h(q.time)}};var Aa=function(a,b){this.time=a;this.hor=b};d.SearchHourAngle=function(a,b,c,e){e=d.MakeTime(e);var g=0;if("Earth"===a)throw"Cannot search for hour angle of the Earth."; -if(0>c||24<=c)throw"Invalid hour angle "+c;for(;;){++g;var h=Q(e),k=d.Equator(a,e,b,!0,!0);h=(c+k.ra-b.longitude/15-h)%24;1===g?0>h&&(h+=24):-12>h?h+=24:123600*Math.abs(h))return a=d.Horizon(e,b,k.ra,k.dec,"normal"),new Aa(e,a);e=e.AddDays(h/24*.9972695717592592)}};var Ba=function(a,b,c,e){this.mar_equinox=a;this.jun_solstice=b;this.sep_equinox=c;this.dec_solstice=e};d.Seasons=function(a){function b(b,c,e){c=new Date(Date.UTC(a,c-1,e));b=d.SearchSunLongitude(b,c,4);if(!b)throw"Cannot find season change near "+ -c.toISOString();return b}a instanceof Date&&(a=a.getUTCFullYear());var c=b(0,3,19),e=b(90,6,19),g=b(180,9,21),h=b(270,12,20);return new Ba(c,e,g,h)};var Ca=function(a,b,c,e){this.time=a;this.visibility=b;this.elongation=c;this.ecliptic_separation=e};d.Elongation=function(a,b){b=d.MakeTime(b);var c=d.LongitudeFromSun(a,b);if(180=++g;){var h=d.EclipticLongitude(a,b),k=d.EclipticLongitude("Earth",b);k=F(h-k);var l=h=void 0,m=l=h=void 0;k>=-e.s1&&k<+e.s1?(m=0,h=+e.s1,l=+e.s2):k>=+e.s2||k<-e.s2?(m=0,h=-e.s2,l=-e.s1):0<=k?(m=-I(a)/4,h=+e.s1,l=+e.s2):(m=-I(a)/4,h=-e.s2,l=-e.s1);k=b.AddDays(m);h=d.SearchRelativeLongitude(a, -h,k);l=d.SearchRelativeLongitude(a,l,h);k=c(h);if(0<=k)throw"SearchMaxElongation: internal error: m1 = "+k;m=c(l);if(0>=m)throw"SearchMaxElongation: internal error: m2 = "+m;k=d.Search(c,h,l,{init_f1:k,init_f2:m,dt_tolerance_seconds:10});if(!k)throw"SearchMaxElongation: failed search iter "+g+" (t1="+h.toString()+", t2="+l.toString()+")";if(k.tt>=b.tt)return d.Elongation(a,k);b=l.AddDays(1)}throw"SearchMaxElongation: failed to find event after 2 tries.";};d.SearchPeakMagnitude=function(a,b){function c(b){var c= -b.AddDays(-.005);b=b.AddDays(.005);c=d.Illumination(a,c).mag;return(d.Illumination(a,b).mag-c)/.01}if("Venus"!==a)throw"SearchPeakMagnitude currently works for Venus only.";b=d.MakeTime(b);for(var e=0;2>=++e;){var g=d.EclipticLongitude(a,b),h=d.EclipticLongitude("Earth",b);h=F(g-h);var k=g=void 0,l=k=g=void 0;-10<=h&&10>h?(l=0,g=10,k=30):30<=h||-30>h?(l=0,g=-30,k=-10):0<=h?(l=-I(a)/4,g=10,k=30):(l=-I(a)/4,g=-30,k=-10);h=b.AddDays(l);g=d.SearchRelativeLongitude(a,g,h);k=d.SearchRelativeLongitude(a, -k,g);h=c(g);if(0<=h)throw"SearchPeakMagnitude: internal error: m1 = "+h;l=c(k);if(0>=l)throw"SearchPeakMagnitude: internal error: m2 = "+l;h=d.Search(c,g,k,{init_f1:h,init_f2:l,dt_tolerance_seconds:10});if(!h)throw"SearchPeakMagnitude: failed search iter "+e+" (t1="+g.toString()+", t2="+k.toString()+")";if(h.tt>=b.tt)return d.Illumination(a,h);b=k.AddDays(1)}throw"SearchPeakMagnitude: failed to find event after 2 tries.";};var S=function(a,b,c){this.time=a;this.kind=b;this.dist_au=c;this.dist_km= -1.4959787069098932E8*c};d.SearchLunarApsis=function(a){function b(a){var b=a.AddDays(-5E-4);a=a.AddDays(5E-4);b=E(b).distance_au;return(E(a).distance_au-b)/.001}function c(a){return-b(a)}a=d.MakeTime(a);for(var e=b(a),g=0;59.061176>5*g;++g){var h=a.AddDays(5),k=b(h);if(0>=e*k){if(0>e||0k){a=d.Search(c,a,h,{init_f1:-e,init_f2:-k});if(null== -a)throw"SearchLunarApsis INTERNAL ERROR: apogee search failed!";e=E(a).distance_au;return new S(a,1,e)}throw"SearchLunarApsis INTERNAL ERROR: cannot classify apsis event!";}a=h;e=k}throw"SearchLunarApsis INTERNAL ERROR: could not find apsis within 2 synodic months of start date.";};d.NextLunarApsis=function(a){var b=d.SearchLunarApsis(a.time.AddDays(11));if(1!==b.kind+a.kind)throw"NextLunarApsis INTERNAL ERROR: did not find alternating apogee/perigee: prev="+a.kind+" @ "+a.time.toString()+", next="+ -b.kind+" @ "+b.time.toString();return b};d.SearchPlanetApsis=function(a,b){function c(b){var c=b.AddDays(-5E-4);b=b.AddDays(5E-4);c=d.HelioDistance(a,c);return(d.HelioDistance(a,b)-c)/.001}function e(a){return-c(a)}if("Neptune"===a)return ra(b);for(var g=z[a].OrbitalPeriod,h=g/6,k=c(b),l=0;l*h<2*g;++l){var m=b.AddDays(h),f=c(m);if(0>=k*f){g=h=void 0;if(0>k||0f)h=e,g=1;else throw"Internal error with slopes in SearchPlanetApsis";b=d.Search(h,b,m,1);if(null==b)throw"Failed to find slope transition in planetary apsis search."; -k=d.HelioDistance(a,b);return new S(b,g,k)}b=m;k=f}throw"Internal error: should have found planetary apsis within 2 orbital periods.";};d.NextPlanetApsis=function(a,b){if(0!==b.kind&&1!==b.kind)throw"Invalid apsis kind: "+b.kind;var c=b.time.AddDays(.25*z[a].OrbitalPeriod);a=d.SearchPlanetApsis(a,c);if(1!==a.kind+b.kind)throw"Internal error: previous apsis was "+b.kind+", but found "+a.kind+" for next apsis.";return a};d.InverseRotation=function(a){return new B([[a.rot[0][0],a.rot[1][0],a.rot[2][0]], -[a.rot[0][1],a.rot[1][1],a.rot[2][1]],[a.rot[0][2],a.rot[1][2],a.rot[2][2]]])};d.CombineRotation=function(a,b){return new B([[b.rot[0][0]*a.rot[0][0]+b.rot[1][0]*a.rot[0][1]+b.rot[2][0]*a.rot[0][2],b.rot[0][1]*a.rot[0][0]+b.rot[1][1]*a.rot[0][1]+b.rot[2][1]*a.rot[0][2],b.rot[0][2]*a.rot[0][0]+b.rot[1][2]*a.rot[0][1]+b.rot[2][2]*a.rot[0][2]],[b.rot[0][0]*a.rot[1][0]+b.rot[1][0]*a.rot[1][1]+b.rot[2][0]*a.rot[1][2],b.rot[0][1]*a.rot[1][0]+b.rot[1][1]*a.rot[1][1]+b.rot[2][1]*a.rot[1][2],b.rot[0][2]*a.rot[1][0]+ -b.rot[1][2]*a.rot[1][1]+b.rot[2][2]*a.rot[1][2]],[b.rot[0][0]*a.rot[2][0]+b.rot[1][0]*a.rot[2][1]+b.rot[2][0]*a.rot[2][2],b.rot[0][1]*a.rot[2][0]+b.rot[1][1]*a.rot[2][1]+b.rot[2][1]*a.rot[2][2],b.rot[0][2]*a.rot[2][0]+b.rot[1][2]*a.rot[2][1]+b.rot[2][2]*a.rot[2][2]]])};d.VectorFromSphere=function(a,b){var c=.017453292519943295*a.lat,e=.017453292519943295*a.lon,d=a.dist*Math.cos(c);return new r(d*Math.cos(e),d*Math.sin(e),a.dist*Math.sin(c),b)};d.VectorFromEquator=function(a,b){return d.VectorFromSphere(new U(a.dec, -15*a.ra,a.dist),b)};d.EquatorFromVector=function(a){a=d.SphereFromVector(a);return new Z(a.lon/15,a.lat,a.dist)};d.SphereFromVector=function(a){var b=a.x*a.x+a.y*a.y,c=Math.sqrt(b+a.z*a.z);if(0===b){if(0===a.z)throw"Zero-length vector not allowed.";var e=0;a=0>a.z?-90:90}else e=57.29577951308232*Math.atan2(a.y,a.x),0>e&&(e+=360),a=57.29577951308232*Math.atan2(a.z,Math.sqrt(b));return new U(a,e,c)};d.HorizonFromVector=function(a,b){a=d.SphereFromVector(a);a.lon=ja(a.lon);a.lat+=d.Refraction(b,a.lat); -return a};d.VectorFromHorizon=function(a,b,c){var e=ja(a.lon);c=a.lat+d.InverseRefraction(c,a.lat);a=new U(c,e,a.dist);return d.VectorFromSphere(a,b)};d.Refraction=function(a,b){if(-90>b||90c&&(c=-1);c=1.02/Math.tan(.017453292519943295*(c+10.3/(c+5.11)))/60;"normal"===a&&-1>b&&(c*=(b+90)/89)}else c=0;return c};d.InverseRefraction=function(a,b){if(-90>b||90Math.abs(e))return c- -b;c-=e}};d.RotateVector=function(a,b){return new r(a.rot[0][0]*b.x+a.rot[1][0]*b.y+a.rot[2][0]*b.z,a.rot[0][1]*b.x+a.rot[1][1]*b.y+a.rot[2][1]*b.z,a.rot[0][2]*b.x+a.rot[1][2]*b.y+a.rot[2][2]*b.z,b.t)};d.Rotation_EQJ_ECL=function(){return new B([[1,0,0],[0,.9174821430670688,-.3977769691083922],[0,.3977769691083922,.9174821430670688]])};d.Rotation_ECL_EQJ=function(){return new B([[1,0,0],[0,.9174821430670688,.3977769691083922],[0,-.3977769691083922,.9174821430670688]])};d.Rotation_EQJ_EQD=function(a){var b= -W(0,a.tt);a=Y(a,0);return d.CombineRotation(b,a)};d.Rotation_EQD_EQJ=function(a){var b=Y(a,1);a=W(a.tt,0);return d.CombineRotation(b,a)};d.Rotation_EQD_HOR=function(a,b){var c=Math.sin(.017453292519943295*b.latitude),e=Math.cos(.017453292519943295*b.latitude),d=Math.sin(.017453292519943295*b.longitude),h=Math.cos(.017453292519943295*b.longitude);b=[e*h,e*d,c];c=[-c*h,-c*d,e];d=[d,-h,0];a=-15*Q(a);b=C(a,b);c=C(a,c);a=C(a,d);return new B([[c[0],a[0],b[0]],[c[1],a[1],b[1]],[c[2],a[2],b[2]]])};d.Rotation_HOR_EQD= -function(a,b){a=d.Rotation_EQD_HOR(a,b);return d.InverseRotation(a)};d.Rotation_HOR_EQJ=function(a,b){b=d.Rotation_HOR_EQD(a,b);a=d.Rotation_EQD_EQJ(a);return d.CombineRotation(b,a)};d.Rotation_EQJ_HOR=function(a,b){a=d.Rotation_HOR_EQJ(a,b);return d.InverseRotation(a)};d.Rotation_EQD_ECL=function(a){a=d.Rotation_EQD_EQJ(a);var b=d.Rotation_EQJ_ECL();return d.CombineRotation(a,b)};d.Rotation_ECL_EQD=function(a){a=d.Rotation_EQD_ECL(a);return d.InverseRotation(a)};d.Rotation_ECL_HOR=function(a,b){var c= -d.Rotation_ECL_EQD(a);a=d.Rotation_EQD_HOR(a,b);return d.CombineRotation(c,a)};d.Rotation_HOR_ECL=function(a,b){a=d.Rotation_ECL_HOR(a,b);return d.InverseRotation(a)};var Da=[["And","Andromeda"],["Ant","Antila"],["Aps","Apus"],["Aql","Aquila"],["Aqr","Aquarius"],["Ara","Ara"],["Ari","Aries"],["Aur","Auriga"],["Boo","Bootes"],["Cae","Caelum"],["Cam","Camelopardis"],["Cap","Capricornus"],["Car","Carina"],["Cas","Cassiopeia"],["Cen","Centaurus"],["Cep","Cepheus"],["Cet","Cetus"],["Cha","Chamaeleon"], -["Cir","Circinus"],["CMa","Canis Major"],["CMi","Canis Minor"],["Cnc","Cancer"],["Col","Columba"],["Com","Coma Berenices"],["CrA","Corona Australis"],["CrB","Corona Borealis"],["Crt","Crater"],["Cru","Crux"],["Crv","Corvus"],["CVn","Canes Venatici"],["Cyg","Cygnus"],["Del","Delphinus"],["Dor","Dorado"],["Dra","Draco"],["Equ","Equuleus"],["Eri","Eridanus"],["For","Fornax"],["Gem","Gemini"],["Gru","Grus"],["Her","Hercules"],["Hor","Horologium"],["Hya","Hydra"],["Hyi","Hydrus"],["Ind","Indus"],["Lac", -"Lacerta"],["Leo","Leo"],["Lep","Lepus"],["Lib","Libra"],["LMi","Leo Minor"],["Lup","Lupus"],["Lyn","Lynx"],["Lyr","Lyra"],["Men","Mensa"],["Mic","Microscopium"],["Mon","Monoceros"],["Mus","Musca"],["Nor","Norma"],["Oct","Octans"],["Oph","Ophiuchus"],["Ori","Orion"],["Pav","Pavo"],["Peg","Pegasus"],["Per","Perseus"],["Phe","Phoenix"],["Pic","Pictor"],["PsA","Pisces Austrinus"],["Psc","Pisces"],["Pup","Puppis"],["Pyx","Pyxis"],["Ret","Reticulum"],["Scl","Sculptor"],["Sco","Scorpius"],["Sct","Scutum"], -["Ser","Serpens"],["Sex","Sextans"],["Sge","Sagitta"],["Sgr","Sagittarius"],["Tau","Taurus"],["Tel","Telescopium"],["TrA","Triangulum Australe"],["Tri","Triangulum"],["Tuc","Tucana"],["UMa","Ursa Major"],["UMi","Ursa Minor"],["Vel","Vela"],["Vir","Virgo"],["Vol","Volans"],["Vul","Vulpecula"]],Ea=[[83,0,8640,2112],[83,2880,5220,2076],[83,7560,8280,2068],[83,6480,7560,2064],[15,0,2880,2040],[10,3300,3840,1968],[15,0,1800,1920],[10,3840,5220,1920],[83,6300,6480,1920],[33,7260,7560,1920],[15,0,1263,1848], -[10,4140,4890,1848],[83,5952,6300,1800],[15,7260,7440,1800],[10,2868,3300,1764],[33,3300,4080,1764],[83,4680,5952,1680],[13,1116,1230,1632],[33,7350,7440,1608],[33,4080,4320,1596],[15,0,120,1584],[83,5040,5640,1584],[15,8490,8640,1584],[33,4320,4860,1536],[33,4860,5190,1512],[15,8340,8490,1512],[10,2196,2520,1488],[33,7200,7350,1476],[15,7393.2,7416,1462],[10,2520,2868,1440],[82,2868,3030,1440],[33,7116,7200,1428],[15,7200,7393.2,1428],[15,8232,8340,1418],[13,0,876,1404],[33,6990,7116,1392],[13,612, -687,1380],[13,876,1116,1368],[10,1116,1140,1368],[15,8034,8232,1350],[10,1800,2196,1344],[82,5052,5190,1332],[33,5190,6990,1332],[10,1140,1200,1320],[15,7968,8034,1320],[15,7416,7908,1316],[13,0,612,1296],[50,2196,2340,1296],[82,4350,4860,1272],[33,5490,5670,1272],[15,7908,7968,1266],[10,1200,1800,1260],[13,8232,8400,1260],[33,5670,6120,1236],[62,735,906,1212],[33,6120,6564,1212],[13,0,492,1200],[62,492,600,1200],[50,2340,2448,1200],[13,8400,8640,1200],[82,4860,5052,1164],[13,0,402,1152],[13,8490, -8640,1152],[39,6543,6564,1140],[33,6564,6870,1140],[30,6870,6900,1140],[62,600,735,1128],[82,3030,3300,1128],[13,60,312,1104],[82,4320,4350,1080],[50,2448,2652,1068],[30,7887,7908,1056],[30,7875,7887,1050],[30,6900,6984,1044],[82,3300,3660,1008],[82,3660,3882,960],[8,5556,5670,960],[39,5670,5880,960],[50,3330,3450,954],[0,0,906,882],[62,906,924,882],[51,6969,6984,876],[62,1620,1689,864],[30,7824,7875,864],[44,7875,7920,864],[7,2352,2652,852],[50,2652,2790,852],[0,0,720,840],[44,7920,8214,840],[44, -8214,8232,828],[0,8232,8460,828],[62,924,978,816],[82,3882,3960,816],[29,4320,4440,816],[50,2790,3330,804],[48,3330,3558,804],[0,258,507,792],[8,5466,5556,792],[0,8460,8550,770],[29,4440,4770,768],[0,8550,8640,752],[29,5025,5052,738],[80,870,978,736],[62,978,1620,736],[7,1620,1710,720],[51,6543,6969,720],[82,3960,4320,696],[30,7080,7530,696],[7,1710,2118,684],[48,3558,3780,684],[29,4770,5025,684],[0,0,24,672],[80,507,600,672],[7,2118,2352,672],[37,2838,2880,672],[30,7530,7824,672],[30,6933,7080,660], -[80,690,870,654],[25,5820,5880,648],[8,5430,5466,624],[25,5466,5820,624],[51,6612,6792,624],[48,3870,3960,612],[51,6792,6933,612],[80,600,690,600],[66,258,306,570],[48,3780,3870,564],[87,7650,7710,564],[77,2052,2118,548],[0,24,51,528],[73,5730,5772,528],[37,2118,2238,516],[87,7140,7290,510],[87,6792,6930,506],[0,51,306,504],[87,7290,7404,492],[37,2811,2838,480],[87,7404,7650,468],[87,6930,7140,460],[6,1182,1212,456],[75,6792,6840,444],[59,2052,2076,432],[37,2238,2271,420],[75,6840,7140,388],[77,1788, -1920,384],[39,5730,5790,384],[75,7140,7290,378],[77,1662,1788,372],[77,1920,2016,372],[23,4620,4860,360],[39,6210,6570,344],[23,4272,4620,336],[37,2700,2811,324],[39,6030,6210,308],[61,0,51,300],[77,2016,2076,300],[37,2520,2700,300],[61,7602,7680,300],[37,2271,2496,288],[39,6570,6792,288],[31,7515,7578,284],[61,7578,7602,284],[45,4146,4272,264],[59,2247,2271,240],[37,2496,2520,240],[21,2811,2853,240],[61,8580,8640,240],[6,600,1182,238],[31,7251,7308,204],[8,4860,5430,192],[61,8190,8580,180],[21,2853, -3330,168],[45,3330,3870,168],[58,6570,6718.4,150],[3,6718.4,6792,150],[31,7500,7515,144],[20,2520,2526,132],[73,6570,6633,108],[39,5790,6030,96],[58,6570,6633,72],[61,7728,7800,66],[66,0,720,48],[73,6690,6792,48],[31,7308,7500,48],[34,7500,7680,48],[61,7680,7728,48],[61,7920,8190,48],[61,7800,7920,42],[20,2526,2592,36],[77,1290,1662,0],[59,1662,1680,0],[20,2592,2910,0],[85,5280,5430,0],[58,6420,6570,0],[16,954,1182,-42],[77,1182,1290,-42],[73,5430,5856,-78],[59,1680,1830,-96],[59,2100,2247,-96],[73, -6420,6468,-96],[73,6570,6690,-96],[3,6690,6792,-96],[66,8190,8580,-96],[45,3870,4146,-144],[85,4146,4260,-144],[66,0,120,-168],[66,8580,8640,-168],[85,5130,5280,-192],[58,5730,5856,-192],[3,7200,7392,-216],[4,7680,7872,-216],[58,6180,6468,-240],[54,2100,2910,-264],[35,1770,1830,-264],[59,1830,2100,-264],[41,2910,3012,-264],[74,3450,3870,-264],[85,4260,4620,-264],[58,6330,6360,-280],[3,6792,7200,-288.8],[35,1740,1770,-348],[4,7392,7680,-360],[73,6180,6570,-384],[72,6570,6792,-384],[41,3012,3090,-408], -[58,5856,5895,-438],[41,3090,3270,-456],[26,3870,3900,-456],[71,5856,5895,-462],[47,5640,5730,-480],[28,4530,4620,-528],[85,4620,5130,-528],[41,3270,3510,-576],[16,600,954,-585.2],[35,954,1350,-585.2],[26,3900,4260,-588],[28,4260,4530,-588],[47,5130,5370,-588],[58,5856,6030,-590],[16,0,600,-612],[11,7680,7872,-612],[4,7872,8580,-612],[16,8580,8640,-612],[41,3510,3690,-636],[35,1692,1740,-654],[46,1740,2202,-654],[11,7200,7680,-672],[41,3690,3810,-700],[41,4530,5370,-708],[47,5370,5640,-708],[71,5640, -5760,-708],[35,1650,1692,-720],[58,6030,6336,-720],[76,6336,6420,-720],[41,3810,3900,-748],[19,2202,2652,-792],[41,4410,4530,-792],[41,3900,4410,-840],[36,1260,1350,-864],[68,3012,3372,-882],[35,1536,1650,-888],[76,6420,6900,-888],[65,7680,8280,-888],[70,8280,8400,-888],[36,1080,1260,-950],[1,3372,3960,-954],[70,0,600,-960],[36,600,1080,-960],[35,1392,1536,-960],[70,8400,8640,-960],[14,5100,5370,-1008],[49,5640,5760,-1008],[71,5760,5911.5,-1008],[9,1740,1800,-1032],[22,1800,2370,-1032],[67,2880,3012, --1032],[35,1230,1392,-1056],[71,5911.5,6420,-1092],[24,6420,6900,-1092],[76,6900,7320,-1092],[53,7320,7680,-1092],[35,1080,1230,-1104],[9,1620,1740,-1116],[49,5520,5640,-1152],[63,0,840,-1156],[35,960,1080,-1176],[40,1470,1536,-1176],[9,1536,1620,-1176],[38,7680,7920,-1200],[67,2160,2880,-1218],[84,2880,2940,-1218],[35,870,960,-1224],[40,1380,1470,-1224],[63,0,660,-1236],[12,2160,2220,-1260],[84,2940,3042,-1272],[40,1260,1380,-1276],[32,1380,1440,-1276],[63,0,570,-1284],[35,780,870,-1296],[64,1620, -1800,-1296],[49,5418,5520,-1296],[84,3042,3180,-1308],[12,2220,2340,-1320],[14,4260,4620,-1320],[49,5100,5418,-1320],[56,5418,5520,-1320],[32,1440,1560,-1356],[84,3180,3960,-1356],[14,3960,4050,-1356],[5,6300,6480,-1368],[78,6480,7320,-1368],[38,7920,8400,-1368],[40,1152,1260,-1380],[64,1800,1980,-1380],[12,2340,2460,-1392],[63,0,480,-1404],[35,480,780,-1404],[63,8400,8640,-1404],[32,1560,1650,-1416],[56,5520,5911.5,-1440],[43,7320,7680,-1440],[64,1980,2160,-1464],[18,5460,5520,-1464],[5,5911.5,5970, --1464],[18,5370,5460,-1526],[5,5970,6030,-1526],[64,2160,2460,-1536],[12,2460,3252,-1536],[14,4050,4260,-1536],[27,4260,4620,-1536],[14,4620,5232,-1536],[18,4860,4920,-1560],[5,6030,6060,-1560],[40,780,1152,-1620],[69,1152,1650,-1620],[18,5310,5370,-1620],[5,6060,6300,-1620],[60,6300,6480,-1620],[81,7920,8400,-1620],[32,1650,2370,-1680],[18,4920,5310,-1680],[79,5310,6120,-1680],[81,0,480,-1800],[42,1260,1650,-1800],[86,2370,3252,-1800],[12,3252,4050,-1800],[55,4050,4920,-1800],[60,6480,7680,-1800], -[43,7680,8400,-1800],[81,8400,8640,-1800],[81,270,480,-1824],[42,0,1260,-1980],[17,2760,4920,-1980],[2,4920,6480,-1980],[52,1260,2760,-2040],[57,0,8640,-2160]],ca,na,Fa=function(a,b,c,e){this.symbol=a;this.name=b;this.ra1875=c;this.dec1875=e};d.Constellation=function(a,b){if(-90>b||90a&&(a+=24);ca||(ca=d.Rotation_EQJ_EQD(new x(-45655.74141261017)),na=new x(0));a=new Z(a,b,1);a=d.VectorFromEquator(a,na);a=d.RotateVector(ca,a);a=d.EquatorFromVector(a); -b=10/240;for(var c=b/15,e=$jscomp.makeIterator(Ea),g=e.next();!g.done;g=e.next()){g=g.value;var h=g[1]*c,k=g[2]*c;if(g[3]*b<=a.dec&&h<=a.ra&&a.rab;++b){var c= -d.SearchMoonPhase(180,a,40);if(null===c)throw"Cannot find full moon.";a=E(c);if(1.8>57.29577951308232*Math.abs(a.geo_eclip_lat)&&(a=ta(c),a.ra&&(a+=360);b=((c+.014506+((((-3.68E-8*b- +2.9956E-5)*b-4.4E-7)*b+1.3915817)*b+4612.156534)*b)/3600+a)%360/15;0>b&&(b+=24);return b}function X(a,b,c){a=Y(a,b);return[a.rot[0][0]*c[0]+a.rot[1][0]*c[1]+a.rot[2][0]*c[2],a.rot[0][1]*c[0]+a.rot[1][1]*c[1]+a.rot[2][1]*c[2],a.rot[0][2]*c[0]+a.rot[1][2]*c[1]+a.rot[2][2]*c[2]]}function Y(a,b){a=N(a);var c=.017453292519943295*a.mobl,d=.017453292519943295*a.tobl,e=4.84813681109536E-6*a.dpsi;a=Math.cos(c);c=Math.sin(c);var k=Math.cos(d),l=Math.sin(d);d=Math.cos(e);var g=Math.sin(e);e=-g*a;var m=-g*c, +f=g*k,n=d*a*k+c*l,p=d*c*k-a*l;g*=l;var q=d*a*l-c*k;a=d*c*l+a*k;return 0===b?new B([[d,f,g],[e,n,q],[m,p,a]]):new B([[d,e,m],[f,n,p],[g,q,a]])}function ra(a){if(!(a instanceof Array)||3!==a.length)return!1;for(var b=0;3>b;++b){if(!(a[b]instanceof Array)||3!==a[b].length)return!1;for(var c=0;3>c;++c)if("number"!==typeof a[b][c])return!1}return!0}function ha(a){var b=a[0]*a[0]+a[1]*a[1],c=Math.sqrt(b+a[2]*a[2]);if(0===b){if(0===a[2])throw"Indeterminate sky coordinates";return 0>a[2]?{ra:0,dec:-90,dist:c}: +{ra:0,dec:90,dist:c}}var d=Math.atan2(a[1],a[0])/.2617993877991494;0>d&&(d+=24);return new Z(d,Math.atan2(a[2],Math.sqrt(b))/.017453292519943295,c)}function D(a,b){var c=.017453292519943295*a;a=Math.cos(c);c=Math.sin(c);return[a*b[0]+c*b[1]+0*b[2],-c*b[0]+a*b[1]+0*b[2],0*b[0]+0*b[1]+1*b[2]]}function ia(a,b,c,d,e){var h=b*d+c*e;b=-b*e+c*d;c=Math.sqrt(a*a+h*h);d=0;0d&&(d+=360));return new sa(a,h,b,57.29577951308232*Math.atan2(b,c),d)}function F(a,b){var c= +1,d=0;a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;e=a.next()){var k=0;e=$jscomp.makeIterator(e.value);for(var l=e.next();!l.done;l=e.next())l=l.value,k+=l[0]*Math.cos(l[1]+b*l[2]);d+=c*k;c*=b}return d}function w(a,b){var c=b.tt/365250,d=[];a=$jscomp.makeIterator(a);for(var e=a.next();!e.done;e=a.next())d.push(F(e.value,c));c=d[2]*Math.cos(d[1]);d=[c*Math.cos(d[0]),c*Math.sin(d[0]),d[2]*Math.sin(d[1])];return new r(d[0]+4.4036E-7*d[1]-1.90919E-7*d[2],-4.79966E-7*d[0]+.917482137087*d[1]-.397776982902* +d[2],.397776982902*d[1]+.917482137087*d[2],b)}function Q(a,b,c,d){d/=d+333054.25318;b=w(t[c],b);a.x+=d*b.x;a.y+=d*b.y;a.z+=d*b.z}function ta(a,b,c,d,e){var h=(e+c)/2-d;c=(e-c)/2;if(0==h){if(0==c)return null;d=-d/c;if(-1>d||1=d)return null;e=Math.sqrt(d);d=(-c+e)/(2*h);e=(-c-e)/(2*h);if(-1<=d&&1>=d){if(-1<=e&&1>=e)return null}else if(-1<=e&&1>=e)d=e;else return null}return{x:d,t:a+d*b,df_dt:(2*h*d+c)/b}}function I(a){for(;-180>=a;)a+=360;for(;180l;++l){var g=b.AddDays(l*c);g=d*F(t.Neptune[2],g.tt/365250);if(0==l||g>k)e=l,k=g}b=b.AddDays((e-1)*c);c*= +2}}function ua(a){var b=a.AddDays(-30/360*z.Neptune.OrbitalPeriod),c=a.AddDays(.75*z.Neptune.OrbitalPeriod),d=b,e=b,k=-1,l=-1;c=(c.ut-b.ut)/99;for(var g=0;100>g;++g){var m=b.AddDays(g*c),f=F(t.Neptune[2],m.tt/365250);0===g?l=k=f:(f>l&&(l=f,e=m),f=a.tt)return e.time.tt>=a.tt&&e.time.tt=a.tt)return e;throw"Internal error: failed to find Neptune apsis.";}function ka(a){a=360-a;360<=a?a-=360: +0>a&&(a+=360);return a}function aa(a,b,c,d){var e=(d.x*c.x+d.y*c.y+d.z*c.z)/(d.x*d.x+d.y*d.y+d.z*d.z),k=e*d.x-c.x,l=e*d.y-c.y,g=e*d.z-c.z;return new va(b,e,1.4959787069098932E8*Math.sqrt(k*k+l*l+g*g),695700-(1+e)*(695700-a),-695700+(1+e)*(695700+a),c,d)}function S(a){var b=w(t.Earth,a),c=e.GeoMoon(a);return aa(6459,a,c,b)}function la(a){var b=w(t.Earth,a),c=e.GeoMoon(a),d=new r(-c.x,-c.y,-c.z,c.t);c.x+=b.x;c.y+=b.y;c.z+=b.z;return aa(1737.4,a,d,c)}function ma(a,b){var c=1/86400,d=b.AddDays(-c);b= +b.AddDays(+c);d=a(d);return(a(b).r-d.r)/c}function wa(a){var b=a.AddDays(-.03);a=a.AddDays(.03);b=e.Search(function(a){return ma(S,a)},b,a,1);return S(b)}function xa(a){var b=a.AddDays(-.03);a=a.AddDays(.03);b=e.Search(function(a){return ma(la,a)},b,a,1);return la(b)}function ba(a,b,c){var d=c/1440;c=a.AddDays(-d);d=a.AddDays(+d);c=e.Search(function(a){return-(S(a).r-b)},c,a,1);a=e.Search(function(a){return+(S(a).r-b)},a,d,1);if(null===c||null===a)throw"Failed to find shadow semiduration";return 720* +(a.ut-c.ut)}var ca=new Date("2000-01-01T12:00:00Z"),H=2*Math.PI,J=180/Math.PI*3600,ya=-.17-5*Math.log10(648E3/Math.PI),za=34/60,T,na,oa;e.Bodies="Sun Moon Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto SSB EMB".split(" ");var z={Mercury:{OrbitalPeriod:87.969},Venus:{OrbitalPeriod:224.701},Earth:{OrbitalPeriod:365.256},Mars:{OrbitalPeriod:686.98},Jupiter:{OrbitalPeriod:4332.589},Saturn:{OrbitalPeriod:10759.22},Uranus:{OrbitalPeriod:30685.4},Neptune:{OrbitalPeriod:60189},Pluto:{OrbitalPeriod:90560}}, +t={Mercury:[[[[4.40250710144,0,0],[.40989414977,1.48302034195,26087.9031415742],[.050462942,4.47785489551,52175.8062831484],[.00855346844,1.16520322459,78263.70942472259],[.00165590362,4.11969163423,104351.61256629678],[3.4561897E-4,.77930768443,130439.51570787099],[7.583476E-5,3.71348404924,156527.41884944518]],[[26087.90313685529,0,0],[.01131199811,6.21874197797,26087.9031415742],[.00292242298,3.04449355541,52175.8062831484],[7.5775081E-4,6.08568821653,78263.70942472259],[1.9676525E-4,2.80965111777, +104351.61256629678]]],[[[.11737528961,1.98357498767,26087.9031415742],[.02388076996,5.03738959686,52175.8062831484],[.01222839532,3.14159265359,0],[.0054325181,1.79644363964,78263.70942472259],[.0012977877,4.83232503958,104351.61256629678],[3.1866927E-4,1.58088495658,130439.51570787099],[7.963301E-5,4.60972126127,156527.41884944518]],[[.00274646065,3.95008450011,26087.9031415742],[9.9737713E-4,3.14159265359,0]]],[[[.39528271651,0,0],[.07834131818,6.19233722598,26087.9031415742],[.00795525558,2.95989690104, +52175.8062831484],[.00121281764,6.01064153797,78263.70942472259],[2.1921969E-4,2.77820093972,104351.61256629678],[4.354065E-5,5.82894543774,130439.51570787099]],[[.0021734774,4.65617158665,26087.9031415742],[4.4141826E-4,1.42385544001,52175.8062831484]]]],Venus:[[[[3.17614666774,0,0],[.01353968419,5.59313319619,10213.285546211],[8.9891645E-4,5.30650047764,20426.571092422],[5.477194E-5,4.41630661466,7860.4193924392],[3.455741E-5,2.6996444782,11790.6290886588],[2.372061E-5,2.99377542079,3930.2096962196], +[1.317168E-5,5.18668228402,26.2983197998],[1.664146E-5,4.25018630147,1577.3435424478],[1.438387E-5,4.15745084182,9683.5945811164],[1.200521E-5,6.15357116043,30639.856638633]],[[10213.28554621638,0,0],[9.5617813E-4,2.4640651111,10213.285546211],[7.787201E-5,.6247848222,20426.571092422]]],[[[.05923638472,.26702775812,10213.285546211],[4.0107978E-4,1.14737178112,20426.571092422],[3.2814918E-4,3.14159265359,0]],[[.00287821243,1.88964962838,10213.285546211]]],[[[.72334820891,0,0],[.00489824182,4.02151831717, +10213.285546211],[1.658058E-5,4.90206728031,20426.571092422],[1.378043E-5,1.12846591367,11790.6290886588],[1.632096E-5,2.84548795207,7860.4193924392],[4.98395E-6,2.58682193892,9683.5945811164],[2.21985E-6,2.01346696541,19367.1891622328],[2.37454E-6,2.55136053886,15720.8387848784]],[[3.4551041E-4,.89198706276,10213.285546211]]]],Earth:[[[[1.75347045673,0,0],[.03341656453,4.66925680415,6283.0758499914],[3.4894275E-4,4.62610242189,12566.1516999828],[3.417572E-5,2.82886579754,3.523118349],[3.497056E-5, +2.74411783405,5753.3848848968],[3.135899E-5,3.62767041756,77713.7714681205],[2.676218E-5,4.41808345438,7860.4193924392],[2.342691E-5,6.13516214446,3930.2096962196],[1.273165E-5,2.03709657878,529.6909650946],[1.324294E-5,.74246341673,11506.7697697936],[9.01854E-6,2.04505446477,26.2983197998],[1.199167E-5,1.10962946234,1577.3435424478],[8.57223E-6,3.50849152283,398.1490034082],[7.79786E-6,1.17882681962,5223.6939198022],[9.9025E-6,5.23268072088,5884.9268465832],[7.53141E-6,2.53339052847,5507.5532386674], +[5.05267E-6,4.58292599973,18849.2275499742],[4.92392E-6,4.20505711826,775.522611324],[3.56672E-6,2.91954114478,.0673103028],[2.84125E-6,1.89869240932,796.2980068164],[2.42879E-6,.34481445893,5486.777843175],[3.17087E-6,5.84901948512,11790.6290886588],[2.71112E-6,.31486255375,10977.078804699],[2.06217E-6,4.80646631478,2544.3144198834],[2.05478E-6,1.86953770281,5573.1428014331],[2.02318E-6,2.45767790232,6069.7767545534],[1.26225E-6,1.08295459501,20.7753954924],[1.55516E-6,.83306084617,213.299095438]], +[[6283.0758499914,0,0],[.00206058863,2.67823455808,6283.0758499914],[4.303419E-5,2.63512233481,12566.1516999828]],[[8.721859E-5,1.07253635559,6283.0758499914]]],[[],[[.00227777722,3.4137662053,6283.0758499914],[3.805678E-5,3.37063423795,12566.1516999828]]],[[[1.00013988784,0,0],[.01670699632,3.09846350258,6283.0758499914],[1.3956024E-4,3.05524609456,12566.1516999828],[3.08372E-5,5.19846674381,77713.7714681205],[1.628463E-5,1.17387558054,5753.3848848968],[1.575572E-5,2.84685214877,7860.4193924392], +[9.24799E-6,5.45292236722,11506.7697697936],[5.42439E-6,4.56409151453,3930.2096962196],[4.7211E-6,3.66100022149,5884.9268465832],[8.5831E-7,1.27079125277,161000.6857376741],[5.7056E-7,2.01374292245,83996.84731811189],[5.5736E-7,5.2415979917,71430.69561812909],[1.74844E-6,3.01193636733,18849.2275499742],[2.43181E-6,4.2734953079,11790.6290886588]],[[.00103018607,1.10748968172,6283.0758499914],[1.721238E-5,1.06442300386,12566.1516999828]],[[4.359385E-5,5.78455133808,6283.0758499914]]]],Mars:[[[[6.20347711581, +0,0],[.18656368093,5.0503710027,3340.6124266998],[.01108216816,5.40099836344,6681.2248533996],[9.1798406E-4,5.75478744667,10021.8372800994],[2.7744987E-4,5.97049513147,3.523118349],[1.0610235E-4,2.93958560338,2281.2304965106],[1.2315897E-4,.84956094002,2810.9214616052],[8.926784E-5,4.15697846427,.0172536522],[8.715691E-5,6.11005153139,13362.4497067992],[6.797556E-5,.36462229657,398.1490034082],[7.774872E-5,3.33968761376,5621.8429232104],[3.575078E-5,1.6618650571,2544.3144198834],[4.161108E-5,.22814971327, +2942.4634232916],[3.075252E-5,.85696614132,191.4482661116],[2.628117E-5,.64806124465,3337.0893083508],[2.937546E-5,6.07893711402,.0673103028],[2.389414E-5,5.03896442664,796.2980068164],[2.579844E-5,.02996736156,3344.1355450488],[1.528141E-5,1.14979301996,6151.533888305],[1.798806E-5,.65634057445,529.6909650946],[1.264357E-5,3.62275122593,5092.1519581158],[1.286228E-5,3.06796065034,2146.1654164752],[1.546404E-5,2.91579701718,1751.539531416],[1.024902E-5,3.69334099279,8962.4553499102],[8.91566E-6,.18293837498, +16703.062133499],[8.58759E-6,2.4009381194,2914.0142358238],[8.32715E-6,2.46418619474,3340.5951730476],[8.3272E-6,4.49495782139,3340.629680352],[7.12902E-6,3.66335473479,1059.3819301892],[7.48723E-6,3.82248614017,155.4203994342],[7.23861E-6,.67497311481,3738.761430108],[6.35548E-6,2.92182225127,8432.7643848156],[6.55162E-6,.48864064125,3127.3133312618],[5.50474E-6,3.81001042328,.9803210682],[5.5275E-6,4.47479317037,1748.016413067],[4.25966E-6,.55364317304,6283.0758499914],[4.15131E-6,.49662285038, +213.299095438],[4.72167E-6,3.62547124025,1194.4470102246],[3.06551E-6,.38052848348,6684.7479717486],[3.12141E-6,.99853944405,6677.7017350506],[2.93198E-6,4.22131299634,20.7753954924],[3.02375E-6,4.48618007156,3532.0606928114],[2.74027E-6,.54222167059,3340.545116397],[2.81079E-6,5.88163521788,1349.8674096588],[2.31183E-6,1.28242156993,3870.3033917944],[2.83602E-6,5.7688543494,3149.1641605882],[2.36117E-6,5.75503217933,3333.498879699],[2.74033E-6,.13372524985,3340.6797370026],[2.99395E-6,2.78323740866, +6254.6266625236]],[[3340.61242700512,0,0],[.01457554523,3.60433733236,3340.6124266998],[.00168414711,3.92318567804,6681.2248533996],[2.0622975E-4,4.26108844583,10021.8372800994],[3.452392E-5,4.7321039319,3.523118349],[2.586332E-5,4.60670058555,13362.4497067992],[8.41535E-6,4.45864030426,2281.2304965106]],[[5.8152577E-4,2.04961712429,3340.6124266998],[1.3459579E-4,2.45738706163,6681.2248533996]]],[[[.03197134986,3.76832042431,3340.6124266998],[.00298033234,4.10616996305,6681.2248533996],[.00289104742, +0,0],[3.1365539E-4,4.4465105309,10021.8372800994],[3.4841E-5,4.7881254926,13362.4497067992]],[[.00217310991,6.04472194776,3340.6124266998],[2.0976948E-4,3.14159265359,0],[1.2834709E-4,1.60810667915,6681.2248533996]]],[[[1.53033488271,0,0],[.1418495316,3.47971283528,3340.6124266998],[.00660776362,3.81783443019,6681.2248533996],[4.6179117E-4,4.15595316782,10021.8372800994],[8.109733E-5,5.55958416318,2810.9214616052],[7.485318E-5,1.77239078402,5621.8429232104],[5.523191E-5,1.3643630377,2281.2304965106], +[3.82516E-5,4.49407183687,13362.4497067992],[2.306537E-5,.09081579001,2544.3144198834],[1.999396E-5,5.36059617709,3337.0893083508],[2.484394E-5,4.9254563992,2942.4634232916],[1.960195E-5,4.74249437639,3344.1355450488],[1.167119E-5,2.11260868341,5092.1519581158],[1.102816E-5,5.00908403998,398.1490034082],[8.99066E-6,4.40791133207,529.6909650946],[9.92252E-6,5.83861961952,6151.533888305],[8.07354E-6,2.10217065501,1059.3819301892],[7.97915E-6,3.44839203899,796.2980068164],[7.40975E-6,1.49906336885,2146.1654164752]], +[[.01107433345,2.03250524857,3340.6124266998],[.00103175887,2.37071847807,6681.2248533996],[1.28772E-4,0,0],[1.081588E-4,2.70888095665,10021.8372800994]],[[4.4242249E-4,.47930604954,3340.6124266998],[8.138042E-5,.86998389204,6681.2248533996]]]],Jupiter:[[[[.59954691494,0,0],[.09695898719,5.06191793158,529.6909650946],[.00573610142,1.44406205629,7.1135470008],[.00306389205,5.41734730184,1059.3819301892],[9.7178296E-4,4.14264726552,632.7837393132],[7.2903078E-4,3.64042916389,522.5774180938],[6.4263975E-4, +3.41145165351,103.0927742186],[3.9806064E-4,2.29376740788,419.4846438752],[3.8857767E-4,1.27231755835,316.3918696566],[2.7964629E-4,1.7845459182,536.8045120954],[1.358973E-4,5.7748104079,1589.0728952838],[8.246349E-5,3.5822792584,206.1855484372],[8.768704E-5,3.63000308199,949.1756089698],[7.368042E-5,5.0810119427,735.8765135318],[6.26315E-5,.02497628807,213.299095438],[6.114062E-5,4.51319998626,1162.4747044078],[4.905396E-5,1.32084470588,110.2063212194],[5.305285E-5,1.30671216791,14.2270940016],[5.305441E-5, +4.18625634012,1052.2683831884],[4.647248E-5,4.69958103684,3.9321532631],[3.045023E-5,4.31676431084,426.598190876],[2.609999E-5,1.56667394063,846.0828347512],[2.028191E-5,1.06376530715,3.1813937377],[1.764763E-5,2.14148655117,1066.49547719],[1.722972E-5,3.88036268267,1265.5674786264],[1.920945E-5,.97168196472,639.897286314],[1.633223E-5,3.58201833555,515.463871093],[1.431999E-5,4.29685556046,625.6701923124],[9.73272E-6,4.09764549134,95.9792272178]],[[529.69096508814,0,0],[.00489503243,4.2208293947, +529.6909650946],[.00228917222,6.02646855621,7.1135470008],[3.0099479E-4,4.54540782858,1059.3819301892],[2.072092E-4,5.45943156902,522.5774180938],[1.2103653E-4,.16994816098,536.8045120954],[6.067987E-5,4.42422292017,103.0927742186],[5.433968E-5,3.98480737746,419.4846438752],[4.237744E-5,5.89008707199,14.2270940016]],[[4.7233601E-4,4.32148536482,7.1135470008],[3.0649436E-4,2.929777887,529.6909650946],[1.4837605E-4,3.14159265359,0]]],[[[.02268615702,3.55852606721,529.6909650946],[.00109971634,3.90809347197, +1059.3819301892],[.00110090358,0,0],[8.101428E-5,3.60509572885,522.5774180938],[6.043996E-5,4.25883108339,1589.0728952838],[6.437782E-5,.30627119215,536.8045120954]],[[7.8203446E-4,1.52377859742,529.6909650946]]],[[[5.20887429326,0,0],[.25209327119,3.49108639871,529.6909650946],[.00610599976,3.84115365948,1059.3819301892],[.00282029458,2.57419881293,632.7837393132],[.00187647346,2.07590383214,522.5774180938],[8.6792905E-4,.71001145545,419.4846438752],[7.2062974E-4,.21465724607,536.8045120954],[6.5517248E-4, +5.9799588479,316.3918696566],[2.9134542E-4,1.67759379655,103.0927742186],[3.0135335E-4,2.16132003734,949.1756089698],[2.3453271E-4,3.54023522184,735.8765135318],[2.2283743E-4,4.19362594399,1589.0728952838],[2.3947298E-4,.2745803748,7.1135470008],[1.3032614E-4,2.96042965363,1162.4747044078],[9.70336E-5,1.90669633585,206.1855484372],[1.2749023E-4,2.71550286592,1052.2683831884],[7.057931E-5,2.18184839926,1265.5674786264],[6.137703E-5,6.26418240033,846.0828347512],[2.616976E-5,2.00994012876,1581.959348283]], +[[.0127180152,2.64937512894,529.6909650946],[6.1661816E-4,3.00076460387,1059.3819301892],[5.3443713E-4,3.89717383175,522.5774180938],[3.1185171E-4,4.88276958012,536.8045120954],[4.1390269E-4,0,0]]]],Saturn:[[[[.87401354025,0,0],[.11107659762,3.96205090159,213.299095438],[.01414150957,4.58581516874,7.1135470008],[.00398379389,.52112032699,206.1855484372],[.00350769243,3.30329907896,426.598190876],[.00206816305,.24658372002,103.0927742186],[7.92713E-4,3.84007056878,220.4126424388],[2.3990355E-4,4.66976924553, +110.2063212194],[1.6573588E-4,.43719228296,419.4846438752],[1.4906995E-4,5.76903183869,316.3918696566],[1.582029E-4,.93809155235,632.7837393132],[1.4609559E-4,1.56518472,3.9321532631],[1.3160301E-4,4.44891291899,14.2270940016],[1.5053543E-4,2.71669915667,639.897286314],[1.3005299E-4,5.98119023644,11.0457002639],[1.0725067E-4,3.12939523827,202.2533951741],[5.863206E-5,.23656938524,529.6909650946],[5.227757E-5,4.20783365759,3.1813937377],[6.126317E-5,1.76328667907,277.0349937414],[5.019687E-5,3.17787728405, +433.7117378768],[4.59255E-5,.61977744975,199.0720014364],[4.005867E-5,2.24479718502,63.7358983034],[2.953796E-5,.98280366998,95.9792272178],[3.87367E-5,3.22283226966,138.5174968707],[2.461186E-5,2.03163875071,735.8765135318],[3.269484E-5,.77492638211,949.1756089698],[1.758145E-5,3.2658010994,522.5774180938],[1.640172E-5,5.5050445305,846.0828347512],[1.391327E-5,4.02333150505,323.5054166574],[1.580648E-5,4.37265307169,309.2783226558],[1.123498E-5,2.83726798446,415.5524906121],[1.017275E-5,3.71700135395, +227.5261894396],[8.48642E-6,3.1915017083,209.3669421749]],[[213.2990952169,0,0],[.01297370862,1.82834923978,213.299095438],[.00564345393,2.88499717272,7.1135470008],[9.3734369E-4,1.06311793502,426.598190876],[.00107674962,2.27769131009,206.1855484372],[4.0244455E-4,2.04108104671,220.4126424388],[1.9941774E-4,1.2795439047,103.0927742186],[1.0511678E-4,2.7488034213,14.2270940016],[6.416106E-5,.38238295041,639.897286314],[4.848994E-5,2.43037610229,419.4846438752],[4.056892E-5,2.92133209468,110.2063212194], +[3.768635E-5,3.6496533078,3.9321532631]],[[.0011644133,1.17988132879,7.1135470008],[9.1841837E-4,.0732519584,213.299095438],[3.6661728E-4,0,0],[1.5274496E-4,4.06493179167,206.1855484372]]],[[[.04330678039,3.60284428399,213.299095438],[.00240348302,2.85238489373,426.598190876],[8.4745939E-4,0,0],[3.0863357E-4,3.48441504555,220.4126424388],[3.4116062E-4,.57297307557,206.1855484372],[1.473407E-4,2.11846596715,639.897286314],[9.916667E-5,5.79003188904,419.4846438752],[6.993564E-5,4.7360468972,7.1135470008], +[4.807588E-5,5.43305312061,316.3918696566]],[[.00198927992,4.93901017903,213.299095438],[3.6947916E-4,3.14159265359,0],[1.7966989E-4,.5197943111,426.598190876]]],[[[9.55758135486,0,0],[.52921382865,2.39226219573,213.299095438],[.01873679867,5.2354960466,206.1855484372],[.01464663929,1.64763042902,426.598190876],[.00821891141,5.93520042303,316.3918696566],[.00547506923,5.0153261898,103.0927742186],[.0037168465,2.27114821115,220.4126424388],[.00361778765,3.13904301847,7.1135470008],[.00140617506,5.70406606781, +632.7837393132],[.00108974848,3.29313390175,110.2063212194],[6.9006962E-4,5.94099540992,419.4846438752],[6.1053367E-4,.94037691801,639.897286314],[4.8913294E-4,1.55733638681,202.2533951741],[3.4143772E-4,.19519102597,277.0349937414],[3.2401773E-4,5.47084567016,949.1756089698],[2.0936596E-4,.46349251129,735.8765135318],[9.796004E-5,5.20477537945,1265.5674786264],[1.1993338E-4,5.98050967385,846.0828347512],[2.08393E-4,1.52102476129,433.7117378768],[1.5298404E-4,3.0594381494,529.6909650946],[6.465823E-5, +.17732249942,1052.2683831884],[1.1380257E-4,1.7310542704,522.5774180938],[3.419618E-5,4.94550542171,1581.959348283]],[[.0618298134,.2584351148,213.299095438],[.00506577242,.71114625261,206.1855484372],[.00341394029,5.79635741658,426.598190876],[.00188491195,.47215589652,220.4126424388],[.00186261486,3.14159265359,0],[.00143891146,1.40744822888,7.1135470008]],[[.00436902572,4.78671677509,213.299095438]]]],Uranus:[[[[5.48129294297,0,0],[.09260408234,.89106421507,74.7815985673],[.01504247898,3.6271926092, +1.4844727083],[.00365981674,1.89962179044,73.297125859],[.00272328168,3.35823706307,149.5631971346],[7.0328461E-4,5.39254450063,63.7358983034],[6.8892678E-4,6.09292483287,76.2660712756],[6.1998615E-4,2.26952066061,2.9689454166],[6.1950719E-4,2.85098872691,11.0457002639],[2.646877E-4,3.14152083966,71.8126531507],[2.5710476E-4,6.11379840493,454.9093665273],[2.107885E-4,4.36059339067,148.0787244263],[1.7818647E-4,1.74436930289,36.6485629295],[1.4613507E-4,4.73732166022,3.9321532631],[1.1162509E-4,5.8268179635, +224.3447957019],[1.099791E-4,.48865004018,138.5174968707],[9.527478E-5,2.95516862826,35.1640902212],[7.545601E-5,5.236265824,109.9456887885],[4.220241E-5,3.23328220918,70.8494453042],[4.0519E-5,2.277550173,151.0476698429],[3.354596E-5,1.0654900738,4.4534181249],[2.926718E-5,4.62903718891,9.5612275556],[3.49034E-5,5.48306144511,146.594251718],[3.144069E-5,4.75199570434,77.7505439839],[2.922333E-5,5.35235361027,85.8272988312],[2.272788E-5,4.36600400036,70.3281804424],[2.051219E-5,1.51773566586,.1118745846], +[2.148602E-5,.60745949945,38.1330356378],[1.991643E-5,4.92437588682,277.0349937414],[1.376226E-5,2.04283539351,65.2203710117],[1.666902E-5,3.62744066769,380.12776796],[1.284107E-5,3.11347961505,202.2533951741],[1.150429E-5,.93343589092,3.1813937377],[1.533221E-5,2.58594681212,52.6901980395],[1.281604E-5,.54271272721,222.8603229936],[1.372139E-5,4.19641530878,111.4301614968],[1.221029E-5,.1990065003,108.4612160802],[9.46181E-6,1.19253165736,127.4717966068],[1.150989E-5,4.17898916639,33.6796175129]], +[[74.7815986091,0,0],[.00154332863,5.24158770553,74.7815985673],[2.4456474E-4,1.71260334156,1.4844727083],[9.258442E-5,.4282973235,11.0457002639],[8.265977E-5,1.50218091379,63.7358983034],[9.15016E-5,1.41213765216,149.5631971346]]],[[[.01346277648,2.61877810547,74.7815985673],[6.23414E-4,5.08111189648,149.5631971346],[6.1601196E-4,3.14159265359,0],[9.963722E-5,1.61603805646,76.2660712756],[9.92616E-5,.57630380333,73.297125859]],[[3.4101978E-4,.01321929936,74.7815985673]]],[[[19.21264847206,0,0],[.88784984413, +5.60377527014,74.7815985673],[.03440836062,.32836099706,73.297125859],[.0205565386,1.7829515933,149.5631971346],[.0064932241,4.52247285911,76.2660712756],[.00602247865,3.86003823674,63.7358983034],[.00496404167,1.40139935333,454.9093665273],[.00338525369,1.58002770318,138.5174968707],[.00243509114,1.57086606044,71.8126531507],[.00190522303,1.99809394714,1.4844727083],[.00161858838,2.79137786799,148.0787244263],[.00143706183,1.38368544947,11.0457002639],[9.3192405E-4,.17437220467,36.6485629295],[7.1424548E-4, +4.24509236074,224.3447957019],[8.9806014E-4,3.66105364565,109.9456887885],[3.9009723E-4,1.66971401684,70.8494453042],[4.6677296E-4,1.39976401694,35.1640902212],[3.9025624E-4,3.36234773834,277.0349937414],[3.6755274E-4,3.88649278513,146.594251718],[3.0348723E-4,.70100838798,151.0476698429],[2.9156413E-4,3.180563367,77.7505439839],[2.2637073E-4,.72518687029,529.6909650946],[1.1959076E-4,1.7504339214,984.6003316219],[2.5620756E-4,5.25656086672,380.12776796]],[[.01479896629,3.67205697578,74.7815985673]]]], +Neptune:[[[[5.31188633046,0,0],[.0179847553,2.9010127389,38.1330356378],[.01019727652,.48580922867,1.4844727083],[.00124531845,4.83008090676,36.6485629295],[4.2064466E-4,5.41054993053,2.9689454166],[3.7714584E-4,6.09221808686,35.1640902212],[3.3784738E-4,1.24488874087,76.2660712756],[1.6482741E-4,7.727998E-5,491.5579294568],[9.198584E-5,4.93747051954,39.6175083461],[8.99425E-5,.27462171806,175.1660598002]],[[38.13303563957,0,0],[1.6604172E-4,4.86323329249,1.4844727083],[1.5744045E-4,2.27887427527, +38.1330356378]]],[[[.03088622933,1.44104372644,38.1330356378],[2.7780087E-4,5.91271884599,76.2660712756],[2.7623609E-4,0,0],[1.5355489E-4,2.52123799551,36.6485629295],[1.5448133E-4,3.50877079215,39.6175083461]]],[[[30.07013205828,0,0],[.27062259632,1.32999459377,38.1330356378],[.01691764014,3.25186135653,36.6485629295],[.00807830553,5.18592878704,1.4844727083],[.0053776051,4.52113935896,35.1640902212],[.00495725141,1.5710564165,491.5579294568],[.00274571975,1.84552258866,175.1660598002],[1.201232E-4, +1.92059384991,1021.2488945514],[.00121801746,5.79754470298,76.2660712756],[.00100896068,.3770272493,73.297125859],[.00135134092,3.37220609835,39.6175083461],[7.571796E-5,1.07149207335,388.4651552382]]]]},pa={Pluto:[{tt:-109573.5,ndays:22873.4,coeff:[[-38.379127948969,-15.540131600164,6.713024498471],[14.305366595998,-27.805310343824,-12.981888636985],[7.92543601413,3.90369116971,-1.168958644595],[-.442101048338,1.685913511618,.659210430825],[-.373216809055,-.063688373891,.09326048306],[-.009972684884, +-.081495131522,-.021987413967],[.018367454594,-.004930958318,-.007352983738],[.003427373209,.005473507308,.001034839203],[-.001351484381,.001104099542,6.8778874E-4],[5.7615664E-5,9.46156502E-4,5.07901883E-4],[-.002112022612,6.29887022E-4,3.15500774E-4],[-5.11474378E-4,-.001320928726,-5.62497776E-4],[-1.98663925E-4,6.8936041E-5,3.6709195E-5],[-5.40552292E-4,-.001503978652,-6.30773819E-4],[.002437160925,-7.63631463E-4,-3.87861693E-4],[8.16305566E-4,.0022053374,9.25670951E-4],[-.002021926086,6.22387047E-4, +3.16528605E-4],[-5.05895596E-4,-.00120561281,-5.04580853E-4],[.00112639953,-3.61584688E-4,-1.8281778E-4]]},{tt:-86700.1,ndays:22873.4,coeff:[[55.447823115293,-27.26640657528,-25.207542726969],[21.019137449061,20.342364979145,.014098785243],[-4.74970160852,2.918129180139,2.342054849317],[-.152026133726,-.860351920073,-.222763626308],[.103419154134,.07573598087,-.007005683084],[-.022470674224,.003007617977,.007032450935],[.001163669493,-.003189922026,-.00162464862],[-.001137731669,2.62288216E-4,3.8087641E-5], +[4.3103328E-5,-5.3509763E-4,-2.06619902E-4],[-.001261838718,3.04538227E-4,1.56262972E-4],[-3.86936271E-4,-.002058845083,-8.71353485E-4],[.001504572723,-2.67222447E-4,-1.51193739E-4],[6.9990356E-5,-1.84521171E-4,-8.1257481E-5],[.001713840868,-2.27638497E-4,-1.39809761E-4],[3.80695392E-4,.002350810217,9.98895521E-4],[-.002512724805,3.68540417E-4,2.1974477E-4],[-3.57746385E-4,-.001951245887,-8.27980927E-4],[.001367155227,-1.2706759E-4,-8.800842E-5],[1.73137697E-4,.00108470877,4.60942958E-4]]},{tt:-63826.8, +ndays:22873.4,coeff:[[69.634036499141,57.372230785853,-3.077375595621],[-12.411985665793,17.572931987772,9.221186946545],[-3.0908312584,-2.512294626088,.146706800235],[.21836223463,-.226221283768,-.1364778982],[8.80517265E-4,.010681097884,.002725741572],[-.001291221881,-.003106227879,-.001273733378],[-5.00284392E-4,-.001446751396,-6.35982028E-4],[.001105591622,-.001683856224,-7.68604544E-4],[9.38522644E-4,5.05869572E-4,1.86404007E-4],[-2.11177024E-4,-.001065799522,-4.46266661E-4],[.002134035294,-2.965848E-5, +-6.3643319E-5],[3.5325265E-5,.001388374194,5.92202743E-4],[1.16349193E-4,6.1976724E-5,2.3376874E-5],[-7.2445415E-5,.001636213289,7.04241568E-4],[-.00257574516,-1.05513632E-4,1.7803397E-5],[7.2226632E-5,-.002387946399,-.001025976586],[.002194786367,7.253094E-5,-2.2483321E-5],[-5.3247082E-5,.001177229455,5.06221758E-4],[-.001172329523,-4.5691921E-5,8.994465E-6]]},{tt:-40953.4,ndays:22873.4,coeff:[[-8.991435374359,72.522929925849,25.335167039777],[-23.717658611798,-11.790452911233,3.467137945519],[.826017751998, +-4.641123526666,-1.697326777915],[.560746056871,-.090150086821,-.197072243469],[.053367643147,.030287157582,-.006883260629],[.004886534342,.006021189196,3.75548379E-4],[.001517320916,-4.31833409E-4,-3.66094177E-4],[.002577336038,.001237262625,4.56269058E-4],[-6.69267838E-4,.00116915309,5.26044269E-4],[9.41669987E-4,5.2324731E-5,6.451966E-6],[-3.08122555E-4,.001907421829,8.24565883E-4],[-.001450786896,-2.41544461E-4,-6.9557948E-5],[-2.1044193E-5,1.76079825E-4,7.6920928E-5],[-.001711364848,-4.0687798E-4, +-1.32083416E-4],[5.50039252E-4,-.002319991661,-.001008513611],[.002503893667,5.58897059E-4,1.78233903E-4],[-4.87607379E-4,.001932237958,8.40475179E-4],[-.001325885344,-2.11156037E-4,-5.8139585E-5],[2.3697721E-4,-.001063738969,-4.61951831E-4]]},{tt:-18080,ndays:22873.4,coeff:[[-36.087786489549,-19.321019448663,4.842126256045],[16.674527202393,-26.439741396846,-13.273510277928],[7.640949973276,4.666665369749,-.845879718769],[-.675046527214,1.618348207499,.708326066983],[-.374519038689,-.128911510322, +.072787764393],[.008450995489,-.086316399102,-.029607183244],[.023560644312,.001433948061,-.005972909639],[1.23688589E-4,.008108170319,.002548003443],[-.002730297048,-3.9481707E-5,3.90047845E-4],[-5.77835152E-4,3.77966419E-4,2.71660666E-4],[-.001872062542,-8.07048678E-4,-3.23879099E-4],[5.47521881E-4,-.001220942947,-5.46774321E-4],[-2.38935039E-4,-1.36260249E-4,-4.7363292E-5],[6.86748774E-4,-.001467331313,-6.44194239E-4],[.002396569437,9.52782447E-4,3.4755804E-4],[-9.69645524E-4,.002136243261,9.38808719E-4], +[-.00197156823,-7.68658104E-4,-2.8052153E-4],[5.50474324E-4,-.001191027208,-5.23701526E-4],[.001103417783,4.33385295E-4,1.58034752E-4]]},{tt:4793.4,ndays:22873.4,coeff:[[58.755369508116,-24.2646689693,-25.275084172155],[19.497987169479,21.276853294102,.764723273399],[-4.823126413932,2.498256389201,2.232355462314],[-.08614098399,-.813675478819,-.227988579141],[.085311207859,.074538364204,-.002854595841],[-.01705162038,-.002540894346,.004208292723],[.002769861771,-1.4329185E-5,-4.77592398E-4],[-.002551661001, +6.9089826E-5,4.6330164E-5],[6.9355992E-5,-.001265302658,-5.03662137E-4],[-7.39467933E-4,-6.80968125E-4,-2.81115427E-4],[.001236770708,-.001567842762,-7.03898847E-4],[.001243060414,7.31613032E-4,2.83816485E-4],[1.74026399E-4,-9.3710964E-5,-4.4485803E-5],[.001493473235,9.02078907E-4,3.5003227E-4],[-.001429402935,.001976479349,8.82105392E-4],[-.002183986564,-.001289554847,-4.9947593E-4],[.001157663206,-.001681190457,-7.48793883E-4],[.001077037844,7.20659055E-4,2.82739654E-4],[-6.50786278E-4,8.98878141E-4, +4.01222494E-4]]},{tt:27666.8,ndays:22873.4,coeff:[[67.691164156698,60.055690812059,-1.653713469469],[-13.392561842793,16.736135121408,9.258008571303],[-2.979947432205,-2.623400069241,.078535157634],[.221140466168,-.219668370791,-.134946210351],[.002253370723,.006150902785,7.41705969E-4],[.003786183572,-.002028669517,-.001070817054],[-7.29683667E-4,.001185908944,4.59456376E-4],[2.14692528E-4,-.001514035337,-6.28903034E-4],[7.99410963E-4,1.14168654E-4,3.4870976E-5],[.001014080744,-7.07640463E-4,-3.3251734E-4], +[.001555070571,.001399146449,5.60894218E-4],[-.001017832289,9.98745218E-4,4.51886947E-4],[1.05798659E-4,9.1126421E-5,3.6516053E-5],[-.0012650908,.001163905877,5.30521482E-4],[-.001874934335,-.001660517639,-6.65989341E-4],[.001807826027,-.001705845177,-7.75290385E-4],[.001582901643,.001412609292,5.6689363E-4],[-8.63192985E-4,8.74901432E-4,3.96000392E-4],[-8.59691105E-4,-7.4306499E-4,-2.97495435E-4]]},{tt:50540.1,ndays:22873.4,coeff:[[-12.469752090089,70.481525173143,25.755334377455],[-23.370842315291, +-13.264547442851,2.902657719838],[1.110867958719,-4.67270866565,-1.792706614402],[.596571797676,-.066313898032,-.200285819643],[.060080579048,.035889468333,-.006426562076],[.006591799109,.011099902718,.002309289562],[-9.68324396E-4,.001898382496,7.40088714E-4],[5.23251649E-4,8.12554121E-4,3.83725061E-4],[-3.19832676E-4,1.99016237E-4,9.6616884E-5],[7.82553114E-4,.001015845568,4.12740772E-4],[-.00180181981,.001254101038,5.81678095E-4],[-9.05307447E-4,-.001101496166,-4.49936776E-4],[-1.83981908E-4,1.44296441E-4, +6.71345E-5],[-.001000404967,-.001338920106,-5.49210134E-4],[.002108795205,-.001386328192,-6.45830667E-4],[.001472529436,.001926033725,7.8947952E-4],[-.001749726932,.001130345906,5.2704357E-4],[-8.62478053E-4,-.001013136301,-4.13188733E-4],[9.581099E-4,-6.47958487E-4,-3.00786397E-4]]}]};e.DeltaT_EspenakMeeus=function(a){var b=2E3+(a-14)/365.24217;if(-500>b)return a=(b-1820)/100,-20+32*a*a;if(500>b){a=b/100;b=a*a;var c=a*b;return 10583.6-1014.41*a+33.78311*b-5.952053*c-.1798452*b*b+.022174192*b*c+.0090316521* +c*c}if(1600>b)return a=(b-1E3)/100,b=a*a,c=a*b,1574.2-556.01*a+71.23472*b+.319781*c-.8503463*b*b-.005050998*b*c+.0083572073*c*c;if(1700>b)return a=b-1600,b=a*a,120-.9808*a-.01532*b+a*b/7129;if(1800>b)return a=b-1700,b=a*a,8.83+.1603*a-.0059285*b+1.3336E-4*a*b-b*b/1174E3;if(1860>b){a=b-1800;b=a*a;c=a*b;var d=b*b;return 13.72-.332447*a+.0068612*b+.0041116*c-3.7436E-4*d+1.21272E-5*b*c-1.699E-7*c*c+8.75E-10*c*d}if(1900>b)return a=b-1860,b=a*a,c=a*b,7.62+.5737*a-.251754*b+.01680668*c-4.473624E-4*b*b+b* +c/233174;if(1920>b)return a=b-1900,b=a*a,-2.79+1.494119*a-.0598939*b+.0061966*a*b-1.97E-4*b*b;if(1941>b)return a=b-1920,b=a*a,21.2+.84493*a-.0761*b+.0020936*a*b;if(1961>b)return a=b-1950,b=a*a,29.07+.407*a-b/233+a*b/2547;if(1986>b)return a=b-1975,b=a*a,45.45+1.067*a-b/260-a*b/718;if(2005>b)return a=b-2E3,b=a*a,c=a*b,63.86+.3345*a-.060374*b+.0017275*c+6.51814E-4*b*b+2.373599E-5*b*c;if(2050>b)return a=b-2E3,62.92+.32217*a+.005589*a*a;if(2150>b)return a=(b-1820)/100,-20+32*a*a-.5628*(2150-b);a=(b-1820)/ +100;return-20+32*a*a};e.DeltaT_JplHorizons=function(a){return e.DeltaT_EspenakMeeus(Math.min(a,17*365.24217))};var ea=e.DeltaT_EspenakMeeus;e.SetDeltaTFunction=function(a){ea=a};var x=function(a){if(a instanceof Date)this.date=a,this.ut=(a-ca)/864E5,this.tt=A(this.ut);else if("number"===typeof a)this.date=new Date(ca-864E5*-a),this.ut=a,this.tt=A(this.ut);else throw"Argument must be a Date object, an AstroTime object, or a numeric UTC Julian date.";};x.prototype.toString=function(){return this.date.toISOString()}; +x.prototype.AddDays=function(a){return new x(this.ut+a)};e.MakeTime=function(a){return a instanceof x?a:new x(a)};var fa=[{nals:[0,0,0,0,1],cls:[-172064161,-174666,33386,92052331,9086,15377]},{nals:[0,0,2,-2,2],cls:[-13170906,-1675,-13696,5730336,-3015,-4587]},{nals:[0,0,2,0,2],cls:[-2276413,-234,2796,978459,-485,1374]},{nals:[0,0,0,0,2],cls:[2074554,207,-698,-897492,470,-291]},{nals:[0,1,0,0,0],cls:[1475877,-3633,11817,73871,-184,-1924]},{nals:[0,1,2,-2,2],cls:[-516821,1226,-524,224386,-677,-174]}, +{nals:[1,0,0,0,0],cls:[711159,73,-872,-6750,0,358]},{nals:[0,0,2,0,1],cls:[-387298,-367,380,200728,18,318]},{nals:[1,0,2,0,2],cls:[-301461,-36,816,129025,-63,367]},{nals:[0,-1,2,-2,2],cls:[215829,-494,111,-95929,299,132]},{nals:[0,0,2,-2,1],cls:[128227,137,181,-68982,-9,39]},{nals:[-1,0,2,0,2],cls:[123457,11,19,-53311,32,-4]},{nals:[-1,0,0,2,0],cls:[156994,10,-168,-1235,0,82]},{nals:[1,0,0,0,1],cls:[63110,63,27,-33228,0,-9]},{nals:[-1,0,0,0,1],cls:[-57976,-63,-189,31429,0,-75]},{nals:[-1,0,2,2,2], +cls:[-59641,-11,149,25543,-11,66]},{nals:[1,0,2,0,1],cls:[-51613,-42,129,26366,0,78]},{nals:[-2,0,2,0,1],cls:[45893,50,31,-24236,-10,20]},{nals:[0,0,0,2,0],cls:[63384,11,-150,-1220,0,29]},{nals:[0,0,2,2,2],cls:[-38571,-1,158,16452,-11,68]},{nals:[0,-2,2,-2,2],cls:[32481,0,0,-13870,0,0]},{nals:[-2,0,0,2,0],cls:[-47722,0,-18,477,0,-25]},{nals:[2,0,2,0,2],cls:[-31046,-1,131,13238,-11,59]},{nals:[1,0,2,-2,2],cls:[28593,0,-1,-12338,10,-3]},{nals:[-1,0,2,0,1],cls:[20441,21,10,-10758,0,-3]},{nals:[2,0,0, +0,0],cls:[29243,0,-74,-609,0,13]},{nals:[0,0,2,0,0],cls:[25887,0,-66,-550,0,11]},{nals:[0,1,0,0,1],cls:[-14053,-25,79,8551,-2,-45]},{nals:[-1,0,0,2,1],cls:[15164,10,11,-8001,0,-1]},{nals:[0,2,2,-2,2],cls:[-15794,72,-16,6850,-42,-5]},{nals:[0,0,-2,2,0],cls:[21783,0,13,-167,0,13]},{nals:[1,0,0,-2,1],cls:[-12873,-10,-37,6953,0,-14]},{nals:[0,-1,0,0,1],cls:[-12654,11,63,6415,0,26]},{nals:[-1,0,2,2,1],cls:[-10204,0,25,5222,0,15]},{nals:[0,2,0,0,0],cls:[16707,-85,-10,168,-1,10]},{nals:[1,0,2,2,2],cls:[-7691, +0,44,3268,0,19]},{nals:[-2,0,2,0,0],cls:[-11024,0,-14,104,0,2]},{nals:[0,1,2,0,2],cls:[7566,-21,-11,-3250,0,-5]},{nals:[0,0,2,2,1],cls:[-6637,-11,25,3353,0,14]},{nals:[0,-1,2,0,2],cls:[-7141,21,8,3070,0,4]},{nals:[0,0,0,2,1],cls:[-6302,-11,2,3272,0,4]},{nals:[1,0,2,-2,1],cls:[5800,10,2,-3045,0,-1]},{nals:[2,0,2,-2,2],cls:[6443,0,-7,-2768,0,-4]},{nals:[-2,0,0,2,1],cls:[-5774,-11,-15,3041,0,-5]},{nals:[2,0,2,0,1],cls:[-5350,0,21,2695,0,12]},{nals:[0,-1,2,-2,1],cls:[-4752,-11,-3,2719,0,-3]},{nals:[0, +0,0,-2,1],cls:[-4940,-11,-21,2720,0,-9]},{nals:[-1,-1,0,2,0],cls:[7350,0,-8,-51,0,4]},{nals:[2,0,0,-2,1],cls:[4065,0,6,-2206,0,1]},{nals:[1,0,0,2,0],cls:[6579,0,-24,-199,0,2]},{nals:[0,1,2,-2,1],cls:[3579,0,5,-1900,0,1]},{nals:[1,-1,0,0,0],cls:[4725,0,-6,-41,0,3]},{nals:[-2,0,2,0,2],cls:[-3075,0,-2,1313,0,-1]},{nals:[3,0,2,0,2],cls:[-2904,0,15,1233,0,7]},{nals:[0,-1,0,2,0],cls:[4348,0,-10,-81,0,2]},{nals:[1,-1,2,0,2],cls:[-2878,0,8,1232,0,4]},{nals:[0,0,0,1,0],cls:[-4230,0,5,-20,0,-2]},{nals:[-1, +-1,2,2,2],cls:[-2819,0,7,1207,0,3]},{nals:[-1,0,2,0,0],cls:[-4056,0,5,40,0,-2]},{nals:[0,-1,2,2,2],cls:[-2647,0,11,1129,0,5]},{nals:[-2,0,0,0,1],cls:[-2294,0,-10,1266,0,-4]},{nals:[1,1,2,0,2],cls:[2481,0,-7,-1062,0,-3]},{nals:[2,0,0,0,1],cls:[2179,0,-2,-1129,0,-2]},{nals:[-1,1,0,1,0],cls:[3276,0,1,-9,0,0]},{nals:[1,1,0,0,0],cls:[-3389,0,5,35,0,-2]},{nals:[1,0,2,0,0],cls:[3339,0,-13,-107,0,1]},{nals:[-1,0,2,-2,1],cls:[-1987,0,-6,1073,0,-2]},{nals:[1,0,0,0,2],cls:[-1981,0,0,854,0,0]},{nals:[-1,0,0, +1,0],cls:[4026,0,-353,-553,0,-139]},{nals:[0,0,2,1,2],cls:[1660,0,-5,-710,0,-2]},{nals:[-1,0,2,4,2],cls:[-1521,0,9,647,0,4]},{nals:[-1,1,0,1,1],cls:[1314,0,0,-700,0,0]},{nals:[0,-2,2,-2,1],cls:[-1283,0,0,672,0,0]},{nals:[1,0,2,2,1],cls:[-1331,0,8,663,0,4]},{nals:[-2,0,2,2,2],cls:[1383,0,-2,-594,0,-2]},{nals:[-1,0,0,0,2],cls:[1405,0,4,-610,0,2]},{nals:[1,1,2,-2,2],cls:[1290,0,0,-556,0,0]}],O;e.CalcMoonCount=0;var r=function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.t=d};r.prototype.Length=function(){return Math.sqrt(this.x* +this.x+this.y*this.y+this.z*this.z)};var U=function(a,b,c){this.lat=a;this.lon=b;this.dist=c};e.MakeSpherical=function(a,b,c){return new U(a,b,c)};var Z=function(a,b,c){this.ra=a;this.dec=b;this.dist=c},B=function(a){this.rot=a};e.MakeRotation=function(a){if(!ra(a))throw"Argument must be a [3][3] array of numbers";return new B(a)};var Aa=function(a,b,c,d){this.azimuth=a;this.altitude=b;this.ra=c;this.dec=d},sa=function(a,b,c,d,e){this.ex=a;this.ey=b;this.ez=c;this.elat=d;this.elon=e};e.Horizon=function(a, +b,c,d,h){a=e.MakeTime(a);var k=Math.sin(.017453292519943295*b.latitude),l=Math.cos(.017453292519943295*b.latitude),g=Math.sin(.017453292519943295*b.longitude),m=Math.cos(.017453292519943295*b.longitude);b=Math.sin(.017453292519943295*d);var f=Math.cos(.017453292519943295*d),n=Math.sin(.2617993877991494*c),p=Math.cos(.2617993877991494*c),q=[l*m,l*g,k];k=[-k*m,-k*g,l];g=[g,-m,0];l=-15*K(a);a=D(l,q);q=D(l,k);g=D(l,g);b=[f*p,f*n,b];n=b[0]*a[0]+b[1]*a[1]+b[2]*a[2];q=b[0]*q[0]+b[1]*q[1]+b[2]*q[2];g=b[0]* +g[0]+b[1]*g[1]+b[2]*g[2];p=Math.sqrt(q*q+g*g);f=0;0f&&(f+=360),360<=f&&(f-=360));n=57.29577951308232*Math.atan2(p,n);p=d;if(h&&(d=n,h=e.Refraction(h,90-n),n-=h,0g;++g)h.push((b[g]-d*a[g])/q*c+a[g]*p);p=Math.sqrt(h[0]*h[0]+h[1]*h[1]);0c&&(c+=24), +24<=c&&(c-=24)):c=0;p=57.29577951308232*Math.atan2(h[2],p)}return new Aa(f,90-n,c,p)};var Ba=function(a,b,c){this.latitude=a;this.longitude=b;this.height=c};e.MakeObserver=function(a,b,c){return new Ba(a,b,c||0)};e.SunPosition=function(a){a=e.MakeTime(a).AddDays(-.005775518331089121);var b=w(t.Earth,a);b=P(0,[-b.x,-b.y,-b.z],a.tt);b=X(a,0,b);a=.017453292519943295*N(a).tobl;return ia(b[0],b[1],b[2],Math.cos(a),Math.sin(a))};e.Equator=function(a,b,c,d,h){b=e.MakeTime(b);var k=K(b),l=.017453292519943295* +c.latitude,g=Math.sin(l);l=Math.cos(l);var m=1/Math.sqrt(l*l+.9933056020041345*g*g),f=c.height/1E3,n=6378.1366*m+f;c=.017453292519943295*(15*k+c.longitude);c=X(b,-1,[n*l*Math.cos(c)/1.4959787069098932E8,n*l*Math.sin(c)/1.4959787069098932E8,(6335.438815127603*m+f)*g/1.4959787069098932E8]);c=P(b.tt,c,0);a=e.GeoVector(a,b,h);a=[a.x-c[0],a.y-c[1],a.z-c[2]];if(!d)return ha(a);d=P(0,a,b.tt);d=X(b,0,d);return ha(d)};e.Ecliptic=function(a,b,c){void 0===T&&(T=.017453292519943295*N(e.MakeTime(ca)).mobl,na= +Math.cos(T),oa=Math.sin(T));return ia(a,b,c,na,oa)};e.GeoMoon=function(a){a=e.MakeTime(a);var b=C(a),c=b.distance_au*Math.cos(b.geo_eclip_lat);b=[c*Math.cos(b.geo_eclip_lon),c*Math.sin(b.geo_eclip_lon),b.distance_au*Math.sin(b.geo_eclip_lat)];var d=.017453292519943295*E(a);c=Math.cos(d);d=Math.sin(d);b=P(a.tt,[b[0],b[1]*c-b[2]*d,b[1]*d+b[2]*c],0);return new r(b[0],b[1],b[2],a)};e.HelioVector=function(a,b){b=e.MakeTime(b);if(a in t)return w(t[a],b);if(a in pa){a:{var c=$jscomp.makeIterator(pa[a]); +for(a=c.next();!a.done;a=c.next()){a=a.value;var d=a.tt;var h=a.tt+a.ndays;d=(2*b.tt-(h+d))/(h-d);if(-1<=d&&1>=d){var k=[];for(h=0;3>h;++h){var l=1;var g=a.coeff[0][h];var m=d;g+=a.coeff[1][h]*m;for(c=2;cg;++g){h=e.HelioVector(a,l);c&&(d=w(t.Earth,l));k=new r(h.x-d.x,h.y-d.y,h.z-d.z,b);if("Sun"===a)return k;var m=b.AddDays(-k.Length()/173.1446326846693);h=Math.abs(m.tt-l.tt);if(1E-9>h)return k;l=m}throw"Light-travel time solver did not converge: dt="+h;};e.Search=function(a,b,c,d){var h=Math.abs((d&&d.dt_tolerance_seconds||1)/86400),k=d&&d.init_f1||a(b),l=d&&d.init_f2||a(c),g,m=0;d=d&&d.iter_limit||20;for(var f= +!0;;){if(++m>d)throw"Excessive iteration in Search()";var n=new x(b.ut+.5*(c.ut-b.ut)),p=n.ut-b.ut;if(Math.abs(p)(p.ut-b.ut)*(p.ut-c.ut)&&0>(r.ut-b.ut)*(r.ut-c.ut))){q=a(p);var u=a(r);if(0>q&&0<=u){k=q;l=u;b=p;c=r;g=t;f=!1;continue}}}}if(0>k&&0<=g)c=n,l=g;else if(0>g&&0<=l)b=n,k=g;else return null}}; +e.SearchSunLongitude=function(a,b,c){b=e.MakeTime(b);c=b.AddDays(c);return e.Search(function(b){b=e.SunPosition(b);return I(b.elon-a)},b,c)};e.LongitudeFromSun=function(a,b){if("Earth"===a)throw"The Earth does not have a longitude as seen from itself.";b=e.MakeTime(b);a=e.GeoVector(a,b,!0);a=e.Ecliptic(a.x,a.y,a.z);b=e.GeoVector("Sun",b,!0);b=e.Ecliptic(b.x,b.y,b.z);for(b=a.elon-b.elon;0>b;)b+=360;for(;360<=b;)b-=360;return b};e.AngleFromSun=function(a,b){if("Earth"==a)throw"The Earth does not have an angle as seen from itself."; +var c=e.GeoVector("Sun",b,!0);a=e.GeoVector(a,b,!0);return v(c,a)};e.EclipticLongitude=function(a,b){if("Sun"===a)throw"Cannot calculate heliocentric longitude of the Sun.";a=e.HelioVector(a,b);return e.Ecliptic(a.x,a.y,a.z).elon};var Ca=function(a,b,c,d,e,k,l,g){this.time=a;this.mag=b;this.phase_angle=c;this.phase_fraction=(1+Math.cos(.017453292519943295*c))/2;this.helio_dist=d;this.geo_dist=e;this.gc=k;this.hc=l;this.ring_tilt=g};e.Illumination=function(a,b){if("Earth"===a)throw"The illumination of the Earth is not defined."; +var c=e.MakeTime(b),d=w(t.Earth,c);if("Sun"===a){var h=new r(-d.x,-d.y,-d.z,c);b=new r(0,0,0,c);d=0}else"Moon"===a?(h=e.GeoMoon(c),b=new r(d.x+h.x,d.y+h.y,d.z+h.z,c)):(b=e.HelioVector(a,b),h=new r(b.x-d.x,b.y-d.y,b.z-d.z,c)),d=v(h,b);var k=h.Length(),l=b.Length(),g=null;if("Sun"===a)a=ya+5*Math.log10(k);else if("Moon"===a){a=.017453292519943295*d;var m=a*a;a=-12.717+1.49*Math.abs(a)+.0431*m*m;a+=5*Math.log10(k/.002573570052980638*l)}else if("Saturn"===a)a=d,g=e.Ecliptic(h.x,h.y,h.z),m=.017453292519943295* +g.elat,g=Math.asin(Math.sin(m)*Math.cos(.4897393881096089)-Math.cos(m)*Math.sin(.4897393881096089)*Math.sin(.017453292519943295*g.elon-.017453292519943295*(169.51+3.82E-5*c.tt))),m=Math.sin(Math.abs(g)),a=-9+.044*a+m*(-2.6+1.2*m)+5*Math.log10(l*k),g*=57.29577951308232;else{var f=m=0,n=0;switch(a){case "Mercury":a=-.6;m=4.98;f=-4.88;n=3.02;break;case "Venus":163.6>d?(a=-4.47,m=1.03,f=.57,n=.13):(a=.98,m=-1.02);break;case "Mars":a=-1.52;m=1.6;break;case "Jupiter":a=-9.4;m=.5;break;case "Uranus":a=-7.19; +m=.25;break;case "Neptune":a=-6.87;break;case "Pluto":a=-1;m=4;break;default:throw"VisualMagnitude: unsupported body "+a;}var p=d/100;a=a+p*(m+p*(f+p*n))+5*Math.log10(l*k)}return new Ca(c,a,d,l,k,h,b,g)};e.SearchRelativeLongitude=function(a,b,c){function d(c){var d=e.EclipticLongitude(a,c);c=e.EclipticLongitude("Earth",c);return I(k*(c-d)-b)}var h=z[a];if(!h)throw"Cannot search relative longitude because body is not a planet: "+a;if("Earth"===a)throw"Cannot search relative longitude for the Earth (it is always 0)"; +var k=h.OrbitalPeriod>z.Earth.OrbitalPeriod?1:-1;h=G(a);c=e.MakeTime(c);var l=d(c);0g;++g){var m=-l/360*h;c=c.AddDays(m);if(1>86400*Math.abs(m))return c;m=l;l=d(c);30>Math.abs(m)&&m!==l&&(m/=m-l,.5m&&(h*=m))}throw"Relative longitude search failed to converge for "+a+" near "+c.toString()+" (error_angle = "+l+").";};e.MoonPhase=function(a){return e.LongitudeFromSun("Moon",a)};e.SearchMoonPhase=function(a,b,c){function d(b){b=e.MoonPhase(b);return I(b-a)}b=e.MakeTime(b); +var h=d(b);0c)return null;c=Math.min(c,k+.9);h=b.AddDays(h);b=b.AddDays(c);return e.Search(d,h,b)};var Da=function(a,b){this.quarter=a;this.time=b};e.SearchMoonQuarter=function(a){var b=e.MoonPhase(a);b=(Math.floor(b/90)+1)%4;return(a=e.SearchMoonPhase(90*b,a,10))&&new Da(b,a)};e.NextMoonQuarter=function(a){a=new Date(a.time.date.getTime()+5184E5);return e.SearchMoonQuarter(a)};e.SearchRiseSet=function(a,b,c,d,h){function k(d){var f=e.Equator(a,d, +b,!0,!0);d=e.Horizon(d,b,f.ra,f.dec).altitude+l/f.dist*57.29577951308232+za;return c*d}var l={Sun:.0046504672612422675,Moon:1.1618480877914597E-5}[a]||0;if("Earth"===a)throw"Cannot find rise or set time of the Earth.";if(1===c){var g=12;var m=0}else if(-1===c)g=0,m=12;else throw"Astronomy.SearchRiseSet: Invalid direction parameter "+c+" -- must be +1 or -1";d=e.MakeTime(d);var f=k(d);var n;if(0= +f&&0=d.ut+h)return null;p=f.time;f=k(f.time);n=k(q.time)}};var Ea=function(a,b){this.time=a;this.hor=b};e.SearchHourAngle=function(a,b,c,d){d=e.MakeTime(d);var h=0;if("Earth"===a)throw"Cannot search for hour angle of the Earth.";if(0>c||24<=c)throw"Invalid hour angle "+c;for(;;){++h;var k=K(d),l=e.Equator(a,d,b,!0,!0);k=(c+l.ra-b.longitude/15-k)%24;1===h?0>k&& +(k+=24):-12>k?k+=24:123600*Math.abs(k))return a=e.Horizon(d,b,l.ra,l.dec,"normal"),new Ea(d,a);d=d.AddDays(k/24*.9972695717592592)}};var Fa=function(a,b,c,d){this.mar_equinox=a;this.jun_solstice=b;this.sep_equinox=c;this.dec_solstice=d};e.Seasons=function(a){function b(b,c,d){c=new Date(Date.UTC(a,c-1,d));b=e.SearchSunLongitude(b,c,4);if(!b)throw"Cannot find season change near "+c.toISOString();return b}a instanceof Date&&(a=a.getUTCFullYear());var c=b(0,3,19),d=b(90,6,19),h=b(180, +9,21),k=b(270,12,20);return new Fa(c,d,h,k)};var Ga=function(a,b,c,d){this.time=a;this.visibility=b;this.elongation=c;this.ecliptic_separation=d};e.Elongation=function(a,b){b=e.MakeTime(b);var c=e.LongitudeFromSun(a,b);if(180=++h;){var k=e.EclipticLongitude(a,b),l=e.EclipticLongitude("Earth",b);l=I(k-l);var g=k=void 0,m=g=k=void 0;l>=-d.s1&&l<+d.s1?(m=0,k=+d.s1,g=+d.s2):l>=+d.s2||l<-d.s2?(m=0,k=-d.s2,g=-d.s1):0<=l?(m=-G(a)/4,k=+d.s1,g=+d.s2):(m=-G(a)/4,k=-d.s2,g=-d.s1);l=b.AddDays(m);k=e.SearchRelativeLongitude(a,k,l);g=e.SearchRelativeLongitude(a,g,k);l=c(k);if(0<=l)throw"SearchMaxElongation: internal error: m1 = "+ +l;m=c(g);if(0>=m)throw"SearchMaxElongation: internal error: m2 = "+m;l=e.Search(c,k,g,{init_f1:l,init_f2:m,dt_tolerance_seconds:10});if(!l)throw"SearchMaxElongation: failed search iter "+h+" (t1="+k.toString()+", t2="+g.toString()+")";if(l.tt>=b.tt)return e.Elongation(a,l);b=g.AddDays(1)}throw"SearchMaxElongation: failed to find event after 2 tries.";};e.SearchPeakMagnitude=function(a,b){function c(b){var c=b.AddDays(-.005);b=b.AddDays(.005);c=e.Illumination(a,c).mag;return(e.Illumination(a,b).mag- +c)/.01}if("Venus"!==a)throw"SearchPeakMagnitude currently works for Venus only.";b=e.MakeTime(b);for(var d=0;2>=++d;){var h=e.EclipticLongitude(a,b),k=e.EclipticLongitude("Earth",b);k=I(h-k);var l=h=void 0,g=l=h=void 0;-10<=k&&10>k?(g=0,h=10,l=30):30<=k||-30>k?(g=0,h=-30,l=-10):0<=k?(g=-G(a)/4,h=10,l=30):(g=-G(a)/4,h=-30,l=-10);k=b.AddDays(g);h=e.SearchRelativeLongitude(a,h,k);l=e.SearchRelativeLongitude(a,l,h);k=c(h);if(0<=k)throw"SearchPeakMagnitude: internal error: m1 = "+k;g=c(l);if(0>=g)throw"SearchPeakMagnitude: internal error: m2 = "+ +g;k=e.Search(c,h,l,{init_f1:k,init_f2:g,dt_tolerance_seconds:10});if(!k)throw"SearchPeakMagnitude: failed search iter "+d+" (t1="+h.toString()+", t2="+l.toString()+")";if(k.tt>=b.tt)return e.Illumination(a,k);b=l.AddDays(1)}throw"SearchPeakMagnitude: failed to find event after 2 tries.";};var R=function(a,b,c){this.time=a;this.kind=b;this.dist_au=c;this.dist_km=1.4959787069098932E8*c};e.SearchLunarApsis=function(a){function b(a){var b=a.AddDays(-5E-4);a=a.AddDays(5E-4);b=C(b).distance_au;return(C(a).distance_au- +b)/.001}function c(a){return-b(a)}a=e.MakeTime(a);for(var d=b(a),h=0;59.061176>5*h;++h){var k=a.AddDays(5),l=b(k);if(0>=d*l){if(0>d||0l){a=e.Search(c,a,k,{init_f1:-d,init_f2:-l});if(null==a)throw"SearchLunarApsis INTERNAL ERROR: apogee search failed!";d=C(a).distance_au;return new R(a,1,d)}throw"SearchLunarApsis INTERNAL ERROR: cannot classify apsis event!"; +}a=k;d=l}throw"SearchLunarApsis INTERNAL ERROR: could not find apsis within 2 synodic months of start date.";};e.NextLunarApsis=function(a){var b=e.SearchLunarApsis(a.time.AddDays(11));if(1!==b.kind+a.kind)throw"NextLunarApsis INTERNAL ERROR: did not find alternating apogee/perigee: prev="+a.kind+" @ "+a.time.toString()+", next="+b.kind+" @ "+b.time.toString();return b};e.SearchPlanetApsis=function(a,b){function c(b){var c=b.AddDays(-5E-4);b=b.AddDays(5E-4);c=e.HelioDistance(a,c);return(e.HelioDistance(a, +b)-c)/.001}function d(a){return-c(a)}if("Neptune"===a)return ua(b);for(var h=z[a].OrbitalPeriod,k=h/6,l=c(b),g=0;g*k<2*h;++g){var m=b.AddDays(k),f=c(m);if(0>=l*f){h=k=void 0;if(0>l||0f)k=d,h=1;else throw"Internal error with slopes in SearchPlanetApsis";b=e.Search(k,b,m,1);if(null==b)throw"Failed to find slope transition in planetary apsis search.";l=e.HelioDistance(a,b);return new R(b,h,l)}b=m;l=f}throw"Internal error: should have found planetary apsis within 2 orbital periods."; +};e.NextPlanetApsis=function(a,b){if(0!==b.kind&&1!==b.kind)throw"Invalid apsis kind: "+b.kind;var c=b.time.AddDays(.25*z[a].OrbitalPeriod);a=e.SearchPlanetApsis(a,c);if(1!==a.kind+b.kind)throw"Internal error: previous apsis was "+b.kind+", but found "+a.kind+" for next apsis.";return a};e.InverseRotation=function(a){return new B([[a.rot[0][0],a.rot[1][0],a.rot[2][0]],[a.rot[0][1],a.rot[1][1],a.rot[2][1]],[a.rot[0][2],a.rot[1][2],a.rot[2][2]]])};e.CombineRotation=function(a,b){return new B([[b.rot[0][0]* +a.rot[0][0]+b.rot[1][0]*a.rot[0][1]+b.rot[2][0]*a.rot[0][2],b.rot[0][1]*a.rot[0][0]+b.rot[1][1]*a.rot[0][1]+b.rot[2][1]*a.rot[0][2],b.rot[0][2]*a.rot[0][0]+b.rot[1][2]*a.rot[0][1]+b.rot[2][2]*a.rot[0][2]],[b.rot[0][0]*a.rot[1][0]+b.rot[1][0]*a.rot[1][1]+b.rot[2][0]*a.rot[1][2],b.rot[0][1]*a.rot[1][0]+b.rot[1][1]*a.rot[1][1]+b.rot[2][1]*a.rot[1][2],b.rot[0][2]*a.rot[1][0]+b.rot[1][2]*a.rot[1][1]+b.rot[2][2]*a.rot[1][2]],[b.rot[0][0]*a.rot[2][0]+b.rot[1][0]*a.rot[2][1]+b.rot[2][0]*a.rot[2][2],b.rot[0][1]* +a.rot[2][0]+b.rot[1][1]*a.rot[2][1]+b.rot[2][1]*a.rot[2][2],b.rot[0][2]*a.rot[2][0]+b.rot[1][2]*a.rot[2][1]+b.rot[2][2]*a.rot[2][2]]])};e.VectorFromSphere=function(a,b){var c=.017453292519943295*a.lat,d=.017453292519943295*a.lon,e=a.dist*Math.cos(c);return new r(e*Math.cos(d),e*Math.sin(d),a.dist*Math.sin(c),b)};e.VectorFromEquator=function(a,b){return e.VectorFromSphere(new U(a.dec,15*a.ra,a.dist),b)};e.EquatorFromVector=function(a){a=e.SphereFromVector(a);return new Z(a.lon/15,a.lat,a.dist)};e.SphereFromVector= +function(a){var b=a.x*a.x+a.y*a.y,c=Math.sqrt(b+a.z*a.z);if(0===b){if(0===a.z)throw"Zero-length vector not allowed.";var d=0;a=0>a.z?-90:90}else d=57.29577951308232*Math.atan2(a.y,a.x),0>d&&(d+=360),a=57.29577951308232*Math.atan2(a.z,Math.sqrt(b));return new U(a,d,c)};e.HorizonFromVector=function(a,b){a=e.SphereFromVector(a);a.lon=ka(a.lon);a.lat+=e.Refraction(b,a.lat);return a};e.VectorFromHorizon=function(a,b,c){var d=ka(a.lon);c=a.lat+e.InverseRefraction(c,a.lat);a=new U(c,d,a.dist);return e.VectorFromSphere(a, +b)};e.Refraction=function(a,b){if(-90>b||90c&&(c=-1);c=1.02/Math.tan(.017453292519943295*(c+10.3/(c+5.11)))/60;"normal"===a&&-1>b&&(c*=(b+90)/89)}else c=0;return c};e.InverseRefraction=function(a,b){if(-90>b||90Math.abs(d))return c-b;c-=d}};e.RotateVector=function(a,b){return new r(a.rot[0][0]*b.x+a.rot[1][0]*b.y+a.rot[2][0]*b.z,a.rot[0][1]*b.x+a.rot[1][1]*b.y+a.rot[2][1]* +b.z,a.rot[0][2]*b.x+a.rot[1][2]*b.y+a.rot[2][2]*b.z,b.t)};e.Rotation_EQJ_ECL=function(){return new B([[1,0,0],[0,.9174821430670688,-.3977769691083922],[0,.3977769691083922,.9174821430670688]])};e.Rotation_ECL_EQJ=function(){return new B([[1,0,0],[0,.9174821430670688,.3977769691083922],[0,-.3977769691083922,.9174821430670688]])};e.Rotation_EQJ_EQD=function(a){var b=W(0,a.tt);a=Y(a,0);return e.CombineRotation(b,a)};e.Rotation_EQD_EQJ=function(a){var b=Y(a,1);a=W(a.tt,0);return e.CombineRotation(b,a)}; +e.Rotation_EQD_HOR=function(a,b){var c=Math.sin(.017453292519943295*b.latitude),d=Math.cos(.017453292519943295*b.latitude),e=Math.sin(.017453292519943295*b.longitude),k=Math.cos(.017453292519943295*b.longitude);b=[d*k,d*e,c];c=[-c*k,-c*e,d];e=[e,-k,0];a=-15*K(a);b=D(a,b);c=D(a,c);a=D(a,e);return new B([[c[0],a[0],b[0]],[c[1],a[1],b[1]],[c[2],a[2],b[2]]])};e.Rotation_HOR_EQD=function(a,b){a=e.Rotation_EQD_HOR(a,b);return e.InverseRotation(a)};e.Rotation_HOR_EQJ=function(a,b){b=e.Rotation_HOR_EQD(a, +b);a=e.Rotation_EQD_EQJ(a);return e.CombineRotation(b,a)};e.Rotation_EQJ_HOR=function(a,b){a=e.Rotation_HOR_EQJ(a,b);return e.InverseRotation(a)};e.Rotation_EQD_ECL=function(a){a=e.Rotation_EQD_EQJ(a);var b=e.Rotation_EQJ_ECL();return e.CombineRotation(a,b)};e.Rotation_ECL_EQD=function(a){a=e.Rotation_EQD_ECL(a);return e.InverseRotation(a)};e.Rotation_ECL_HOR=function(a,b){var c=e.Rotation_ECL_EQD(a);a=e.Rotation_EQD_HOR(a,b);return e.CombineRotation(c,a)};e.Rotation_HOR_ECL=function(a,b){a=e.Rotation_ECL_HOR(a, +b);return e.InverseRotation(a)};var Ha=[["And","Andromeda"],["Ant","Antila"],["Aps","Apus"],["Aql","Aquila"],["Aqr","Aquarius"],["Ara","Ara"],["Ari","Aries"],["Aur","Auriga"],["Boo","Bootes"],["Cae","Caelum"],["Cam","Camelopardis"],["Cap","Capricornus"],["Car","Carina"],["Cas","Cassiopeia"],["Cen","Centaurus"],["Cep","Cepheus"],["Cet","Cetus"],["Cha","Chamaeleon"],["Cir","Circinus"],["CMa","Canis Major"],["CMi","Canis Minor"],["Cnc","Cancer"],["Col","Columba"],["Com","Coma Berenices"],["CrA","Corona Australis"], +["CrB","Corona Borealis"],["Crt","Crater"],["Cru","Crux"],["Crv","Corvus"],["CVn","Canes Venatici"],["Cyg","Cygnus"],["Del","Delphinus"],["Dor","Dorado"],["Dra","Draco"],["Equ","Equuleus"],["Eri","Eridanus"],["For","Fornax"],["Gem","Gemini"],["Gru","Grus"],["Her","Hercules"],["Hor","Horologium"],["Hya","Hydra"],["Hyi","Hydrus"],["Ind","Indus"],["Lac","Lacerta"],["Leo","Leo"],["Lep","Lepus"],["Lib","Libra"],["LMi","Leo Minor"],["Lup","Lupus"],["Lyn","Lynx"],["Lyr","Lyra"],["Men","Mensa"],["Mic","Microscopium"], +["Mon","Monoceros"],["Mus","Musca"],["Nor","Norma"],["Oct","Octans"],["Oph","Ophiuchus"],["Ori","Orion"],["Pav","Pavo"],["Peg","Pegasus"],["Per","Perseus"],["Phe","Phoenix"],["Pic","Pictor"],["PsA","Pisces Austrinus"],["Psc","Pisces"],["Pup","Puppis"],["Pyx","Pyxis"],["Ret","Reticulum"],["Scl","Sculptor"],["Sco","Scorpius"],["Sct","Scutum"],["Ser","Serpens"],["Sex","Sextans"],["Sge","Sagitta"],["Sgr","Sagittarius"],["Tau","Taurus"],["Tel","Telescopium"],["TrA","Triangulum Australe"],["Tri","Triangulum"], +["Tuc","Tucana"],["UMa","Ursa Major"],["UMi","Ursa Minor"],["Vel","Vela"],["Vir","Virgo"],["Vol","Volans"],["Vul","Vulpecula"]],Ia=[[83,0,8640,2112],[83,2880,5220,2076],[83,7560,8280,2068],[83,6480,7560,2064],[15,0,2880,2040],[10,3300,3840,1968],[15,0,1800,1920],[10,3840,5220,1920],[83,6300,6480,1920],[33,7260,7560,1920],[15,0,1263,1848],[10,4140,4890,1848],[83,5952,6300,1800],[15,7260,7440,1800],[10,2868,3300,1764],[33,3300,4080,1764],[83,4680,5952,1680],[13,1116,1230,1632],[33,7350,7440,1608],[33, +4080,4320,1596],[15,0,120,1584],[83,5040,5640,1584],[15,8490,8640,1584],[33,4320,4860,1536],[33,4860,5190,1512],[15,8340,8490,1512],[10,2196,2520,1488],[33,7200,7350,1476],[15,7393.2,7416,1462],[10,2520,2868,1440],[82,2868,3030,1440],[33,7116,7200,1428],[15,7200,7393.2,1428],[15,8232,8340,1418],[13,0,876,1404],[33,6990,7116,1392],[13,612,687,1380],[13,876,1116,1368],[10,1116,1140,1368],[15,8034,8232,1350],[10,1800,2196,1344],[82,5052,5190,1332],[33,5190,6990,1332],[10,1140,1200,1320],[15,7968,8034, +1320],[15,7416,7908,1316],[13,0,612,1296],[50,2196,2340,1296],[82,4350,4860,1272],[33,5490,5670,1272],[15,7908,7968,1266],[10,1200,1800,1260],[13,8232,8400,1260],[33,5670,6120,1236],[62,735,906,1212],[33,6120,6564,1212],[13,0,492,1200],[62,492,600,1200],[50,2340,2448,1200],[13,8400,8640,1200],[82,4860,5052,1164],[13,0,402,1152],[13,8490,8640,1152],[39,6543,6564,1140],[33,6564,6870,1140],[30,6870,6900,1140],[62,600,735,1128],[82,3030,3300,1128],[13,60,312,1104],[82,4320,4350,1080],[50,2448,2652,1068], +[30,7887,7908,1056],[30,7875,7887,1050],[30,6900,6984,1044],[82,3300,3660,1008],[82,3660,3882,960],[8,5556,5670,960],[39,5670,5880,960],[50,3330,3450,954],[0,0,906,882],[62,906,924,882],[51,6969,6984,876],[62,1620,1689,864],[30,7824,7875,864],[44,7875,7920,864],[7,2352,2652,852],[50,2652,2790,852],[0,0,720,840],[44,7920,8214,840],[44,8214,8232,828],[0,8232,8460,828],[62,924,978,816],[82,3882,3960,816],[29,4320,4440,816],[50,2790,3330,804],[48,3330,3558,804],[0,258,507,792],[8,5466,5556,792],[0,8460, +8550,770],[29,4440,4770,768],[0,8550,8640,752],[29,5025,5052,738],[80,870,978,736],[62,978,1620,736],[7,1620,1710,720],[51,6543,6969,720],[82,3960,4320,696],[30,7080,7530,696],[7,1710,2118,684],[48,3558,3780,684],[29,4770,5025,684],[0,0,24,672],[80,507,600,672],[7,2118,2352,672],[37,2838,2880,672],[30,7530,7824,672],[30,6933,7080,660],[80,690,870,654],[25,5820,5880,648],[8,5430,5466,624],[25,5466,5820,624],[51,6612,6792,624],[48,3870,3960,612],[51,6792,6933,612],[80,600,690,600],[66,258,306,570], +[48,3780,3870,564],[87,7650,7710,564],[77,2052,2118,548],[0,24,51,528],[73,5730,5772,528],[37,2118,2238,516],[87,7140,7290,510],[87,6792,6930,506],[0,51,306,504],[87,7290,7404,492],[37,2811,2838,480],[87,7404,7650,468],[87,6930,7140,460],[6,1182,1212,456],[75,6792,6840,444],[59,2052,2076,432],[37,2238,2271,420],[75,6840,7140,388],[77,1788,1920,384],[39,5730,5790,384],[75,7140,7290,378],[77,1662,1788,372],[77,1920,2016,372],[23,4620,4860,360],[39,6210,6570,344],[23,4272,4620,336],[37,2700,2811,324], +[39,6030,6210,308],[61,0,51,300],[77,2016,2076,300],[37,2520,2700,300],[61,7602,7680,300],[37,2271,2496,288],[39,6570,6792,288],[31,7515,7578,284],[61,7578,7602,284],[45,4146,4272,264],[59,2247,2271,240],[37,2496,2520,240],[21,2811,2853,240],[61,8580,8640,240],[6,600,1182,238],[31,7251,7308,204],[8,4860,5430,192],[61,8190,8580,180],[21,2853,3330,168],[45,3330,3870,168],[58,6570,6718.4,150],[3,6718.4,6792,150],[31,7500,7515,144],[20,2520,2526,132],[73,6570,6633,108],[39,5790,6030,96],[58,6570,6633, +72],[61,7728,7800,66],[66,0,720,48],[73,6690,6792,48],[31,7308,7500,48],[34,7500,7680,48],[61,7680,7728,48],[61,7920,8190,48],[61,7800,7920,42],[20,2526,2592,36],[77,1290,1662,0],[59,1662,1680,0],[20,2592,2910,0],[85,5280,5430,0],[58,6420,6570,0],[16,954,1182,-42],[77,1182,1290,-42],[73,5430,5856,-78],[59,1680,1830,-96],[59,2100,2247,-96],[73,6420,6468,-96],[73,6570,6690,-96],[3,6690,6792,-96],[66,8190,8580,-96],[45,3870,4146,-144],[85,4146,4260,-144],[66,0,120,-168],[66,8580,8640,-168],[85,5130, +5280,-192],[58,5730,5856,-192],[3,7200,7392,-216],[4,7680,7872,-216],[58,6180,6468,-240],[54,2100,2910,-264],[35,1770,1830,-264],[59,1830,2100,-264],[41,2910,3012,-264],[74,3450,3870,-264],[85,4260,4620,-264],[58,6330,6360,-280],[3,6792,7200,-288.8],[35,1740,1770,-348],[4,7392,7680,-360],[73,6180,6570,-384],[72,6570,6792,-384],[41,3012,3090,-408],[58,5856,5895,-438],[41,3090,3270,-456],[26,3870,3900,-456],[71,5856,5895,-462],[47,5640,5730,-480],[28,4530,4620,-528],[85,4620,5130,-528],[41,3270,3510, +-576],[16,600,954,-585.2],[35,954,1350,-585.2],[26,3900,4260,-588],[28,4260,4530,-588],[47,5130,5370,-588],[58,5856,6030,-590],[16,0,600,-612],[11,7680,7872,-612],[4,7872,8580,-612],[16,8580,8640,-612],[41,3510,3690,-636],[35,1692,1740,-654],[46,1740,2202,-654],[11,7200,7680,-672],[41,3690,3810,-700],[41,4530,5370,-708],[47,5370,5640,-708],[71,5640,5760,-708],[35,1650,1692,-720],[58,6030,6336,-720],[76,6336,6420,-720],[41,3810,3900,-748],[19,2202,2652,-792],[41,4410,4530,-792],[41,3900,4410,-840], +[36,1260,1350,-864],[68,3012,3372,-882],[35,1536,1650,-888],[76,6420,6900,-888],[65,7680,8280,-888],[70,8280,8400,-888],[36,1080,1260,-950],[1,3372,3960,-954],[70,0,600,-960],[36,600,1080,-960],[35,1392,1536,-960],[70,8400,8640,-960],[14,5100,5370,-1008],[49,5640,5760,-1008],[71,5760,5911.5,-1008],[9,1740,1800,-1032],[22,1800,2370,-1032],[67,2880,3012,-1032],[35,1230,1392,-1056],[71,5911.5,6420,-1092],[24,6420,6900,-1092],[76,6900,7320,-1092],[53,7320,7680,-1092],[35,1080,1230,-1104],[9,1620,1740, +-1116],[49,5520,5640,-1152],[63,0,840,-1156],[35,960,1080,-1176],[40,1470,1536,-1176],[9,1536,1620,-1176],[38,7680,7920,-1200],[67,2160,2880,-1218],[84,2880,2940,-1218],[35,870,960,-1224],[40,1380,1470,-1224],[63,0,660,-1236],[12,2160,2220,-1260],[84,2940,3042,-1272],[40,1260,1380,-1276],[32,1380,1440,-1276],[63,0,570,-1284],[35,780,870,-1296],[64,1620,1800,-1296],[49,5418,5520,-1296],[84,3042,3180,-1308],[12,2220,2340,-1320],[14,4260,4620,-1320],[49,5100,5418,-1320],[56,5418,5520,-1320],[32,1440, +1560,-1356],[84,3180,3960,-1356],[14,3960,4050,-1356],[5,6300,6480,-1368],[78,6480,7320,-1368],[38,7920,8400,-1368],[40,1152,1260,-1380],[64,1800,1980,-1380],[12,2340,2460,-1392],[63,0,480,-1404],[35,480,780,-1404],[63,8400,8640,-1404],[32,1560,1650,-1416],[56,5520,5911.5,-1440],[43,7320,7680,-1440],[64,1980,2160,-1464],[18,5460,5520,-1464],[5,5911.5,5970,-1464],[18,5370,5460,-1526],[5,5970,6030,-1526],[64,2160,2460,-1536],[12,2460,3252,-1536],[14,4050,4260,-1536],[27,4260,4620,-1536],[14,4620,5232, +-1536],[18,4860,4920,-1560],[5,6030,6060,-1560],[40,780,1152,-1620],[69,1152,1650,-1620],[18,5310,5370,-1620],[5,6060,6300,-1620],[60,6300,6480,-1620],[81,7920,8400,-1620],[32,1650,2370,-1680],[18,4920,5310,-1680],[79,5310,6120,-1680],[81,0,480,-1800],[42,1260,1650,-1800],[86,2370,3252,-1800],[12,3252,4050,-1800],[55,4050,4920,-1800],[60,6480,7680,-1800],[43,7680,8400,-1800],[81,8400,8640,-1800],[81,270,480,-1824],[42,0,1260,-1980],[17,2760,4920,-1980],[2,4920,6480,-1980],[52,1260,2760,-2040],[57, +0,8640,-2160]],da,qa,Ja=function(a,b,c,d){this.symbol=a;this.name=b;this.ra1875=c;this.dec1875=d};e.Constellation=function(a,b){if(-90>b||90a&&(a+=24);da||(da=e.Rotation_EQJ_EQD(new x(-45655.74141261017)),qa=new x(0));a=new Z(a,b,1);a=e.VectorFromEquator(a,qa);a=e.RotateVector(da,a);a=e.EquatorFromVector(a);b=10/240;for(var c=b/15,d=$jscomp.makeIterator(Ia),h=d.next();!h.done;h=d.next()){h=h.value;var k=h[1]*c,l=h[2]*c;if(h[3]*b<=a.dec&& +k<=a.ra&&a.rab;++b){var c=e.SearchMoonPhase(180,a,40);if(null===c)throw"Cannot find full moon.";a=C(c);if(1.8>57.29577951308232* +Math.abs(a.geo_eclip_lat)&&(a=wa(c),a.rb;++b){var c=e.SearchMoonPhase(0,a,40);if(null===c)throw"Cannot find new moon";a=C(c);if(1.8>57.29577951308232*Math.abs(a.geo_eclip_lat)&&(a=xa(c),a.r=d?d+=360:180a.r)throw"Unexpected shadow distance from geoid intersection = "+a.r;k=.014