Copyright | (c) 2020 Cedric Liegeois |
---|---|
License | BSD3 |
Maintainer | Cedric Liegeois <ofmooseandmen@yahoo.fr> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Types and functions for working with speed in metres per second, kilometres per hour, miles per hour, knots or feet per second.
In order to use this module you should start with the following imports:
import Data.Geo.Jord.Speed (Speed) import qualified Data.Geo.Jord.Speed as Speed
Synopsis
- data Speed
- average :: Length -> Duration -> Speed
- metresPerSecond :: Double -> Speed
- kilometresPerHour :: Double -> Speed
- milesPerHour :: Double -> Speed
- knots :: Double -> Speed
- feetPerSecond :: Double -> Speed
- speed :: ReadP Speed
- read :: String -> Maybe Speed
- toMetresPerSecond :: Speed -> Double
- toKilometresPerHour :: Speed -> Double
- toMilesPerHour :: Speed -> Double
- toKnots :: Speed -> Double
- toFeetPerSecond :: Speed -> Double
- add :: Speed -> Speed -> Speed
- subtract :: Speed -> Speed -> Speed
- zero :: Speed
The Speed
type
A speed with a resolution of 1 millimetre per hour.
Smart constructors
Read
Parses and returns a Speed
formatted as (-)float[ms|kmh|mph|kt].
e.g. 300ms, 250kmh, -154mph, 400kt or 100ft/s.
Conversions
toMetresPerSecond :: Speed -> Double Source #
toMetresPerSecond s
converts s
to metres per second.
toKilometresPerHour :: Speed -> Double Source #
toKilometresPerHour s
converts s
to kilometres per hour.
toMilesPerHour :: Speed -> Double Source #
toMilesPerHour s
converts s
to miles per hour.
toFeetPerSecond :: Speed -> Double Source #
toFeetPerSecond s
converts s
to feet per second.