Class Moment

java.lang.Object
org.episteme.social.history.calendars.Moment

public class Moment extends Object
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
* @version 2.0
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    Julian Day of the year 2000 epoch (January 1, 2000, 12:00 TT).
    static final double
    Average length of a synodic month in days.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Moment(double d)
    Creates a new Moment object.
    Moment(long l)
    Creates a new Moment object.
    Creates a new Moment object.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    abberation(double d)
    Calculates solar aberration for a given moment.
    static double
    Converts local time to apparent time.
    static double
    dateNextSolarLongitude(double d, int i)
    Returns the date when the sun next reaches a specific longitude.
    double
    Returns the ephemeris correction for this moment.
    static double
    Calculates the ephemeris correction (ΔT) for a given date.
    static double
    Converts Universal Time to Ephemeris Time.
    double
    Returns the equation of time for this moment.
    static double
    equationOfTime(double d)
    Calculates the equation of time for a given Julian Day.
    static Moment
    jdCreate(double d)
    Creates a new Moment from a Julian Day number.
    static double
    jdFromMoment(double d)
    Converts Rata Die to Julian Day.
    double
    Returns Julian centuries from J2000.0 for this moment.
    static double
    julianCenturies(double d)
    Converts Julian Day to Julian centuries from J2000.0.
    static double
    Converts apparent time to local time.
    static double
    localFromUniversal(double d, double d1)
    Converts Universal Time to local time.
    static void
    main(String[] args)
    Main method for testing astronomical calculations.
    static double
    momentFromJD(double d)
    Converts Julian Day to Rata Die.
    static double
    newMoonAtOrAfter(double d)
    Finds the Julian Day of the first new moon at or after a date.
    static double
    newMoonBefore(double d)
    Finds the Julian Day of the first new moon before a date.
    static double
    newMoonTime(int i)
    Calculates the time of the n-th new moon since J2000.
    static double
    nutation(double d)
    Calculates nutation for a given moment.
    double
    Returns the sidereal time for this moment.
    static double
    siderealFromJD(double d)
    Returns the sidereal time at Greenwich for a Julian Day.
    double
    Returns the solar longitude for this moment.
    static double
    solarLongitude(double d)
    Returns the solar longitude in degrees.
    static double
    solarMoment(long l, double d, double d1, double d2)
    Calculates the solar moment for a given location and date.
    static double
    Converts Ephemeris Time to Universal Time.
    static double
    universalFromLocal(double d, double d1)
    Converts local time to Universal Time.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • JD2000

      public static final double JD2000
      Julian Day of the year 2000 epoch (January 1, 2000, 12:00 TT).
    • MEANSYNODICMONTH

      public static final double MEANSYNODICMONTH
      Average 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

      public Moment(AlternateCalendar altcalendar)
      Creates a new Moment object.
      Parameters:
      altcalendar - another calendar to initialize from.
  • Method Details

    • jdCreate

      public static Moment jdCreate(double d)
      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

      public static void main(String[] args)
      Main method for testing astronomical calculations.
      Parameters:
      args - command line arguments.