mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-24 08:45:55 -04:00
Jupiter moons calculations are now consistent with Stellarium.
I translated the L1.2 FORTRAN code into C, and verified that the calculations match the Stellarium code I modified to produce EQJ coordinates. I still need to compare against JPL Horizons data.
This commit is contained in:
@@ -822,11 +822,13 @@ Given a rotation matrix that performs some coordinate transform, this function r
|
||||
<a name="Astronomy_JupiterMoons"></a>
|
||||
### Astronomy_JupiterMoons(time) ⇒ [`astro_jupiter_moons_t`](#astro_jupiter_moons_t)
|
||||
|
||||
**Calculates positions of Jupiter's largest 4 moons.**
|
||||
**Calculates jovicentric positions of Jupiter's largest 4 moons.**
|
||||
|
||||
|
||||
|
||||
Calculates jovicentric position vectors for Jupiter's moons Io, Europa, Ganymede, and Callisto, at the given date and time. See [`astro_jupiter_moons_t`](#astro_jupiter_moons_t) for more information about the representation of the position vectors.
|
||||
Calculates position vectors for Jupiter's moons Io, Europa, Ganymede, and Callisto, at the given date and time. The position vectors are jovicentric, meaning their coordinate origin is the center of Jupiter. Their orientation is the Earth's equatorial system at the J2000 epoch, called `EQJ`. The vector components are expressed in astronomical units (AU).
|
||||
|
||||
To convert to heliocentric vectors, call [`Astronomy_HelioVector`](#Astronomy_HelioVector) with `BODY_JUPITER` to get Jupiter's heliocentric position, then add the jovicentric vectors. Likewise, you can call [`Astronomy_GeoVector`](#Astronomy_GeoVector) with `BODY_JUPITER` to convert to geocentric vectors.
|
||||
|
||||
|
||||
|
||||
@@ -1232,6 +1234,31 @@ Given an altitude angle and a refraction option, calculates the amount of "lift"
|
||||
|
||||
Astronomy Engine uses dynamic memory allocation in only one place: it makes calculation of Pluto's orbit more efficient by caching 11 KB segments and recycling them. To force purging this cache and freeing all the dynamic memory, you can call this function at any time. It is always safe to call, although it will slow down the very next calculation of Pluto's position for a nearby time value. Calling this function before your program exits is optional, but it will be helpful for leak-checkers like valgrind.
|
||||
|
||||
---
|
||||
|
||||
<a name="Astronomy_RotateState"></a>
|
||||
### Astronomy_RotateState(rotation, state) ⇒ [`astro_state_vector_t`](#astro_state_vector_t)
|
||||
|
||||
**Applies a rotation to a state vector, yielding a rotated vector.**
|
||||
|
||||
|
||||
|
||||
This function transforms a state vector in one orientation to a vector in another orientation.
|
||||
|
||||
|
||||
|
||||
**Returns:** A state vector in the orientation specified by `rotation`.
|
||||
|
||||
|
||||
|
||||
| Type | Parameter | Description |
|
||||
| --- | --- | --- |
|
||||
| [`astro_rotation_t`](#astro_rotation_t) | `rotation` | A rotation matrix that specifies how the orientation of the vector is to be changed. |
|
||||
| [`astro_state_vector_t`](#astro_state_vector_t) | `state` | The state vector whose orientation is to be changed. Both the position and velocity components are transformed. |
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
<a name="Astronomy_RotateVector"></a>
|
||||
@@ -2897,13 +2924,13 @@ Returned by the functions [`Astronomy_Illumination`](#Astronomy_Illumination) an
|
||||
|
||||
|
||||
|
||||
The [`Astronomy_JupiterMoons`](#Astronomy_JupiterMoons) function returns this struct to report position vectors for Jupiter's largest 4 moons Io, Europa, Ganymede, and Callisto. Each vector is relative to the center of Jupiter and is oriented in the EQJ system (that is, using Earth's equator at the J2000 epoch.) The vector components are expressed in astronomical units (AU).
|
||||
The [`Astronomy_JupiterMoons`](#Astronomy_JupiterMoons) function returns this struct to report position and velocity vectors for Jupiter's largest 4 moons Io, Europa, Ganymede, and Callisto. Each vector is relative to the center of Jupiter and is oriented in the EQJ system (that is, using Earth's equator at the J2000 epoch.) The positions are expressed in astronomical units (AU), and the velocities in AU/day.
|
||||
|
||||
The following integer constants may be useful for indexing into the `moon` array: [`JM_IO`](#JM_IO), [`JM_EUROPA`](#JM_EUROPA), [`JM_GANYMEDE`](#JM_GANYMEDE), [`JM_CALLISTO`](#JM_CALLISTO).
|
||||
|
||||
| Type | Member | Description |
|
||||
| ---- | ------ | ----------- |
|
||||
| [`astro_vector_t`](#astro_vector_t) | `moon` | Jovicentric coordinates of each moon, as described above. |
|
||||
| [`astro_state_vector_t`](#astro_state_vector_t) | `moon` | Jovicentric position and velocity of each moon, as described above. |
|
||||
|
||||
|
||||
---
|
||||
@@ -3062,6 +3089,27 @@ You can create this structure directly, or you can call the convenience function
|
||||
| `double` | `dist` | Distance in AU. |
|
||||
|
||||
|
||||
---
|
||||
|
||||
<a name="astro_state_vector_t"></a>
|
||||
### `astro_state_vector_t`
|
||||
|
||||
**A state vector that contains a position (AU) and velocity (AU/day).**
|
||||
|
||||
|
||||
|
||||
| Type | Member | Description |
|
||||
| ---- | ------ | ----------- |
|
||||
| [`astro_status_t`](#astro_status_t) | `status` | `ASTRO_SUCCESS` if this struct is valid; otherwise an error code. |
|
||||
| `double` | `x` | The Cartesian position x-coordinate of the vector in AU. |
|
||||
| `double` | `y` | The Cartesian position y-coordinate of the vector in AU. |
|
||||
| `double` | `z` | The Cartesian position z-coordinate of the vector in AU. |
|
||||
| `double` | `vx` | The Cartesian velocity x-coordinate of the vector in AU/day. |
|
||||
| `double` | `vy` | The Cartesian velocity y-coordinate of the vector in AU/day. |
|
||||
| `double` | `vz` | The Cartesian velocity z-coordinate of the vector in AU/day. |
|
||||
| [`astro_time_t`](#astro_time_t) | `t` | The date and time at which this state vector is valid. |
|
||||
|
||||
|
||||
---
|
||||
|
||||
<a name="astro_time_t"></a>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -217,6 +217,22 @@ typedef struct
|
||||
}
|
||||
astro_vector_t;
|
||||
|
||||
/**
|
||||
* @brief A state vector that contains a position (AU) and velocity (AU/day).
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
astro_status_t status; /**< `ASTRO_SUCCESS` if this struct is valid; otherwise an error code. */
|
||||
double x; /**< The Cartesian position x-coordinate of the vector in AU. */
|
||||
double y; /**< The Cartesian position y-coordinate of the vector in AU. */
|
||||
double z; /**< The Cartesian position z-coordinate of the vector in AU. */
|
||||
double vx; /**< The Cartesian velocity x-coordinate of the vector in AU/day. */
|
||||
double vy; /**< The Cartesian velocity y-coordinate of the vector in AU/day. */
|
||||
double vz; /**< The Cartesian velocity z-coordinate of the vector in AU/day. */
|
||||
astro_time_t t; /**< The date and time at which this state vector is valid. */
|
||||
}
|
||||
astro_state_vector_t;
|
||||
|
||||
/**
|
||||
* @brief Spherical coordinates: latitude, longitude, distance.
|
||||
*/
|
||||
@@ -865,18 +881,19 @@ astro_time_format_t;
|
||||
* @brief Holds the positions of Jupiter's major 4 moons.
|
||||
*
|
||||
* The #Astronomy_JupiterMoons function returns this struct
|
||||
* to report position vectors for Jupiter's largest 4 moons
|
||||
* to report position and velocity vectors for Jupiter's largest 4 moons
|
||||
* Io, Europa, Ganymede, and Callisto. Each vector is relative
|
||||
* to the center of Jupiter and is oriented in the EQJ system
|
||||
* (that is, using Earth's equator at the J2000 epoch.)
|
||||
* The vector components are expressed in astronomical units (AU).
|
||||
* The positions are expressed in astronomical units (AU),
|
||||
* and the velocities in AU/day.
|
||||
*
|
||||
* The following integer constants may be useful for indexing
|
||||
* into the `moon` array: #JM_IO, #JM_EUROPA, #JM_GANYMEDE, #JM_CALLISTO.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
astro_vector_t moon[NUM_JUPITER_MOONS]; /**< Jovicentric coordinates of each moon, as described above. */
|
||||
astro_state_vector_t moon[NUM_JUPITER_MOONS]; /**< Jovicentric position and velocity of each moon, as described above. */
|
||||
}
|
||||
astro_jupiter_moons_t;
|
||||
|
||||
@@ -987,6 +1004,7 @@ astro_equatorial_t Astronomy_EquatorFromVector(astro_vector_t vector);
|
||||
astro_vector_t Astronomy_VectorFromHorizon(astro_spherical_t sphere, astro_time_t time, astro_refraction_t refraction);
|
||||
astro_spherical_t Astronomy_HorizonFromVector(astro_vector_t vector, astro_refraction_t refraction);
|
||||
astro_vector_t Astronomy_RotateVector(astro_rotation_t rotation, astro_vector_t vector);
|
||||
astro_state_vector_t Astronomy_RotateState(astro_rotation_t rotation, astro_state_vector_t state);
|
||||
|
||||
astro_rotation_t Astronomy_Rotation_EQD_EQJ(astro_time_t time);
|
||||
astro_rotation_t Astronomy_Rotation_EQD_ECL(astro_time_t time);
|
||||
|
||||
Reference in New Issue
Block a user