Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
An azimuth in degrees between 0 and 360.
Documentation
class AsAzimuth p f s where Source
Nothing
(Choice p, Applicative f) => AsAzimuth p f Double | A prism on azimuth to an integer between 0 and 359 inclusive. > 7 ^? _Azimuth Just (Azimuth 7.0000) > 0 ^? _Azimuth Just (Azimuth 0.0000) > 359.999 ^? _Azimuth Just (Azimuth 359.9990) > 360 ^? _Azimuth Nothing prlop> all (m -> _Azimuth # m == n) (n ^? _Azimuth) |
AsAzimuth p f Azimuth |
modAzimuth :: Double -> Azimuth Source
Construct an azimuth such that if the given value is out of bounds, a modulus is taken to keep it within 0 inclusive and 360 exclusive.
>>>
modAzimuth 7
Azimuth 7.0000
>>>
modAzimuth 0
Azimuth 0.0000
>>>
modAzimuth 360
Azimuth 0.0000
>>>
modAzimuth 361
Azimuth 1.0000
>>>
modAzimuth 359.999
Azimuth 359.9990