module Data.Geo.Geodetic.Sphere(
Sphere
, HasSphere(..)
, nSphere
, earthMean
) where
import Prelude(Double, Bool(..), Eq, Show(..), Ord(..), id, (&&), (++), (.), abs, showParen, showString)
import Control.Lens(Iso', Lens', iso)
import Text.Printf(printf)
newtype Sphere =
Sphere Double
deriving (Eq, Ord)
instance Show Sphere where
showsPrec n (Sphere d) =
showParen (n > 10) (showString ("Sphere " ++ printf "%0.4f" d))
nSphere ::
Iso' Double Sphere
nSphere =
iso Sphere (\(Sphere d) -> d)
earthMean ::
Sphere
earthMean =
Sphere 6367450
class HasSphere t where
sphere ::
Lens' t Sphere
instance HasSphere Sphere where
sphere =
id