Read Mercury's obliquity in the arcminutes its Horizons page gives it in

Mercury's page states "Obliquity to orbit[1] = 2.11' +/- 0.1'", in arcminutes, where every other
page writes degrees. The pattern took the number alone, so bodies.json had Mercury tilted 2.11
degrees, sixty times too far, and the system view drew it that way. It now reads the arcminute
mark and divides by 60: 0.0352 degrees, against the 0.034 the IAU's pole for Mercury makes with
its orbit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-24 22:09:36 +02:00
co-authored by Claude Opus 5.5
parent 1d42be2ad5
commit ab7d454db1
3 changed files with 16 additions and 4 deletions
+8 -1
View File
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
import { extractGmKm3PerS2, extractRadiusKm, extractRotationPeriodHours, isTidallyLocked } from './horizons-page';
import { extractGmKm3PerS2, extractObliquityDeg, extractRadiusKm, extractRotationPeriodHours, isTidallyLocked } from './horizons-page';
// Lines as the Horizons pages print them.
const JUPITER = ` Vol. Mean Radius (km) = 69911+-6 Flattening = 0.06487
@@ -57,3 +57,10 @@ describe('Horizons page GM', () => {
expect(extractGmKm3PerS2(HYPERION)).toBeUndefined();
});
});
describe('Horizons page obliquity', () => {
it('reads the arcminutes Mercury gives its tilt in, and the degrees every other page uses', () => {
expect(extractObliquityDeg(" Obliquity to orbit[1] = 2.11' +/- 0.1' Hill's sphere rad. Rp = 94.4 ")).toBeCloseTo(2.11 / 60, 9);
expect(extractObliquityDeg(' Obliquity to orbit = 25.19 deg Max. angular diam. = 17.9"')).toBe(25.19);
});
});
+7 -2
View File
@@ -38,7 +38,8 @@ const ROTATION_PERIOD_PATTERNS = [
/Rotation(?:al)?\s*period[^=]*=\s*(-?[\d.]+)\s*(h|hr|hrs|d|day|days)\b/i
];
const SYNCHRONOUS_PATTERN = /Rotation(?:al)?\s*period\s*=?\s*:?\s*Synchronous/i;
const OBLIQUITY_PATTERN = /Obliquity\s*to\s*orbit[^=]*=\s*(-?[\d.]+)/i;
/** `25.19 deg` on most pages, `2.11' +/- 0.1'` in arcminutes on Mercury's. */
const OBLIQUITY_PATTERN = /Obliquity\s*to\s*orbit[^=]*=\s*(-?[\d.]+)\s*(')?/i;
/** `GM (km^3/s^2) = 106.10` on a moon's page, `GM (planet) km^3/s^2 = 869.326` on Pluto's. */
const GM_PATTERN = /GM\s*(?:\(planet\)\s*)?,?\s*\(?km\^3\/s\^2\)?\s*=\s*([\d.]+)/i;
@@ -74,9 +75,13 @@ export function extractRotationPeriodHours(text: string): number | undefined {
return undefined;
}
/**
* Tilt of the rotation axis from the orbit, in degrees. Mercury's page gives its tilt in
* arcminutes, which read as degrees made it 2.11 where the IAU's pole puts it at 0.034.
*/
export function extractObliquityDeg(text: string): number | undefined {
const match = text.match(OBLIQUITY_PATTERN);
return match ? Number(match[1]) : undefined;
return match ? Number(match[1]) / (match[2] ? 60 : 1) : undefined;
}
/**