Take TT - UT from the historical record before 1972, so the far dates the clock reaches turn every body by the right amount
The clock reaches AD 1, but TT - UT was held at today's 69.184 s. At AD 1000 it was 1 574 s and at AD 1 about 10 570 (Espenak and Meeus, NASA's Five Millennium Canon; Horizons' TDB - UT gives 1 658 and 10 466 on JD 2086455 and 1721600). So every spin but Earth's was (ΔT - 69 s) times its rate out, Jupiter 15.2 degrees at AD 1000 and 106 at AD 1, Mars 6 and 43, and every orbit that much behind: the Moon about 0.2 and 1.4 degrees. ttMinusUtSeconds gives TT - UT for a date on the clock: the Espenak-Meeus polynomials before 1972, 32.184 s plus UTC's leap seconds from 1972 to the last one, at the start of 2017, and 69.184 s held after it, as Horizons holds it. Its pieces join within 0.1 s. tdbFromUtc, which positions and spins already share, now adds it. Within 0.2 s of Horizons in 1950, 105 s at AD 1 and 86 s at AD 1000, where the historical record itself is that uncertain. Earth is the exception: its turning is what UT counts, so the clock's date already says how far it has turned, and ΔT would turn it again, 44 degrees at AD 1. Its W, fitted to today, keeps today's 69.184 s (bodyOrientation's followsUt, set for Earth in the system view and on its page). In the running app at 1000-01-01 00:00 UT, Jupiter's drawn prime meridian sits 0.000 degrees from its IAU W at TT and 15.164 from where the held offset put it; Earth's sits on its W at UT + 69.184 s, 6.288 degrees short of what TT would have turned it to. The renderer spec now hands its frozen Horizons vectors over as the UT dates that name them through the same TT - UT, and checks Jupiter's and Earth's prime meridians at AD 1000. Controls: the leap-second rule used before 1972 fails "follows the historical record before 1972"; TT - UT held at 69 s fails "turns Jupiter at AD 1000 by its W"; Earth turned at TDB, or the renderer or the page not keeping it on UT, fails the Earth tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import * as THREE from 'three/webgpu';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { TT_MINUS_UTC_DAYS } from '../astro/constants';
|
||||
import { tdbFromUtc } from '../astro/constants';
|
||||
import { eclipticToEquatorial } from '../astro/coordinates';
|
||||
import { meanElementsAt, positionAtEpoch } from '../astro/kepler';
|
||||
import { BodyRecord } from '../models/body.model';
|
||||
@@ -54,15 +54,18 @@ describe('bodyPageView', () => {
|
||||
expect(Math.abs(moon.latDeg - 1.503004)).toBeLessThan(0.05);
|
||||
});
|
||||
|
||||
it('takes the Sun where it stands at the same TDB instant the body is turned for', () => {
|
||||
// Earth's own sphere, turned as the system view turns it, and the Sun seen from Earth's mean
|
||||
// place at the clock's date taken to TDB: the page must light that same point of its map.
|
||||
const planet = new THREE.Quaternion();
|
||||
const sun = new THREE.Vector3();
|
||||
bodyPageView(EARTH, BODIES, JUNE_1_2025_NOON_UTC, SUN_AZIMUTH, planet, sun);
|
||||
const place = eclipticToEquatorial(positionAtEpoch(meanElementsAt(EARTH.orbit, EARTH.rates, JUNE_1_2025_NOON_UTC + TT_MINUS_UTC_DAYS)));
|
||||
const expected = new THREE.Vector3(-place.x, -place.y, -place.z).normalize().applyQuaternion(bodyOrientation(EARTH.rotationalElements!, JUNE_1_2025_NOON_UTC).invert());
|
||||
expect(sun.clone().applyQuaternion(planet.clone().invert()).angleTo(expected)).toBeLessThan(1e-9);
|
||||
it('takes the Sun where it stands at the same TDB instant the body is turned for, and Earth turned as the system view turns it', () => {
|
||||
// Earth's own sphere, turned as the system view turns it (by UT, see `bodyOrientation`), and
|
||||
// the Sun seen from Earth's mean place at the clock's date taken to TDB: the page must light that
|
||||
// same point of its map, today and at AD 1000, when TT was 1 574 s past UT.
|
||||
for (const jdUt of [JUNE_1_2025_NOON_UTC, 2086307.5]) {
|
||||
const planet = new THREE.Quaternion();
|
||||
const sun = new THREE.Vector3();
|
||||
bodyPageView(EARTH, BODIES, jdUt, SUN_AZIMUTH, planet, sun);
|
||||
const place = eclipticToEquatorial(positionAtEpoch(meanElementsAt(EARTH.orbit, EARTH.rates, tdbFromUtc(jdUt))));
|
||||
const expected = new THREE.Vector3(-place.x, -place.y, -place.z).normalize().applyQuaternion(bodyOrientation(EARTH.rotationalElements!, jdUt, undefined, true).invert());
|
||||
expect(sun.clone().applyQuaternion(planet.clone().invert()).angleTo(expected)).toBeLessThan(1e-9);
|
||||
}
|
||||
});
|
||||
|
||||
it('keeps the pole up and the Sun where the page’s light stands, turning the body under it', () => {
|
||||
|
||||
Reference in New Issue
Block a user