-- | Miscellaneous utils for math
module GIS.Math.Utils where

import           Control.Lens
import           GIS.Types

sinc :: Floating a => a -> a
sinc x = sin x / x

-- | Convert a `Double` from degrees to radians.
radians :: Double -> Double
radians = (*(pi/180))

-- | Convert both coördinates to radians.
toRadians :: Point -> Point
toRadians = over _1 radians . over _2 radians