Class Moment
java.lang.Object
org.episteme.social.history.calendars.Moment
Astronomical calculations for calendar systems.
Provides precise calculations for solar longitude, lunar phases,
ephemeris corrections, and time conversions needed by various calendars.
Key calculations include:
- Solar longitude (position of sun in ecliptic)
- New moon times
- Equation of time
- Ephemeris corrections (ΔT)
- Julian Day / Rata Die conversions
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleJulian Day of the year 2000 epoch (January 1, 2000, 12:00 TT).static final doubleAverage length of a synodic month in days. -
Constructor Summary
ConstructorsConstructorDescriptionMoment(double d) Creates a new Moment object.Moment(long l) Creates a new Moment object.Moment(AlternateCalendar altcalendar) Creates a new Moment object. -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleabberation(double d) Calculates solar aberration for a given moment.static doubleapparentFromLocal(double d) Converts local time to apparent time.static doubledateNextSolarLongitude(double d, int i) Returns the date when the sun next reaches a specific longitude.doubleReturns the ephemeris correction for this moment.static doubleephemerisCorrection(double d) Calculates the ephemeris correction (ΔT) for a given date.static doubleephemerisFromUniversal(double d) Converts Universal Time to Ephemeris Time.doubleReturns the equation of time for this moment.static doubleequationOfTime(double d) Calculates the equation of time for a given Julian Day.static MomentjdCreate(double d) Creates a new Moment from a Julian Day number.static doublejdFromMoment(double d) Converts Rata Die to Julian Day.doubleReturns Julian centuries from J2000.0 for this moment.static doublejulianCenturies(double d) Converts Julian Day to Julian centuries from J2000.0.static doublelocalFromApparent(double d) Converts apparent time to local time.static doublelocalFromUniversal(double d, double d1) Converts Universal Time to local time.static voidMain method for testing astronomical calculations.static doublemomentFromJD(double d) Converts Julian Day to Rata Die.static doublenewMoonAtOrAfter(double d) Finds the Julian Day of the first new moon at or after a date.static doublenewMoonBefore(double d) Finds the Julian Day of the first new moon before a date.static doublenewMoonTime(int i) Calculates the time of the n-th new moon since J2000.static doublenutation(double d) Calculates nutation for a given moment.doubleReturns the sidereal time for this moment.static doublesiderealFromJD(double d) Returns the sidereal time at Greenwich for a Julian Day.doubleReturns the solar longitude for this moment.static doublesolarLongitude(double d) Returns the solar longitude in degrees.static doublesolarMoment(long l, double d, double d1, double d2) Calculates the solar moment for a given location and date.static doubleuniversalFromEphemeris(double d) Converts Ephemeris Time to Universal Time.static doubleuniversalFromLocal(double d, double d1) Converts local time to Universal Time.
-
Field Details
-
JD2000
public static final double JD2000Julian Day of the year 2000 epoch (January 1, 2000, 12:00 TT). -
MEANSYNODICMONTH
public static final double MEANSYNODICMONTHAverage length of a synodic month in days.- See Also:
-
-
Constructor Details
-
Moment
public Moment(long l) Creates a new Moment object.- Parameters:
l- the Rata Die number.
-
Moment
public Moment(double d) Creates a new Moment object.- Parameters:
d- the Rata Die number (including time as fraction).
-
Moment
Creates a new Moment object.- Parameters:
altcalendar- another calendar to initialize from.
-
-
Method Details
-
jdCreate
Creates a new Moment from a Julian Day number.- Parameters:
d- the Julian Day.- Returns:
- a new Moment object.
-
momentFromJD
public static double momentFromJD(double d) Converts Julian Day to Rata Die.- Parameters:
d- the Julian Day.- Returns:
- the Rata Die.
-
jdFromMoment
public static double jdFromMoment(double d) Converts Rata Die to Julian Day.- Parameters:
d- the Rata Die.- Returns:
- the Julian Day.
-
equationOfTime
public static double equationOfTime(double d) Calculates the equation of time for a given Julian Day.- Parameters:
d- the Julian Day.- Returns:
- the equation of time adjustment.
-
equationOfTime
public double equationOfTime()Returns the equation of time for this moment.- Returns:
- the equation of time correction.
-
apparentFromLocal
public static double apparentFromLocal(double d) Converts local time to apparent time.- Parameters:
d- local time.- Returns:
- apparent time.
-
localFromApparent
public static double localFromApparent(double d) Converts apparent time to local time.- Parameters:
d- apparent time.- Returns:
- local time.
-
siderealFromJD
public static double siderealFromJD(double d) Returns the sidereal time at Greenwich for a Julian Day.- Parameters:
d- the Julian Day.- Returns:
- sidereal time as fraction of day.
-
siderealFromJD
public double siderealFromJD()Returns the sidereal time for this moment.- Returns:
- sidereal time.
-
ephemerisCorrection
public static double ephemerisCorrection(double d) Calculates the ephemeris correction (ΔT) for a given date.- Parameters:
d- the Rata Die number.- Returns:
- the correction in days.
-
ephemerisCorrection
public double ephemerisCorrection()Returns the ephemeris correction for this moment.- Returns:
- ΔT in days.
-
ephemerisFromUniversal
public static double ephemerisFromUniversal(double d) Converts Universal Time to Ephemeris Time.- Parameters:
d- Universal Time as Julian Day.- Returns:
- Ephemeris Time as Julian Day.
-
universalFromEphemeris
public static double universalFromEphemeris(double d) Converts Ephemeris Time to Universal Time.- Parameters:
d- Ephemeris Time as Julian Day.- Returns:
- Universal Time as Julian Day.
-
julianCenturies
public static double julianCenturies(double d) Converts Julian Day to Julian centuries from J2000.0.- Parameters:
d- the Julian Day.- Returns:
- Julian centuries.
-
julianCenturies
public double julianCenturies()Returns Julian centuries from J2000.0 for this moment.- Returns:
- Julian centuries.
-
abberation
public static double abberation(double d) Calculates solar aberration for a given moment.- Parameters:
d- Julian centuries from J2000.- Returns:
- aberration in degrees.
-
nutation
public static double nutation(double d) Calculates nutation for a given moment.- Parameters:
d- Julian centuries from J2000.- Returns:
- nutation in degrees.
-
solarLongitude
public static double solarLongitude(double d) Returns the solar longitude in degrees.- Parameters:
d- the Julian Day.- Returns:
- solar longitude.
-
solarLongitude
public double solarLongitude()Returns the solar longitude for this moment.- Returns:
- solar longitude.
-
dateNextSolarLongitude
public static double dateNextSolarLongitude(double d, int i) Returns the date when the sun next reaches a specific longitude.- Parameters:
d- starting Julian Day.i- target longitude increment or specific value.- Returns:
- Julian Day of the next solar longitude.
-
solarMoment
public static double solarMoment(long l, double d, double d1, double d2) Calculates the solar moment for a given location and date.- Parameters:
l- Gregorian year.d- latitude in degrees.d1- longitude in degrees.d2- offset.- Returns:
- solar moment.
-
newMoonAtOrAfter
public static double newMoonAtOrAfter(double d) Finds the Julian Day of the first new moon at or after a date.- Parameters:
d- the Julian Day.- Returns:
- the new moon Julian Day.
-
newMoonBefore
public static double newMoonBefore(double d) Finds the Julian Day of the first new moon before a date.- Parameters:
d- the Julian Day.- Returns:
- the new moon Julian Day.
-
newMoonTime
public static double newMoonTime(int i) Calculates the time of the n-th new moon since J2000.- Parameters:
i- new moon index.- Returns:
- Julian Day of the new moon.
-
universalFromLocal
public static double universalFromLocal(double d, double d1) Converts local time to Universal Time.- Parameters:
d- local time (Julian Day).d1- timezone offset in minutes.- Returns:
- Universal Time (Julian Day).
-
localFromUniversal
public static double localFromUniversal(double d, double d1) Converts Universal Time to local time.- Parameters:
d- Universal Time (Julian Day).d1- timezone offset in minutes.- Returns:
- local time (Julian Day).
-
main
Main method for testing astronomical calculations.- Parameters:
args- command line arguments.
-