public class SunPosition extends Object implements EquatorialCoordinates, Serializable
Contains methods for calculating the position of the sun.
The position refers to the gemometric center of the sun.
| Modifier and Type | Method and Description |
|---|---|
static SunPosition |
at(Moment moment,
GeoLocation location)
Calculates the position of sun at given moment and geographical location.
|
boolean |
equals(Object obj) |
double |
getAzimuth()
Obtains the azimuth of sun in degrees (compass orientation).
|
double |
getDeclination()
Obtains the declination in degrees.
|
double |
getElevation()
Obtains the elevation of sun relative to the horizon in degrees.
|
double |
getRightAscension()
Obtains the right ascension in degrees.
|
double |
getShadowLength(double objectHeight)
Determines the length of shadow casted by an object of given height.
|
int |
hashCode() |
static Zodiac.Event |
inConstellationOf(Zodiac zodiac)
Determines the event when the sun enters or exits given zodiac constellation.
|
static Zodiac.Event |
inSignOf(Zodiac zodiac)
Determines the event when the sun enters or exits given zodiac sign (for horoscope purpose).
|
String |
toString() |
getRightAscensionHMSpublic static SunPosition at(Moment moment, GeoLocation location)
Calculates the position of sun at given moment and geographical location.
moment - the time when the position of sun is to be determinedlocation - geographical location of observerpublic static Zodiac.Event inConstellationOf(Zodiac zodiac)
Determines the event when the sun enters or exits given zodiac constellation.
zodiac - the astronomical zodiac constellation defined by IAUpublic static Zodiac.Event inSignOf(Zodiac zodiac)
Determines the event when the sun enters or exits given zodiac sign (for horoscope purpose).
zodiac - the astronomical zodiac signIllegalArgumentException - if the zodiac is Zodiac.OPHIUCHUSpublic double getRightAscension()
EquatorialCoordinatesObtains the right ascension in degrees.
getRightAscension in interface EquatorialCoordinatespublic double getDeclination()
EquatorialCoordinatesObtains the declination in degrees.
getDeclination in interface EquatorialCoordinatespublic double getAzimuth()
Obtains the azimuth of sun in degrees (compass orientation).
The azimuth is the result of a coordinate transformation of right ascension and declination to the horizon system.
public double getElevation()
Obtains the elevation of sun relative to the horizon in degrees.
The elevation is the result of a coordinate transformation of right ascension and declination to the horizon system.
public double getShadowLength(double objectHeight)
Determines the length of shadow casted by an object of given height.
If the sun is at or below the horizon then the length of shadow is positive infinity.
objectHeight - the height of object in metersIllegalArgumentException - if the object height is not finite and positiveCopyright © 2014–2021. All rights reserved.