Moon

public class Moon : Object, CelestialBody

The Earth’s Moon.

  • Accessor to all values underlying the geocentric physical details. Will probably become private once all relevant accessors are implemented and covered.

    Declaration

    Swift

    public fileprivate(set) lazy var geocentricPhysicalDetails: KPCAAPhysicalMoonDetails { get set }
  • Accessor to all values underlying the selenographic details. Will probably become private once all relevant accessors are implemented and covered.

    Declaration

    Swift

    public fileprivate(set) lazy var selenographicDetails: KPCAASelenographicMoonDetails { get set }
  • Accessor to all values underlying the eclipse details. Will probably become private once all relevant accessors are implemented and covered.

    Declaration

    Swift

    public fileprivate(set) lazy var eclipseDetails: KPCAALunarEclipseDetails { get set }
  • The diameter of the Moon.

    Declaration

    Swift

    public let diameter: Meter
  • The standard/mean apparent altitude for rise and set of the Moon. See AA p.102.

    Declaration

    Swift

    public static let apparentRiseSetAltitude: Degree

CelestialBody

  • Radius vector of the Moon, that is, its distance from Earth (not Sun). AA+ uses the Eq. for Delta written in p.342 of AA book. According to that Eq., the result is in Kilometers. For consistency with others, we return AU.

    Declaration

    Swift

    public var radiusVector: AstronomicalUnit { get }
  • Convenience accessor of the Moon distance, that is, its distance from Earth (not Sun), in kilometers.

    Declaration

    Swift

    public var distance: Kilometer { get }
  • Horizontal parallax

    Declaration

    Swift

    public var horizontalParallax: Degree { get }

Coordinates

  • The apparent ecliptic coordinates of the Moon. In AA p.342, Example 47.a, they are called geocentric longitude and latitude. But apparent right ascension and declination are derived directly from them using standard coordinates transformations. These coordinates are ‘apparent’ coordinates because they include the effect of nutation in longitude. It is important to provide the current julian day as epoch to get the right coordinates.

    Declaration

    Swift

    public var apparentEclipticCoordinates: EclipticCoordinates { get }
  • The apparent equatorial coordinates of the Moon, obtained from the apparentEclipticCoordinates.

    Declaration

    Swift

    public var apparentEquatorialCoordinates: EquatorialCoordinates { get }
  • The ecliptic coordinates of the Moon. [WARN]: For now, return the apparent ones. TODO: Is there any other coordinates one could find? Is it meaningful?

    Declaration

    Swift

    public var eclipticCoordinates: EclipticCoordinates { get }
  • The equatorial coordinates of the Moon. [WARN]: For now, return the apparent ones. TODO: Is there any other coordinates one could find? Is it meaningful?

    Declaration

    Swift

    public var equatorialCoordinates: EquatorialCoordinates { get }

Diameters

  • This is the geocentric semi diameter of the moon, that is for an observer located at the center of the Earth

    Declaration

    Swift

    public var geocentricSemiDiameter: ArcSecond { get }
  • This is the topocentric semi diameter of the moon, that is for an observer located somewhere on the surface of the Earth.

    Declaration

    Swift

    public func topocentricSemiDiameter(for geographicCoordinates: GeographicCoordinates) -> ArcSecond

    Parameters

    geographicCoordinates

    The location of the observer on Earth. The altitude matters!

    Return Value

    The topocentric semi diameter of the Moon.

KPCAAMoon

KPCAAMoonPhases

  • Returns the Julian Day of the Moon phase.

    Declaration

    Swift

    public func time(of phase: MoonPhase, forward: Bool = true, mean: Bool = true) -> JulianDay

    Parameters

    phase

    The phase of the moon we are looking for.

    forward

    A boolean indicating whether one wants the result after the input date, or not. Default is forward=true.

    mean

    A boolean indicating one wans the mean or the true (instantaneous) value. Default is mean=true.

    Return Value

    The Julian Day of the Moon phase.

KPCAAMoonPhysicalDetails

  • Computes the optical librations of the Moon. That is the displacement, at any time, of the mean center of the disk from the apparent center, measured by the selenographic coordinates of the apparent center of the disk at that time. Optical librations are due to variations of the geometric position of the Earth relative to the lunar surface during the course of the orbital motion of the Moon.

    Declaration

    Swift

    public func geocentricOpticalLibration() -> SelenographicCoordinates

    Return Value

    a new instance of SelenographicCoordinates

  • Computes the physical librations of the Moon, which is due to the actual rotational motion of the Moon about its mean rotation. This is much smaller than the optical libration.

    Declaration

    Swift

    public func geocentricPhysicalLibration() -> SelenographicCoordinates

    Return Value

    a new instance of SelenographicCoordinates

  • Computes the total librations of the Moon, which is the sum of the optical and physical librations.

    Declaration

    Swift

    public func geocentricTotalLibration() -> SelenographicCoordinates

    Return Value

    a new instance of SelenographicCoordinates

  • AA (p.375): For precise reduction sof observations, the geocentric values of the librations and position angle of the axis should be reduced to the values at the place of the observer on the surface of the Earth. For the librations, the differences may reach 1 degree and have important effects on the limb-contour.

    Declaration

    Swift

    public func topocentricTotalLibration(for geographicCoordinates: GeographicCoordinates) -> SelenographicCoordinates

    Parameters

    geoCoords

    The position of the observer on Earth surface.

    Return Value

    a new instance of SelenographicCoordinates

  • The position angle of the Moon’s axis of rotation

    Declaration

    Swift

    public var rotationAxisPositionAngle: Degree { get }
  • AA (p.376): The selenographic coordinates of the Sun determine the regions of the lunar surface that are illuminated. The coordinates returned are those of the subsolar point, that is, the point on the Moon surface where the Sun is in the zenith.

    Declaration

    Swift

    public var selenographicPositionOfTheSun: SelenographicCoordinates { get }
  • Computes the altitude of the Sun above the Moon’s horizon on a given location in the Moon surface.

    Declaration

    Swift

    public func altitudeOfTheSun(for selenographicCoordinates: SelenographicCoordinates) -> Degree

    Parameters

    selCoords

    The position on the Moon surface.

    Return Value

    The altitude of the Sun above the local lunar horizon.

  • Computes the time of the sunrise, for a given location in the Moon surface, taking the center of the Sun apparent disk.

    Declaration

    Swift

    public func timeOfSunrise(for selenographicCoordinates: SelenographicCoordinates) -> JulianDay

    Parameters

    selCoords

    The position on the Moon surface.

    Return Value

    The julian day of the sunrise.

  • Computes the time of the sunset, for a given location in the Moon surface, taking the center of the Sun apparent disk.

    Declaration

    Swift

    public func timeOfSunset(for selenographicCoordinates: SelenographicCoordinates) -> JulianDay

    Parameters

    selCoords

    The position on the Moon surface.

    Return Value

    The julian day of the sunset.

KPCAAMoonPerigeeApogee

  • Computes the date of the perigee.

    Declaration

    Swift

    public func perigee(_ mean: Bool = true) -> JulianDay

    Parameters

    mean

    If true, the mean value is computed. Otherwise, the true one…

    Return Value

    A julian day.

  • Computes the date of the apogeee.

    Declaration

    Swift

    public func apogee(_ mean: Bool = true) -> JulianDay

    Parameters

    mean

    If true, the mean value is computed. Otherwise, the true one…

    Return Value

    A julian day.

  • Computes the parallax of the perigee

    Declaration

    Swift

    public func perigeeParallax() -> ArcSecond

    Return Value

    The parallax in arcseconds.

  • Computes the parallax of the apogeee

    Declaration

    Swift

    public func apogeeParallax() -> ArcSecond

    Return Value

    The parallax in arcseconds.

KPCAAMoonMaxDeclinations

  • Compute the date of the maximum declination of the Moon.

    Computation are geocentric, and they refer to the center of the Moon’s disk.

    The plan of the Moon’s orbit forms with the plane of ecliptic an angle of 5º. Therefore, in the sky the Moon is moving approximatively along the ecliptic, and during each revolution (27 days) it reaches its greatest northern declination (in Tauris, Gemini or in northern Orion), and two weeks later its greatest southern declination (in Sagittarius or in Ophiuchus).

    Because the lunar orbit forms with the ecliptic an angle of 5º, and the ecliptic an angle of 23º with the celestial equator, the extreme declinations of the Moon are between 18º and 28º (North or South), approximately. When, as in 1987, the ascending node of the lunar orbit is in the vicinity of the the vernal equinox, the Moon reaches high northern and southern declinations, approximately +28.5º and -28.5º. This situation is repeated at intervals of 18.6 years, the revolution period of the lunar nodes.

    Note that the word ‘mean’ is opposed to ‘true’ in the sense that the former takes into accounnt the abberration and light-time effects. Since the word ‘true’ is a reserved word in the Swift programmatic language, the parameter name must be different, hence the choice of the word ‘mean’.

    Declaration

    Swift

    public func dateOfGreatestDeclination(_ mean: Bool = true, northernly: Bool = true) -> JulianDay

    Parameters

    mean

    If mean=true, compute the date of the mean greatest dec. Otherwise, compute the… true one.

    northernly

    If true, computes the date of the mean greatest dec. for the Earth northern hemisphere.

    Return Value

    The date of the greatest declination of the Moon

  • Compute the value of the maximum declination of the Moon

    Declaration

    Swift

    public func greatestDeclination(_ mean: Bool = true, northernly: Bool = true) -> Degree

    Parameters

    mean

    If mean=true, compute the date of the mean greatest dec. Otherwise, compute the… true one.

    northernly

    If true, computes the date of the mean greatest dec. for the Earth northern hemisphere.

    Return Value

    The greatest declination of the Moon

  • Compute the geocentric elongation of the Moon

    Declaration

    Swift

    public func geocentricElongation() -> Degree

    Return Value

    The geocentric elongation of the Moon

  • The phase angle of the Moon

    Declaration

    Swift

    public func phaseAngle() -> Degree

    Return Value

    The phase angle of the Moon (full moon = 0°, first/last quarter = +90°, new moon = +180°)

  • The illuminated fraction of the Moon

    Declaration

    Swift

    public func illuminatedFraction() -> Double

    Return Value

    A number between 0. and 1. representing the illuminated fraction of the Moon

  • The position angle of the Moon’s bright limb is the position angle of the midpoint of the illuminated limb of the Moon, reckoned eastward from the North Point of the disk (not from the axis of rotation of the lunar globe).

    Declaration

    Swift

    public func positionAngleOfTheBrightLimb() -> Degree

    Return Value

    The position angle of the Moon’s bright limb.

Moon Nodes