jord-0.6.0.0: Geographical Position Calculations

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

Data.Geo.Jord.Length

Contents

Description

Types and functions for working with (signed) lengths in metres, kilometres, nautical miles or feet.

Synopsis

The Length type

data Length Source #

A length with a resolution of 0.1 millimetre.

Instances
Eq Length Source # 
Instance details

Defined in Data.Geo.Jord.Length

Methods

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

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

Read Length Source #

See readLength.

Instance details

Defined in Data.Geo.Jord.Length

Show Length Source #

Length is shown in metres when absolute value is <= 10,000 m and in kilometres otherwise.

Instance details

Defined in Data.Geo.Jord.Length

Quantity Length Source #

Add/Subtract Lengths.

Instance details

Defined in Data.Geo.Jord.Length

NTransform a => IsGreatArc (Track a, Duration, Length) Source #

GreatArc from track, duration and earth mean radius.

Instance details

Defined in Data.Geo.Jord.Kinematics

Smart constructors

feet :: Double -> Length Source #

Length from given amount of feet.

kilometres :: Double -> Length Source #

Length from given amount of kilometres.

metres :: Double -> Length Source #

Length from given amount of metres.

nauticalMiles :: Double -> Length Source #

Length from given amount of nautical miles.

Read

readLength :: String -> Length Source #

Obtains a Length from the given string formatted as (-)float[m|km|nm|ft] - e.g. 3000m, 2.5km, -154nm or 10000ft.

This simply calls read s :: Length so error should be handled at the call site.

readLengthF :: MonadFail m => String -> m Length Source #

Same as readLength but returns a MonadFail.

Conversions

toFeet :: Length -> Double Source #

toFeet l converts l to feet.

toKilometres :: Length -> Double Source #

toKilometres l converts l to kilometres.

toMetres :: Length -> Double Source #

toMetres l converts l to metres.

toNauticalMiles :: Length -> Double Source #

toNauticalMiles l converts l to nautical miles.