Replies: 1 comment 1 reply
-
Hi @2075! Sorry it took so long to get back to you. My work life has been bonkers lately! One of the issues you will find is that ideas like "years" and "days" are intuitive but imprecise. For example, planets only "sort of" orbit the Sun. In practice, the Sun is wobbling around too, mostly being tugged on by Jupiter and Saturn. As planets move around in the solar system, they make an approximate ellipse shape that never quite matches up where it was last time. Thus there are different ways to define a planet's year. Which definition is "right" is an opinion, not a fact of nature. For example, take the planet Neptune. If you ask when it is at perihelion, it turns out to be a messy thing because the Sun wobbles around faster than Neptune orbits. This means there are several times in Neptune's year when it is "closest" to the Sun, in terms of having a locally minimum distance. Therefore, without knowing what your real goal/motivation is, I would guess you will get better results using ecliptic longitude (the angle around the Sun) as your measuring stick for deciding when a new orbit/year begins. I don't currently have a function that searches for when a planet crosses a given ecliptic longitude. However, I do have the eclipticLongitude function, which will tell you what the ecliptic longitude of a planet is around the Sun's center. You may be able to use that to search for when the planet crosses a given longitude. A good choice would be 180 degrees, since that is as far as possible as the ugly discontinuity from 359.999... degrees to 0 degrees. So that would take care of planetary years. About a planet's days... this is simpler, and then you have to ask whether you want solar days or sidereal days. On Earth, what we commonly call a day is a solar day, the time it takes for the Sun to roughly reach the same position in the sky, averaged over an entire year. A sidereal day is how long it takes for a distant star to come back to the same position in the observer's sky. The difference is a planet can orbit the Sun by a significant angle over one of its rotations, thus making solar and sidereal days different. For example, on Earth a sidereal day is about 4 minutes shorter than a solar day. The extra 4 minutes is how long it takes the Earth to rotate slightly more than 360 degrees so that it once again faces the new direction of the Sun. If you take a look at the code for rotationAxis, you can see that the I hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Hi there!
I found your awesome library and use it in a Kotlin application and have some questions, maybe you are able to direct me towards a solution. Sorry in advance for my noob questions.
I would like to calculate the total solar days and solar days passed in a year of a planet (
planetOrbitalPeriod
?), where a day is full rotation of itself and a year a full orbit around the sun. Is this possible to achieve with the current lib? I saw some references in the docs, but nothing like a function call like getTotalDays(body) or getCurrentDay(body). Atm I believe I have to manually calculate based on pericenter/apocenter results of thesearchPlanetApsis
result?I would like to calculate the direction of a planet from a given local Observer position on earth. Is
horizontal
the correct approach to retrieve the direction in degrees and the alltitude?D Earth 3187718.7326
. Would you mind to explain?Thanks in advance @cosinekitty :)!
Beta Was this translation helpful? Give feedback.
All reactions