Documentation of 'com.mhuss.AstroLib.Lunar' Java class
Lunar
com.mhuss.AstroLib

Class Lunar



  • public class Lunar
    extends java.lang.Object
    A class that can calculate lunar fundmentals for any reasonable time.

    Based on C code by Bill Gray (www.projectpluto.com)

    This class calculates Lunar fundamentals, and also contains some functions which depend on these fundimentals, including latitude, longitude & distance, phase angle and illuminated fraction.

    The lunar fundamentals must be calculated before calling most of the functions in this class.

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int FULL
      phase constant
      static int NEW
      phase constant
      static int Q1
      phase constant
      static int Q3
      phase constant
    • Constructor Summary

      Constructors 
      Constructor and Description
      Lunar()
      Default constructor
      Lunar(double t)
      Date/time constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void calcAllLEs(LocationElements locs, double t)
      Calculate the fundamentals and then all three location elements for the given time.
      void calcFundamentals(double t)
      Calculates the lunar fundamanentals for a given time.
      double getLatitude()
      Calculate the latitude in degrees.
      double getLatitudeRadians()
      Calculate the lunar latitude in radians.
      double getLongitude()
      Calculate the lunar longitude in degrees.
      double getLongitudeRadians()
      Calculate the lunar longitude in radians.
      static double getPhase(long jd, int quarter)
      Calculate the time of the quarter nearest the given Julian day.
      static double getPhase(long jd, int quarter, java.util.Calendar cal)
      Calculate the time of the quarter nearest the given Julian day.
      double getRadius()
      Calculate the lunar radius (distance).
      double illuminatedFraction()
      Calculate the illuminated fraction.
      static void main(java.lang.String[] args)
      (for unit testing only)
      double phaseAngle()
      Calculate the phase angle in radians.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Lunar

        public Lunar()
        Default constructor
      • Lunar

        public Lunar(double t)
        Date/time constructor. This constructor uses the time provided to calculate the lunar fundamentals.
        Parameters:
        t - Time in Julian centuries ref J2000
    • Method Detail

      • calcFundamentals

        public void calcFundamentals(double t)
        Calculates the lunar fundamanentals for a given time.
        Parameters:
        t - Time in Julian centuries referenced to J2000
      • phaseAngle

        public double phaseAngle()
                          throws NoInitException
        Calculate the phase angle in radians.
        (Using Meeus' easy lower precision method).

        NOTE: The lunar fundamentals must be calculated before calling this function or a NoInitException will be thrown.

        Returns:
        The current phase angle in radians
        Throws:
        NoInitException
      • illuminatedFraction

        public double illuminatedFraction()
                                   throws NoInitException
        Calculate the illuminated fraction.

        NOTE: The lunar fundamentals must be calculated before calling this function or a NoInitException will be thrown.

        Returns:
        The current illuminated fraction (0.0 to 1.0)
        Throws:
        NoInitException
      • getPhase

        public static double getPhase(long jd,
                                      int quarter,
                                      java.util.Calendar cal)
        Calculate the time of the quarter nearest the given Julian day.
        Parameters:
        jd - A Julian day close to the expected date
        quarter - (Lunar.NEW, Q1, FULL, or Q3)
        cal - Calendar to use for time zone adjustment; if null no time zone adjustment is performed
        Returns:
        The relatively exact Julian day with decimal
      • getPhase

        public static double getPhase(long jd,
                                      int quarter)
        Calculate the time of the quarter nearest the given Julian day.
        Parameters:
        jd - A Julian day close to the expected date
        quarter - (Lunar.NEW, Q1, FULL, or Q3)
        Returns:
        The relatively exact Julian day with decimal
      • getLatitude

        public double getLatitude()
                           throws NoInitException
        Calculate the latitude in degrees.

        NOTE: The lunar fundamentals must be calculated before calling this function or a NoInitException will be thrown.

        Returns:
        The latitude in degrees
        Throws:
        NoInitException
      • getLatitudeRadians

        public double getLatitudeRadians()
                                  throws NoInitException
        Calculate the lunar latitude in radians.

        NOTE: The lunar fundamentals must be calculated before calling this function or a NoInitException will be thrown.

        Returns:
        The lunar latitude in radians
        Throws:
        NoInitException
      • getLongitude

        public double getLongitude()
                            throws NoInitException
        Calculate the lunar longitude in degrees.

        NOTE: The lunar fundamentals must be calculated before calling this function or a NoInitException will be thrown.

        Returns:
        The lunar longitude in degrees
        Throws:
        NoInitException
      • getLongitudeRadians

        public double getLongitudeRadians()
                                   throws NoInitException
        Calculate the lunar longitude in radians.

        NOTE: The lunar fundamentals must be calculated before calling this function or a NoInitException will be thrown.

        Returns:
        The lunar longitude in radians
        Throws:
        NoInitException
      • getRadius

        public double getRadius()
                         throws NoInitException
        Calculate the lunar radius (distance).

        NOTE: The lunar fundamentals must be calculated before calling this function or a NoInitException will be thrown.

        Returns:
        The lunar radius
        Throws:
        NoInitException
      • calcAllLEs

        public void calcAllLEs(LocationElements locs,
                               double t)
                        throws NoInitException
        Calculate the fundamentals and then all three location elements for the given time. This function calls callFundamentals().
        Parameters:
        locs - Where the calculated LEs go
        t - time in decimal centuries
        Throws:
        NoInitException
      • main

        public static void main(java.lang.String[] args)
        (for unit testing only)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.