jord-1.0.0.0: Geographical Position Calculations

Copyright(c) 2020 Cedric Liegeois
LicenseBSD3
MaintainerCedric Liegeois <ofmooseandmen@yahoo.fr>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Geo.Jord.Speed

Contents

Description

Types and functions for working with speed in metres per second, kilometres per hour, miles per hour, knots or feet per second.

Synopsis

The Speed type

data Speed Source #

A speed with a resolution of 1 millimetre per hour.

Instances
Eq Speed Source # 
Instance details

Defined in Data.Geo.Jord.Speed

Methods

(==) :: Speed -> Speed -> Bool #

(/=) :: Speed -> Speed -> Bool #

Ord Speed Source # 
Instance details

Defined in Data.Geo.Jord.Speed

Methods

compare :: Speed -> Speed -> Ordering #

(<) :: Speed -> Speed -> Bool #

(<=) :: Speed -> Speed -> Bool #

(>) :: Speed -> Speed -> Bool #

(>=) :: Speed -> Speed -> Bool #

max :: Speed -> Speed -> Speed #

min :: Speed -> Speed -> Speed #

Read Speed Source #

See speedP.

Instance details

Defined in Data.Geo.Jord.Speed

Show Speed Source #

Speed is shown in kilometres per hour.

Instance details

Defined in Data.Geo.Jord.Speed

Methods

showsPrec :: Int -> Speed -> ShowS #

show :: Speed -> String #

showList :: [Speed] -> ShowS #

Quantity Speed Source #

Add/Subtract Speed.

Instance details

Defined in Data.Geo.Jord.Speed

Smart constructors

averageSpeed :: Length -> Duration -> Speed Source #

Speed from covered distance and duration.

metresPerSecond :: Double -> Speed Source #

Speed from given amount of metres per second.

kilometresPerHour :: Double -> Speed Source #

Speed from given amount of kilometres per hour.

milesPerHour :: Double -> Speed Source #

Speed from given amount of miles per hour.

knots :: Double -> Speed Source #

Speed from given amount of knots.

feetPerSecond :: Double -> Speed Source #

Speed from given amount of feet per second.

Read

speedP :: ReadP Speed Source #

Parses and returns a Speed formatted as (-)float[ms|kmh|mph|kt]. e.g. 300ms, 250kmh, -154mph, 400kt or 100ft/s.

readSpeed :: String -> Maybe Speed Source #

Reads an a Speed from the given string using speedP.

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.

toKnots :: Speed -> Double Source #

toKnots s converts s to knots.

toFeetPerSecond :: Speed -> Double Source #

toFeetPerSecond s converts s to feet per second.