java.lang.Object
eu.hansolo.tilesfx.tools.SunMoonCalculator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe set of twilights to calculate (types of rise/set events). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final doublestatic final double -
Constructor Summary
ConstructorsConstructorDescriptionSunMoonCalculator(int YEAR, int MONTH, int DAY, double LAT_DEG, double LNG_DEG) Main constructor for Sun/Moon calculations.SunMoonCalculator(int year, int month, int day, int h, int m, int s, double latDeg, double lngDeg) Main constructor for Sun/Moon calculations. -
Method Summary
Modifier and TypeMethodDescriptionvoidcalcEphemeris(ZoneId ZONE_ID) voidCalculates everything for the Sun and the Moon.static int[]getDate(double JULIAN_DAY) Transforms a Julian day (rise/set/transit fields) to a common date.static StringgetDateAsString(double JULIAN_DAY) static StringgetDateAsString(double JULIAN_DAY, int TIMEZONE_OFFSET) Returns a date as a string.double[]static ZonedDateTimegetZonedDateTime(double JULIAN_DAY, ZoneOffset ZONE_OFFSET) static doublenormalizeRadians(double r) Reduce an angle in radians to the range (0 - 2 Pi).voidsetDate(int year, int month, int day) voidsetDate(int year, int month, int day, int h, int m, int s) voidvoidsetDate(LocalDateTime DATE_TIME) voidSets the rise/set times to return.
-
Field Details
-
RAD_TO_DEG
public static final double RAD_TO_DEG- See Also:
-
DEG_TO_RAD
public static final double DEG_TO_RAD- See Also:
-
RAD_TO_HOUR
public static final double RAD_TO_HOUR- See Also:
-
RAD_TO_DAY
public static final double RAD_TO_DAY- See Also:
-
AU
public static final double AU- See Also:
-
EARTH_RADIUS
public static final double EARTH_RADIUS- See Also:
-
TWO_PI
public static final double TWO_PI- See Also:
-
TWO_PI_INVERSE
public static final double TWO_PI_INVERSE- See Also:
-
FOUR_PI
public static final double FOUR_PI- See Also:
-
PI_OVER_TWO
public static final double PI_OVER_TWO- See Also:
-
SIDEREAL_DAY_LENGTH
public static final double SIDEREAL_DAY_LENGTH- See Also:
-
JULIAN_DAYS_PER_CENTURY
public static final double JULIAN_DAYS_PER_CENTURY- See Also:
-
SECONDS_PER_DAY
public static final double SECONDS_PER_DAY- See Also:
-
J2000
public static final double J2000- See Also:
-
-
Constructor Details
-
SunMoonCalculator
public SunMoonCalculator(int YEAR, int MONTH, int DAY, double LAT_DEG, double LNG_DEG) throws Exception Main constructor for Sun/Moon calculations. Observer angles in degrees.- Parameters:
YEAR- The year.MONTH- The month.DAY- The day.LAT_DEG- Latitude for the observer.LNG_DEG- Longitude for the observer.- Throws:
Exception- If the date does not exists.
-
SunMoonCalculator
public SunMoonCalculator(int year, int month, int day, int h, int m, int s, double latDeg, double lngDeg) throws Exception Main constructor for Sun/Moon calculations. Time should be given in Universal Time (UT), observer angles in degrees.- Parameters:
year- The year.month- The month.day- The day.h- The hour.m- Minute.s- Second.latDeg- Latitude for the observer.lngDeg- Longitude for the observer.- Throws:
Exception- If the date does not exists.
-
-
Method Details
-
getDate
Transforms a Julian day (rise/set/transit fields) to a common date.- Parameters:
JULIAN_DAY- The Julian day.- Returns:
- A set of integers: year, month, day, hour, minute, second.
- Throws:
Exception- If the input date does not exists.
-
getZonedDateTime
public static ZonedDateTime getZonedDateTime(double JULIAN_DAY, ZoneOffset ZONE_OFFSET) throws Exception - Throws:
Exception
-
getDateAsString
- Throws:
Exception
-
getDateAsString
Returns a date as a string.- Parameters:
JULIAN_DAY- The Juliand day.- Returns:
- The String.
- Throws:
Exception- If the date does not exists.
-
normalizeRadians
public static double normalizeRadians(double r) Reduce an angle in radians to the range (0 - 2 Pi).- Parameters:
r- Value in radians.- Returns:
- The reduced radian value.
-
setTwilight
Sets the rise/set times to return. Default is for the local horizon.- Parameters:
T- The Twilight.
-
setDate
- Throws:
Exception
-
setDate
- Throws:
Exception
-
setDate
- Throws:
Exception
-
setDate
- Throws:
Exception
-
calcSunAndMoon
public void calcSunAndMoon()Calculates everything for the Sun and the Moon. -
getMoonDiskOrientationAngles
public double[] getMoonDiskOrientationAngles() -
calcEphemeris
-
getSunrise
-
getSunset
-
getSunriseGoldenHour
-
getSunsetGoldenHour
-
getSunriseCivil
-
getSunsetCivil
-
getSunriseBlueHour
-
getSunsetBlueHour
-