jord-2.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.

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

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 speed.

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 #

Smart constructors

average :: 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

speed :: ReadP Speed Source #

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

read :: String -> Maybe Speed Source #

Reads a Speed from the given string using speed.

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.

Misc

add :: Speed -> Speed -> Speed Source #

Adds 2 speeds.

subtract :: Speed -> Speed -> Speed Source #

Subtracts 2 speeds.

zero :: Speed Source #

0 speed.