CelestialBody

public protocol CelestialBody : ObjectBase

Basic properties of an orbiting object. Used by solar system planets, and the Earth’ Moon, and the Sun.

  • The radius vector (=distance to the Sun)

    Declaration

    Swift

    var radiusVector: AstronomicalUnit { get }
  • The coordinates of the object in the equatorial system (based on Earth equator).

    Declaration

    Swift

    var equatorialCoordinates: EquatorialCoordinates { get }
  • riseTransitSetTimes(for:) Default implementation

    Returns the Rise, Transit and Set times of the body for a given location on Earth.

    Default Implementation

    Returns the Rise, Transit and Set times of the body for a given location on Earth.

    Declaration

    Swift

    func riseTransitSetTimes(for geographicCoordinates: GeographicCoordinates) -> RiseTransitSetTimes

    Parameters

    geographicCoordinates

    The coordinates of the location on Earth.

    Return Value

    A RiseTransitSetTimes object.

  • hourAngle(for:) Default implementation

    Returns the Hour Angle of the celestial body, that is, the difference between its local mean sidereal time and its right ascension.

    Default Implementation

    Returns the Hour Angle of the celestial body, that is, the difference between its local mean sidereal time and its right ascension.

    Declaration

    Swift

    func hourAngle(for geographicCoordinates: GeographicCoordinates) -> Hour

    Parameters

    geographicCoordinates

    The geographic coordinates of the observer.

    Return Value

    The Hour Angle of the body.

  • parallacticAngle(for:) Default implementation

    The parallactic angle is the angle between the direction of the zenith point relative the center of the disk, and that of the celestial north. The zenith point of the disk of a body (for instance, the Sun or the Moon) is the uppermost point of the disk at the sky as seen by the observer at a given instant. See Fig. 4, AA p.98. Exactly in zenith, the angle is not defined. When a celestial body passes exactly through the zenith, the parallactic angle suddenly jumps from -90º to 90º.

    Default Implementation

    Declaration

    Swift

    func parallacticAngle(for geographicCoordinates: GeographicCoordinates) -> Degree

    Parameters

    geographicCoordinates

    The geographic coordinates of the observer.

    Return Value

    The angle in degrees.

  • eclipticLongitudeOnHorizon(for:) Default implementation

    For a given location of the observer, the ecliptic plane cross that of the local horizontal plane, marking the horizon. Thus, one can compute the longitude of the two points of the ecliptic which are (180º appart) on the horizon.

    Default Implementation

    Declaration

    Swift

    func eclipticLongitudeOnHorizon(for geographicCoordinates: GeographicCoordinates) -> Degree

    Parameters

    geographicCoordinates

    The geographic coordinates of the observer.

    Return Value

    The longitude of the ecliptic.

  • angleBetweenEclipticAndHorizon(for:) Default implementation

    For a given location of the observer, the ecliptic plane cross that of the local horizontal plane, marking the horizon. Thus, one can compute the angle between the two planes.

    Default Implementation

    Declaration

    Swift

    func angleBetweenEclipticAndHorizon(for geographicCoordinates: GeographicCoordinates) -> Degree

    Parameters

    geographicCoordinates

    The geographic coordinates of the observer.

    Return Value

    The angle between the ecliptic and the horizon.

  • Undocumented

    Default Implementation

    Undocumented

    Declaration

    Swift

    func angleBetweenNorthCelestialPoleAndNorthPoleOfEcliptic(for geographicCoordinates: GeographicCoordinates) -> Degree
  • The angle the Earth must make between the time at which the object is at a given altitude, then rotate, produce a diurnal arc, and reach a time at which the object reached again the same altitude. Basically, for the object being the Sun, and the altitude being 0=horizon, compute the angle between sunrise and sunset.

    Default Implementation

    The angle the Earth must make between the time at which the object is at a given altitude, then rotate, produce a diurnal arc, and reach a time at which the object reached again the same altitude. Basically, for the object being the Sun, and the altitude being 0=horizon, compute the angle between sunrise and sunset.

    Declaration

    Swift

    func diurnalArcAngle(for objectAltitude: Degree, geographicCoordinates: GeographicCoordinates) -> (value: Degree?, error: CelestialBodyTransitError?)

    Parameters

    objectAltitude

    The crossing altitude

    geographicCoordinates

    The point on Earth from which one computes the arc.

    Return Value

    The angle of the so-called diurnal arc

  • Geometric altitude (h0) of the center of the body at time of apparent rising or setting (see AA p.101)

    Declaration

    Swift

    static var apparentRiseSetAltitude: Degree { get }