| Copyright | Alexander Ignatyev 2016 |
|---|---|
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Astro.Moon
Description
Calculation characteristics of the Moon.
Example
import Data.Astro.Time.JulianDate
import Data.Astro.Coordinate
import Data.Astro.Types
import Data.Astro.Effects
import Data.Astro.CelestialObject.RiseSet
import Data.Astro.Moon
ro :: GeographicCoordinates
ro = GeoC (fromDMS 51 28 40) (-(fromDMS 0 0 5))
dt :: LocalCivilTime
dt = lctFromYMDHMS (DH 1) 2017 6 25 10 29 0
today :: LocalCivilDate
today = lcdFromYMD (DH 1) 2017 6 25
jd :: JulianDate
jd = lctUniversalTime dt
-- distance from the Earth to the Moon in kilometres
mdu :: MoonDistanceUnits
mdu = moonDistance1 j2010MoonDetails jd
-- MDU 0.9550170577020396
distance :: Double
distance = mduToKm mdu
-- 367109.51199772174
-- Angular Size
angularSize :: DecimalDegrees
angularSize = moonAngularSize mdu
-- DD 0.5425033990980761
-- The Moon's coordinates
position :: JulianDate -> EquatorialCoordinates1
position = moonPosition1 j2010MoonDetails
ec1 :: EquatorialCoordinates1
ec1 = position jd
-- EC1 {e1Declination = DD 18.706180658927323, e1RightAscension = DH 7.56710547682055}
hc :: HorizonCoordinates
hc = ec1ToHC ro jd ec1
-- HC {hAltitude = DD 34.57694951316064, hAzimuth = DD 103.91119101451832}
-- Rise and Set
riseSet :: RiseSetMB
riseSet = riseAndSet2 0.000001 position ro verticalShift today
-- RiseSet
-- (Just (2017-06-25 06:22:51.4858 +1.0,DD 57.81458864497365))
-- (Just (2017-06-25 22:28:20.3023 +1.0,DD 300.4168238905249))
-- Phase
phase :: Double
phase = moonPhase j2010MoonDetails jd
-- 2.4716141948212922e-2
sunEC1 :: EquatorialCoordinates1
sunEC1 = sunPosition2 jd
-- EC1 {e1Declination = DD 23.37339098989099, e1RightAscension = DH 6.29262026252748}
limbAngle :: DecimalDegrees
limbAngle = moonBrightLimbPositionAngle ec1 sunEC1
-- DD 287.9869373767473
- moonPosition1 :: MoonDetails -> JulianDate -> EquatorialCoordinates1
- moonPosition2 :: MoonDetails -> MoonDistanceUnits -> GeographicCoordinates -> Double -> JulianDate -> EquatorialCoordinates1
- moonDistance1 :: MoonDetails -> JulianDate -> MoonDistanceUnits
- moonAngularSize :: MoonDistanceUnits -> DecimalDegrees
- moonHorizontalParallax :: MoonDistanceUnits -> DecimalDegrees
- moonPhase :: MoonDetails -> JulianDate -> Double
- moonBrightLimbPositionAngle :: EquatorialCoordinates1 -> EquatorialCoordinates1 -> DecimalDegrees
Documentation
moonPosition1 :: MoonDetails -> JulianDate -> EquatorialCoordinates1 Source #
Calculate Equatorial Coordinates of the Moon with the given MoonDetails and at the given JulianDate.
It is recommended to use j2010MoonDetails as a first parameter.
moonPosition2 :: MoonDetails -> MoonDistanceUnits -> GeographicCoordinates -> Double -> JulianDate -> EquatorialCoordinates1 Source #
Calculate Equatorial Coordinates of the Moon with the given MoonDetails, distance to the Moon, geographic coordinates of the onserver, height above sea-level of the observer measured in metres (20 is a good reasonable value for the height) and at the given JulianDate.
It is recommended to use j2010MoonDetails as a first parameter,
to obtain the distance to the Moon you can use moonDistance1 function.
moonPosition2 takes into account parallax effect.
moonDistance1 :: MoonDetails -> JulianDate -> MoonDistanceUnits Source #
Calculates the Moon's Distance at the given julian date.
Returns distance to the Moon
moonDistance1 :: JulianDate -> MoonDistanceUnits
you can use mduToKm (defined in Data.Astro.Moon.MoonDetails) to convert result to kilometers
moonAngularSize :: MoonDistanceUnits -> DecimalDegrees Source #
Calculate the Moon's angular size at the given distance.
moonHorizontalParallax :: MoonDistanceUnits -> DecimalDegrees Source #
Calculates the Moon's horizontal parallax at the given distance.
moonPhase :: MoonDetails -> JulianDate -> Double Source #
Calculates the Moon's phase (the area of the visible segment expressed as a fraction of the whole disk) at the given universal time.
moonBrightLimbPositionAngle :: EquatorialCoordinates1 -> EquatorialCoordinates1 -> DecimalDegrees Source #
Calculate the Moon's position-angle of the bright limb. It takes the Moon's coordinates and the Sun's coordinates. Position-angle is the angle of the midpoint of the illuminated limb measured eastwards from the north point of the disk.