diff --git a/src/app/features/body-detail/body-readouts.ts b/src/app/features/body-detail/body-readouts.ts index 82ff9a7..27b4b2e 100644 --- a/src/app/features/body-detail/body-readouts.ts +++ b/src/app/features/body-detail/body-readouts.ts @@ -43,7 +43,9 @@ export function bodyReadouts(body: BodyDetailViewModel): BodyReadouts { measured.push({ label: 'Eccentricity', value: body.orbit.eccentricity.toFixed(3) }); } if (body.orbit.inclinationDeg !== undefined) { - measured.push({ label: 'Inclination', value: `${body.orbit.inclinationDeg.toFixed(2)}°` }); + // Its size: Standish fits Earth's as -0.00054 degrees, which is the same orbit as +0.00054 with + // the node half a turn round, and printed as it stands read "-0.00°". + measured.push({ label: 'Inclination', value: `${Math.abs(body.orbit.inclinationDeg).toFixed(2)}°` }); } // The period sits under whichever heading its provenance calls for. Same number, same field — // a published period is an observation and a computed one is not. diff --git a/src/app/features/body-detail/body-view-model.spec.ts b/src/app/features/body-detail/body-view-model.spec.ts index 8c96c22..999d6dd 100644 --- a/src/app/features/body-detail/body-view-model.spec.ts +++ b/src/app/features/body-detail/body-view-model.spec.ts @@ -68,6 +68,12 @@ describe('buildBodyViewModel', () => { expect(model?.orbitalPeriodDays).toBeCloseTo(27.32166, 5); }); + it('prints the size of an inclination fitted below zero, as the same orbit with its node turned half round', () => { + const tilted: BodyRecord = { ...earth, orbit: orbit({ inclinationDeg: -0.00054346 }) }; + const model = buildBodyViewModel('earth', { ...catalogues, bodies: [tilted] })!; + expect(bodyReadouts(model).measured.find((row) => row.label === 'Inclination')?.value).toBe('0.00°'); + }); + it('says where the orbit comes from, in the card’s provenance', () => { expect(bodyReadouts(buildBodyViewModel('luna', catalogues)!).provenance).toContain('Orbit: JPL SSD satellite mean elements, epoch 2000 Jan 1.'); });