Ephemeris
The Ephemeris plugin provides precise astronomical calculations for celestial bodies including the Sun, Moon, stars, and galaxy based on a specified date and time. It offers functionality to compute their equatorial coordinates, 3D directions, positions, and orientations in space, enabling realistic celestial simulation and alignment.
note
The galaxy orientation differs from the stars orientation due to the horizontal alignment of The Milky Way panorama.
#include <geospatial/ephemeris/include/TellusimEphemeris.h>
Example
The following example iterates through each month of the year 2000, calculating solar and lunar data for the 1st day at noon. These results can be used for visualizing astronomical bodies or simulating real-world sky conditions.
Date date;
Ephemeris ephemeris;
for(uint32_t m = 1; m <= 12; m++) {
date.setString(String::format("2000-%02u-01 12:00:00", m).get());
ephemeris.setTime(date, 0.0);
// equatorial coordinates
ephemeris.getSunCoordinates();
ephemeris.getMoonCoordinates();
// directions
ephemeris.getSunDirection();
ephemeris.getMoonDirection();
// positions
ephemeris.getSunPosition();
ephemeris.getMoonPosition();
// orientations
ephemeris.getSunOrientation();
ephemeris.getMoonOrientation();
ephemeris.getStarsOrientation();
ephemeris.getGalaxyOrientation();
}