com.mhuss.AstroLib
Class AstroOps
- java.lang.Object
-
- com.mhuss.AstroLib.AstroOps
-
public class AstroOps extends java.lang.ObjectAstroOps is a 'catch-all' class that performs some useful calculation functions that didn't fit anywhere else.
-
-
Constructor Summary
Constructors Constructor and Description AstroOps()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doublegreenwichSiderealTime(double jd)Calculates the sidereal UTC time.static doublemeanObliquity(double t)Calculates the mean obliquity at a given time.static doublenormalizeDegrees(double d)Reduce an angle in degrees to the range (0 <= deg < 360)static doublenormalizeRadians(double r)Reduce an angle in radians to the range (0 <= rad < 2Pi)static intquadrant(double radians)Returns the quadrant (0, 1, 2, or 3) of the specified angle.static doubletoDays(int hours)Converts the hour to a day fraction.static doubletoMillenia(double jd)Convert a Julian day value to Julian millenia referenced to epoch J2000.
-
-
-
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)
-
-
DMelt 3.0 © DataMelt by jWork.ORG