Class JulianDate
java.lang.Object
org.shredzone.commons.suncalc.util.JulianDate
This class contains a Julian Date representation of a date.
Objects are immutable and threadsafe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionatHour(double hour) Returns aJulianDateof the current date and the given hour.atJulianCentury(double jc) Returns aJulianDateof the given Julian century.atModifiedJulianDate(double mjd) Returns aJulianDateof the given modified Julian date.Returns thisJulianDateasZonedDateTimeobject.doubleReturns the Greenwich Mean Sidereal Time of this Julian Date.doubleReturns the Julian Centuries.doubleReturns the Modified Julian Date.doubleReturns the earth's true anomaly of the current date.toString()
-
Constructor Details
-
JulianDate
Creates a newJulianDate.- Parameters:
time-ZonedDateTimeto use for the date.
-
-
Method Details
-
atHour
Returns aJulianDateof the current date and the given hour.- Parameters:
hour- Hour of this date. This is a floating point value. Fractions are used for minutes and seconds.- Returns:
JulianDateinstance.
-
atModifiedJulianDate
Returns aJulianDateof the given modified Julian date.- Parameters:
mjd- Modified Julian Date- Returns:
JulianDateinstance.
-
atJulianCentury
Returns aJulianDateof the given Julian century.- Parameters:
jc- Julian Century- Returns:
JulianDateinstance.
-
getDateTime
Returns thisJulianDateasZonedDateTimeobject.- Returns:
ZonedDateTimeof thisJulianDate.
-
getModifiedJulianDate
Returns the Modified Julian Date.- Returns:
- Modified Julian Date, UTC.
-
getJulianCentury
Returns the Julian Centuries.- Returns:
- Julian Centuries, based on J2000 epoch, UTC.
-
getGreenwichMeanSiderealTime
Returns the Greenwich Mean Sidereal Time of this Julian Date.- Returns:
- GMST
-
getTrueAnomaly
Returns the earth's true anomaly of the current date.A simple approximation is used here.
- Returns:
- True anomaly, in radians
-
toString
-