astro-0.4.2.0: Amateur astronomical computations

CopyrightAlexander Ignatyev 2016
Safe HaskellSafe
LanguageHaskell2010

Data.Astro.Types

Description

Common Types are usfull across all subsystems like Time and Coordinate.

Examples

Decimal hours and Decimal degrees

import Data.Astro.Types

-- 10h 15m 19.7s
dh :: DecimalHours
dh = fromHMS 10 15 19.7
-- DH 10.255472222222222

(h, m, s) = toHMS dh
-- (10,15,19.699999999999562)


-- 51°28′40″
dd :: DecimalDegrees
dd = fromDMS 51 28 40
-- DD 51.477777777777774

(d, m, s) = toDMS dd
-- (51,28,39.999999999987494)

Geographic Coordinates

import Data.Astro.Types

-- the Royal Observatory, Greenwich
ro :: GeographicCoordinates
ro = GeoC (fromDMS 51 28 40) (-(fromDMS 0 0 5))
-- GeoC {geoLatitude = DD 51.4778, geoLongitude = DD (-0.0014)}

Synopsis

Documentation

newtype DecimalDegrees Source #

Constructors

DD Double 

Instances

Eq DecimalDegrees Source # 
Fractional DecimalDegrees Source # 
Num DecimalDegrees Source # 
Ord DecimalDegrees Source # 
Real DecimalDegrees Source # 
RealFrac DecimalDegrees Source # 
Show DecimalDegrees Source # 

newtype DecimalHours Source #

Constructors

DH Double 

Instances

Eq DecimalHours Source # 
Fractional DecimalHours Source # 
Num DecimalHours Source # 
Ord DecimalHours Source # 
Real DecimalHours Source # 
RealFrac DecimalHours Source # 
Show DecimalHours Source # 

newtype AstronomicalUnits Source #

Astronomical Units, 1AU = 1.4960×1011 m (originally, the average distance of Earth's aphelion and perihelion).

Constructors

AU Double 

Instances

Eq AstronomicalUnits Source # 
Fractional AstronomicalUnits Source # 
Num AstronomicalUnits Source # 
Ord AstronomicalUnits Source # 
Real AstronomicalUnits Source # 
RealFrac AstronomicalUnits Source # 
Show AstronomicalUnits Source # 

lightTravelTime :: AstronomicalUnits -> DecimalHours Source #

Light travel time of the distance in Astronomical Units

kmToAU :: Double -> AstronomicalUnits Source #

Convert from kilometers to Astronomical Units

auToKM :: AstronomicalUnits -> Double Source #

Comvert from Astronomical Units to kilometers

toDecimalHours :: DecimalDegrees -> DecimalHours Source #

Convert decimal degrees to decimal hours

fromDecimalHours :: DecimalHours -> DecimalDegrees Source #

Convert decimal hours to decimal degrees

toRadians :: DecimalDegrees -> Double Source #

Convert from DecimalDegrees to Radians

fromRadians :: Double -> DecimalDegrees Source #

Convert from Radians to DecimalDegrees

fromDMS :: RealFrac a => Int -> Int -> a -> DecimalDegrees Source #

Convert Degrees, Minutes, Seconds to DecimalDegrees

toDMS :: (Integral t, Integral t1) => DecimalDegrees -> (t1, t, Double) Source #

Convert DecimalDegrees to Degrees, Minutes, Seconds

fromHMS :: RealFrac a => Int -> Int -> a -> DecimalHours Source #

Comvert Hours, Minutes, Seconds to DecimalHours

toHMS :: (Integral t, Integral t1) => DecimalHours -> (t1, t, Double) Source #

Convert DecimalDegrees to Degrees, Minutes, Seconds