module Data.Geo.ElevatedCurve(
ElevatedCurve,
elevatedCurve,
curveLength
) where
import Data.Geo.GeodeticCurve
import Data.Geo.Elevation
import Data.Geo.Accessor.Curve
import Data.Geo.Accessor.Ele
import Data.Geo.Accessor.EllipsoidalDistance
import Data.Geo.Accessor.Value
data ElevatedCurve = ElevatedCurve GeodeticCurve Elevation
deriving (Eq, Show)
instance Curve ElevatedCurve where
curve (ElevatedCurve x _) = x
instance Ele ElevatedCurve where
ele (ElevatedCurve _ x) = x
elevatedCurve :: GeodeticCurve -> Elevation -> ElevatedCurve
elevatedCurve = ElevatedCurve
curveLength :: ElevatedCurve -> Double
curveLength c = let d = ellipsoidalDistance . curve $ c
square x = x * x
in sqrt (square d + square (value . ele $ c))