Class SunPosition
- All Implemented Interfaces:
Serializable
,EquatorialCoordinates
Contains methods for calculating the position of the sun.
The position refers to the gemometric center of the sun.
- Since:
- 3.38/4.33
- Author:
- Meno Hochschild
- See Also:
- Serialized Form
-
Method Summary
Modifier and TypeMethodDescriptionstatic SunPosition
at(Moment moment, GeoLocation location)
Calculates the position of sun at given moment and geographical location.boolean
double
Obtains the azimuth of sun in degrees (compass orientation).double
Obtains the declination in degrees.double
Obtains the elevation of sun relative to the horizon in degrees.double
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
Determines the event when the sun enters or exits given zodiac sign (for horoscope purpose).toString()
Methods inherited from interface net.time4j.calendar.astro.EquatorialCoordinates
getRightAscensionHMS
-
Method Details
-
at
Calculates the position of sun at given moment and geographical location.
- Parameters:
moment
- the time when the position of sun is to be determinedlocation
- geographical location of observer- Returns:
- sun position
-
inConstellationOf
Determines the event when the sun enters or exits given zodiac constellation.
- Parameters:
zodiac
- the astronomical zodiac constellation defined by IAU- Returns:
- event when the sun enters or leaves the zodiac constellation
- Since:
- 4.37
-
inSignOf
Determines the event when the sun enters or exits given zodiac sign (for horoscope purpose).
- Parameters:
zodiac
- the astronomical zodiac sign- Returns:
- event when the sun enters or leaves the zodiac sign
- Throws:
IllegalArgumentException
- if the zodiac isZodiac.OPHIUCHUS
- Since:
- 4.37
-
getRightAscension
public double getRightAscension()Description copied from interface:EquatorialCoordinates
Obtains the right ascension in degrees.
- Specified by:
getRightAscension
in interfaceEquatorialCoordinates
- Returns:
- double in range 0-360
-
getDeclination
public double getDeclination()Description copied from interface:EquatorialCoordinates
Obtains the declination in degrees.
- Specified by:
getDeclination
in interfaceEquatorialCoordinates
- Returns:
- double
-
getAzimuth
public 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.
- Returns:
- azimuth in degrees measured from the north (compass orientation)
-
getElevation
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.
- Returns:
- elevation in degrees (positive if above the horizon and negative if below the horizon)
-
getShadowLength
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.
- Parameters:
objectHeight
- the height of object in meters- Returns:
- length of shadow in meters (or positive infinity)
- Throws:
IllegalArgumentException
- if the object height is not finite and positive- Since:
- 3.40/4.35
-
equals
-
hashCode
public int hashCode() -
toString
-