Class SunPosition

java.lang.Object
net.time4j.calendar.astro.SunPosition
All Implemented Interfaces:
Serializable, EquatorialCoordinates

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.

Since:
3.38/4.33
Author:
Meno Hochschild
See Also:
Serialized Form
  • Method Details

    • at

      public static SunPosition at(Moment moment, GeoLocation location)

      Calculates the position of sun at given moment and geographical location.

      Parameters:
      moment - the time when the position of sun is to be determined
      location - geographical location of observer
      Returns:
      sun position
    • inConstellationOf

      public static Zodiac.Event inConstellationOf(Zodiac zodiac)

      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

      public static Zodiac.Event inSignOf(Zodiac zodiac)

      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 is Zodiac.OPHIUCHUS
      Since:
      4.37
    • getRightAscension

      public double getRightAscension()
      Description copied from interface: EquatorialCoordinates

      Obtains the right ascension in degrees.

      Specified by:
      getRightAscension in interface EquatorialCoordinates
      Returns:
      double in range 0-360
    • getDeclination

      public double getDeclination()
      Description copied from interface: EquatorialCoordinates

      Obtains the declination in degrees.

      Specified by:
      getDeclination in interface EquatorialCoordinates
      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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object