Skip to content

saturnmoons, jupitermoons - add Z-coord output#40

Merged
commenthol merged 1 commit into
commenthol:masterfrom
dobriai:master
Aug 30, 2025
Merged

saturnmoons, jupitermoons - add Z-coord output#40
commenthol merged 1 commit into
commenthol:masterfrom
dobriai:master

Conversation

@dobriai
Copy link
Copy Markdown

@dobriai dobriai commented Aug 18, 2025

Add the Z-coordinate to the computed positions of the moons, so that transits, eclipses, occultations, and shadow transits can be more easily computed.

At this moment we do not know of any published "official" Z-values to check against, so we use whatever values would satisfy the test at the moment and hard-code them into the test files.

Add the `Z`-coordinate to the computed positions of the moons, so that
transits, eclipses, occultations, and shadow transits can be more easily
computed.

At this moment we do not know of any published "official" Z-values to
check against, so we use whatever values would satisfy the test at the
moment and hard-code them into the test files.
Copy link
Copy Markdown
Author

@dobriai dobriai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is all I can think of for now. Let know what next!

Comment thread src/base.js
* Result in seconds of time.
* @param {Number} dist - distance in to earth in AU
* @returns {Number} time for light to travel a given distance in seconds
* @returns {Number} time for light to travel a given distance in days
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the rest of the PR, of course. Just caught my eye. Somehow.

Comment thread src/jupitermoons.js
const r4 = 26.3627 - 0.1939 * cH
const sDE = Math.sin(DE)
const cDE = Math.cos(DE)
const xy = function (u, r) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This local function could also be renamed, but I decided to minimize the diffs, to make the PR easier to review. Cleanup could be done later. Or now, if you prefer.

Comment thread src/jupitermoons.js
const xy = function (u, r) {
const [su, cu] = base.sincos(u)
return new XY(r * su, -r * cu * sDE)
return new XYZ(r * su, -r * cu * sDE, -r * cu * cDE)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Z does not come entirely "for free" here. This is what I think that it should be based on the X and Y formulas on p.303, namely:

X = r * sin(u),   Y = -r * cos(u) * sin(D_e)

thus Z = -r * cos(u) * cos(D_e).

We have X^2 + Y^2 + Z^2 = r^2, which is good.

The sign should be negative, based on the statements "...Z is negative if the satellite is closer to Earth...", on pp.313 and 333.

Finally the values appear quite close to the high-precision ones, from the e5 calculations, which gives me the greatest comfort.

@commenthol commenthol merged commit c055751 into commenthol:master Aug 30, 2025
3 checks passed
@commenthol
Copy link
Copy Markdown
Owner

@dobriai Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants