astro-0.4.2.1: Amateur astronomical computations

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

 Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # MethodsproperFraction :: Integral b => DecimalDegrees -> (b, DecimalDegrees) #truncate :: Integral b => DecimalDegrees -> b #round :: Integral b => DecimalDegrees -> b #ceiling :: Integral b => DecimalDegrees -> b #floor :: Integral b => DecimalDegrees -> b # Source # MethodsshowList :: [DecimalDegrees] -> ShowS #

newtype DecimalHours Source #

Constructors

 DH Double

Instances

 Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # MethodsproperFraction :: Integral b => DecimalHours -> (b, DecimalHours) #truncate :: Integral b => DecimalHours -> b #round :: Integral b => DecimalHours -> b #ceiling :: Integral b => DecimalHours -> b #floor :: Integral b => DecimalHours -> b # Source # MethodsshowList :: [DecimalHours] -> ShowS #

Geographic Coordinates

Constructors

 GeoC Fields

Instances

 Source # Methods Source # Methods

newtype AstronomicalUnits Source #

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

Constructors

 AU Double

Instances

 Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methodstruncate :: Integral b => AstronomicalUnits -> b #round :: Integral b => AstronomicalUnits -> b #ceiling :: Integral b => AstronomicalUnits -> b #floor :: Integral b => AstronomicalUnits -> b # Source # MethodsshowList :: [AstronomicalUnits] -> ShowS #

Light travel time of the distance in Astronomical Units

Convert from kilometers to Astronomical Units

Comvert from Astronomical Units to kilometers

Convert decimal degrees to decimal hours

Convert decimal hours to decimal degrees

Convert from DecimalDegrees to Radians

Convert from Radians to DecimalDegrees

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

Convert Degrees, Minutes, Seconds to DecimalDegrees

toDMS :: (Integral b, Integral a) => DecimalDegrees -> (a, b, Double) Source #

Convert DecimalDegrees to Degrees, Minutes, Seconds

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

Comvert Hours, Minutes, Seconds to DecimalHours

toHMS :: (Integral b, Integral a) => DecimalHours -> (a, b, Double) Source #

Convert DecimalDegrees to Degrees, Minutes, Seconds