mhuss utils 1.1.5ws

com.mhuss.AstroLib
Class AstroOps

java.lang.Object
  extended by com.mhuss.AstroLib.AstroOps

public class AstroOps
extends java.lang.Object

AstroOps is a 'catch-all' class that performs some useful calculation functions that didn't fit anywhere else.


Constructor Summary
AstroOps()
           
 
Method Summary
static double greenwichSiderealTime(double jd)
          Calculates the sidereal UTC time.
static double meanObliquity(double t)
          Calculates the mean obliquity at a given time.
static double normalizeDegrees(double d)
          Reduce an angle in degrees to the range (0 <= deg < 360)
static double normalizeRadians(double r)
          Reduce an angle in radians to the range (0 <= rad < 2Pi)
static int quadrant(double radians)
          Returns the quadrant (0, 1, 2, or 3) of the specified angle.
static double toDays(int hours)
          Converts the hour to a day fraction.
static double toMillenia(double jd)
          Convert a Julian day value to Julian millenia referenced to epoch J2000.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AstroOps

public AstroOps()
Method Detail

meanObliquity

public static double meanObliquity(double t)
Calculates the mean obliquity at a given time.

Parameters:
t - Time in julian centuries from J2000.
Valid range is the years -8000 to +12000 (t = -100 to 100).
Returns:
The mean obliquity (epsilon sub 0) in radians.

greenwichSiderealTime

public static double greenwichSiderealTime(double jd)
Calculates the sidereal UTC time. This function returns apparent Greenwich sidereal time for the given Julian day.

Parameters:
jd - Julian day
Returns:
Sidereal time in radians

toDays

public static double toDays(int hours)
Converts the hour to a day fraction.
For example, 12h = 0.5d

Parameters:
hours - (0..23)
Returns:
Fractional day

toMillenia

public static double toMillenia(double jd)
Convert a Julian day value to Julian millenia referenced to epoch J2000.

Parameters:
jd - Julian day number
Returns:
Julian millenia ref. J2000

normalizeDegrees

public static double normalizeDegrees(double d)
Reduce an angle in degrees to the range (0 <= deg < 360)

Parameters:
d - Value in degrees
Returns:
The reduced degree value

normalizeRadians

public static double normalizeRadians(double r)
Reduce an angle in radians to the range (0 <= rad < 2Pi)

Parameters:
r - Value in radians
Returns:
The reduced radian value

quadrant

public static int quadrant(double radians)
Returns the quadrant (0, 1, 2, or 3) of the specified angle.

This function is useful in figuring out dates of lunar phases and solstices/equinoxes. If the solar longitude is in one quadrant at the start of a day, but in a different quadrant at the end of a day, then we know that there must have been a solstice or equinox during that day. Also, if (lunar longitude - solar longitude) changes quadrants between the start of a day and the end of a day, we know there must have been a lunar phase change during that day.

Parameters:
radians - Angle in Radians
Returns:
Quadrant of angle (0, 1, 2, or 3)

mhuss utils 1.1.5ws

bottom text