# Data.Astro.Sun: exported symbols usage examples

## Symbols

• RiseSet No usage example found for this symbol :( Collapse [-]
equationOfTime No usage example found for this symbol :( Collapse [-]
j2010SunDetails No usage example found for this symbol :( Collapse [-]
solarElongation No usage example found for this symbol :( Collapse [-]
sunAngularSize No usage example found for this symbol :( Collapse [-]
sunDetails See 4 Occurences [+] Collapse [-]
Found in Data.Astro.Moon from the package astro
```-- | Calculate the Moon's angular size at the given distance.
moonAngularSize :: MoonDistanceUnits -> DecimalDegrees
moonAngularSize (MDU p) = (mdBigTheta j2010MoonDetails) / (DD p)

-- | Calculates the Moon's horizontal parallax at the given distance.
moonHorizontalParallax :: MoonDistanceUnits -> DecimalDegrees
moonHorizontalParallax (MDU p) = (mdPi j2010MoonDetails) / (DD p)

-- | Calculates the Moon's phase (the area of the visible segment expressed as a fraction of the whole disk)
-- at the given universal time.
moonPhase :: MoonDetails -> JulianDate -> Double
moonPhase md ut =
let sd = sunDetails ut
lambdaS = sunEclipticLongitude2 sd
ms = sunMeanAnomaly2 sd
mmq = meanMoonQuantities md ut
MQ ml _ _ = correctedMoonQuantities lambdaS ms mmq
d = toRadians \$ ml - lambdaS
```

Found in Data.Astro.Moon from the package astro
```-- to obtain the distance to the Moon you can use `moonDistance1` function.
-- `moonPosition2` takes into account parallax effect.
moonPosition2 :: MoonDetails -> MoonDistanceUnits -> GeographicCoordinates -> Double -> JulianDate -> EquatorialCoordinates1
moonPosition2 md distance coords height jd =
let p = moonPosition1 md jd
in parallax coords height (kmToAU \$ mduToKm distance) jd p

-- | 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
moonDistance1 :: MoonDetails -> JulianDate -> MoonDistanceUnits
moonDistance1 md ut =
let sd = sunDetails ut
lambdaS = sunEclipticLongitude2 sd
ms = sunMeanAnomaly2 sd
mmq = meanMoonQuantities md ut
cmq = correctedMoonQuantities lambdaS ms mmq
mm' = toRadians \$ mqAnomaly cmq
```

Found in Data.Astro.Moon from the package astro
```import Data.Astro.Moon.MoonDetails (MoonDetails(..), MoonDistanceUnits(..), j2010MoonDetails, mduToKm)
import Data.Astro.Effects (parallax)

-- | Reduce the value to the range [0, 360)
reduceDegrees :: DecimalDegrees -> DecimalDegrees
reduceDegrees = U.reduceToZeroRange 360

-- | 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.
moonPosition1 :: MoonDetails -> JulianDate -> EquatorialCoordinates1
moonPosition1 md ut =
let sd = sunDetails ut
lambdaS = sunEclipticLongitude2 sd
ms = sunMeanAnomaly2 sd
mmq = meanMoonQuantities md ut
MQ lm'' _ nm' = correctedMoonQuantities lambdaS ms mmq
a = toRadians \$ lm''-nm'
```

Found in Data.Astro.Moon from the package astro
```  , moonDistance1
, moonAngularSize
, moonHorizontalParallax
, moonPhase
, moonBrightLimbPositionAngle
)

where

import qualified Data.Astro.Utils as U
import Data.Astro.Types (DecimalDegrees(..), GeographicCoordinates, toRadians, fromRadians, kmToAU)
import Data.Astro.Time.JulianDate (JulianDate(..), numberOfDays)
import Data.Astro.Coordinate (EquatorialCoordinates1(..), EclipticCoordinates(..), eclipticToEquatorial)
import Data.Astro.Planet (planetBrightLimbPositionAngle)
import Data.Astro.Sun (sunDetails, sunMeanAnomaly2, sunEclipticLongitude2)
import Data.Astro.Moon.MoonDetails (MoonDetails(..), MoonDistanceUnits(..), j2010MoonDetails, mduToKm)
import Data.Astro.Effects (parallax)

-- | Reduce the value to the range [0, 360)
```

sunDistance No usage example found for this symbol :( Collapse [-]
sunEclipticLongitude1 No usage example found for this symbol :( Collapse [-]
sunEclipticLongitude2 See 4 Occurences [+] Collapse [-]
Found in Data.Astro.Moon from the package astro
```moonAngularSize :: MoonDistanceUnits -> DecimalDegrees
moonAngularSize (MDU p) = (mdBigTheta j2010MoonDetails) / (DD p)

-- | Calculates the Moon's horizontal parallax at the given distance.
moonHorizontalParallax :: MoonDistanceUnits -> DecimalDegrees
moonHorizontalParallax (MDU p) = (mdPi j2010MoonDetails) / (DD p)

-- | Calculates the Moon's phase (the area of the visible segment expressed as a fraction of the whole disk)
-- at the given universal time.
moonPhase :: MoonDetails -> JulianDate -> Double
moonPhase md ut =
let sd = sunDetails ut
lambdaS = sunEclipticLongitude2 sd
ms = sunMeanAnomaly2 sd
mmq = meanMoonQuantities md ut
MQ ml _ _ = correctedMoonQuantities lambdaS ms mmq
d = toRadians \$ ml - lambdaS
f = 0.5 * (1 - cos d)
```

Found in Data.Astro.Moon from the package astro
```-- `moonPosition2` takes into account parallax effect.
moonPosition2 :: MoonDetails -> MoonDistanceUnits -> GeographicCoordinates -> Double -> JulianDate -> EquatorialCoordinates1
moonPosition2 md distance coords height jd =
let p = moonPosition1 md jd
in parallax coords height (kmToAU \$ mduToKm distance) jd p

-- | 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
moonDistance1 :: MoonDetails -> JulianDate -> MoonDistanceUnits
moonDistance1 md ut =
let sd = sunDetails ut
lambdaS = sunEclipticLongitude2 sd
ms = sunMeanAnomaly2 sd
mmq = meanMoonQuantities md ut
cmq = correctedMoonQuantities lambdaS ms mmq
mm' = toRadians \$ mqAnomaly cmq
ec = toRadians \$ centreEquation mm'
```

Found in Data.Astro.Moon from the package astro
```import Data.Astro.Effects (parallax)

-- | Reduce the value to the range [0, 360)
reduceDegrees :: DecimalDegrees -> DecimalDegrees
reduceDegrees = U.reduceToZeroRange 360

-- | 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.
moonPosition1 :: MoonDetails -> JulianDate -> EquatorialCoordinates1
moonPosition1 md ut =
let sd = sunDetails ut
lambdaS = sunEclipticLongitude2 sd
ms = sunMeanAnomaly2 sd
mmq = meanMoonQuantities md ut
MQ lm'' _ nm' = correctedMoonQuantities lambdaS ms mmq
a = toRadians \$ lm''-nm'
i = toRadians \$ mdI md
```

Found in Data.Astro.Moon from the package astro
```  , moonDistance1
, moonAngularSize
, moonHorizontalParallax
, moonPhase
, moonBrightLimbPositionAngle
)

where

import qualified Data.Astro.Utils as U
import Data.Astro.Types (DecimalDegrees(..), GeographicCoordinates, toRadians, fromRadians, kmToAU)
import Data.Astro.Time.JulianDate (JulianDate(..), numberOfDays)
import Data.Astro.Coordinate (EquatorialCoordinates1(..), EclipticCoordinates(..), eclipticToEquatorial)
import Data.Astro.Planet (planetBrightLimbPositionAngle)
import Data.Astro.Sun (sunDetails, sunMeanAnomaly2, sunEclipticLongitude2)
import Data.Astro.Moon.MoonDetails (MoonDetails(..), MoonDistanceUnits(..), j2010MoonDetails, mduToKm)
import Data.Astro.Effects (parallax)

-- | Reduce the value to the range [0, 360)
```

sunMeanAnomaly2 See 4 Occurences [+] Collapse [-]
Found in Data.Astro.Moon from the package astro
```moonAngularSize (MDU p) = (mdBigTheta j2010MoonDetails) / (DD p)

-- | Calculates the Moon's horizontal parallax at the given distance.
moonHorizontalParallax :: MoonDistanceUnits -> DecimalDegrees
moonHorizontalParallax (MDU p) = (mdPi j2010MoonDetails) / (DD p)

-- | Calculates the Moon's phase (the area of the visible segment expressed as a fraction of the whole disk)
-- at the given universal time.
moonPhase :: MoonDetails -> JulianDate -> Double
moonPhase md ut =
let sd = sunDetails ut
lambdaS = sunEclipticLongitude2 sd
ms = sunMeanAnomaly2 sd
mmq = meanMoonQuantities md ut
MQ ml _ _ = correctedMoonQuantities lambdaS ms mmq
d = toRadians \$ ml - lambdaS
f = 0.5 * (1 - cos d)
in f
```

Found in Data.Astro.Moon from the package astro
```moonPosition2 :: MoonDetails -> MoonDistanceUnits -> GeographicCoordinates -> Double -> JulianDate -> EquatorialCoordinates1
moonPosition2 md distance coords height jd =
let p = moonPosition1 md jd
in parallax coords height (kmToAU \$ mduToKm distance) jd p

-- | 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
moonDistance1 :: MoonDetails -> JulianDate -> MoonDistanceUnits
moonDistance1 md ut =
let sd = sunDetails ut
lambdaS = sunEclipticLongitude2 sd
ms = sunMeanAnomaly2 sd
mmq = meanMoonQuantities md ut
cmq = correctedMoonQuantities lambdaS ms mmq
mm' = toRadians \$ mqAnomaly cmq
ec = toRadians \$ centreEquation mm'
e = mdE md
```

Found in Data.Astro.Moon from the package astro
```-- | Reduce the value to the range [0, 360)
reduceDegrees :: DecimalDegrees -> DecimalDegrees
reduceDegrees = U.reduceToZeroRange 360

-- | 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.
moonPosition1 :: MoonDetails -> JulianDate -> EquatorialCoordinates1
moonPosition1 md ut =
let sd = sunDetails ut
lambdaS = sunEclipticLongitude2 sd
ms = sunMeanAnomaly2 sd
mmq = meanMoonQuantities md ut
MQ lm'' _ nm' = correctedMoonQuantities lambdaS ms mmq
a = toRadians \$ lm''-nm'
i = toRadians \$ mdI md
y = (sin a) * (cos i)
```

Found in Data.Astro.Moon from the package astro
```  , moonDistance1
, moonAngularSize
, moonHorizontalParallax
, moonPhase
, moonBrightLimbPositionAngle
)

where

import qualified Data.Astro.Utils as U
import Data.Astro.Types (DecimalDegrees(..), GeographicCoordinates, toRadians, fromRadians, kmToAU)
import Data.Astro.Time.JulianDate (JulianDate(..), numberOfDays)
import Data.Astro.Coordinate (EquatorialCoordinates1(..), EclipticCoordinates(..), eclipticToEquatorial)
import Data.Astro.Planet (planetBrightLimbPositionAngle)
import Data.Astro.Sun (sunDetails, sunMeanAnomaly2, sunEclipticLongitude2)
import Data.Astro.Moon.MoonDetails (MoonDetails(..), MoonDistanceUnits(..), j2010MoonDetails, mduToKm)
import Data.Astro.Effects (parallax)

-- | Reduce the value to the range [0, 360)
```

sunPosition1 No usage example found for this symbol :( Collapse [-]
sunPosition2 No usage example found for this symbol :( Collapse [-]
sunRiseAndSet No usage example found for this symbol :( Collapse [-]
SunDetails No usage example found for this symbol :( Collapse [-]