{-# LANGUAGE TemplateHaskell, TypeFamilies, TypeOperators #-}
module Data.Units.Astronomical (
AstronomicalUnit(..), LightYear(..), Parsec(..),
Day(..), JulianYear(..), JulianCentury(..),
SolarMass(..), JovianMass(..), EarthMass(..)
) where
import Data.Constants.Math
import Data.Metrology.TH
import Data.Metrology
import Data.Units.SI
import Data.Units.SI.Prefixes
declareDerivedUnit "Day" [t| Second |] 86400 (Just "D")
declareDerivedUnit "JulianCentury" [t| Day |] 36525 (Just "julian century")
declareDerivedUnit "JulianYear" [t| JulianCentury |] 0.01 (Just "a")
declareDerivedUnit "AstronomicalUnit" [t| Metre |] 149597870700 (Just "au")
declareDerivedUnit "LightYear" [t| Metre |] 9460730472580800 (Just "ly")
declareDerivedUnit "Parsec" [t| AstronomicalUnit |] (648000 / piR) (Just "pc")
declareDerivedUnit "SolarMass" [t| Kilo :@ Gram |] (1.9891 * 10 ^ (30 :: Int)) (Just "S")
declareDerivedUnit "EarthMass" [t| SolarMass |] (1 / 332946.0487) (Just "E")
declareDerivedUnit "JovianMass" [t| SolarMass |] (1 / 1047.348644) (Just "MJ")