jord 0.5.0.0 → 0.6.0.0
raw patch · 5 files changed
+23/−14 lines, 5 files
Files
- ChangeLog.md +4/−0
- jord.cabal +6/−5
- src/Data/Geo/Jord.hs +1/−1
- src/Data/Geo/Jord/Earth.hs +11/−7
- src/Data/Geo/Jord/EcefPosition.hs +1/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+### 0.6.0.0++- Fixed Ellipsoid: constructor expected inverseFlattening and not flattening+ ### 0.5.0.0 - Added Benchmarks
jord.cabal view
@@ -1,11 +1,13 @@--- This file has been generated from package.yaml by hpack version 0.28.2.+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.31.1. -- -- see: https://github.com/sol/hpack ----- hash: 2f1ced38bca95f83cdbb2509dc23645a34c628652e960e7a84e9e1b7b6d4ca8c+-- hash: a4e2fc2a432aee57ca9f6d714df611ac3368d7470ccda202db3f966a3d6934e4 name: jord-version: 0.5.0.0+version: 0.6.0.0 synopsis: Geographical Position Calculations description: Please see the README on GitHub at <https://github.com/ofmooseandmen/jord#readme> category: Geography@@ -18,10 +20,9 @@ license: BSD3 license-file: LICENSE build-type: Simple-cabal-version: >= 1.10 extra-source-files:- ChangeLog.md README.md+ ChangeLog.md source-repository head type: git
src/Data/Geo/Jord.hs view
@@ -55,4 +55,4 @@ -- | version. jordVersion :: String -jordVersion = "0.5.0.0" +jordVersion = "0.6.0.0"
src/Data/Geo/Jord/Earth.hs view
@@ -47,7 +47,7 @@ eccentricity (Ellipsoidal e) = sqrt (1.0 - (b * b) / (a * a)) where a = semiMajorAxis e - b = semiMinorAxis a (inverseFlattening e) + b = semiMinorAxis a (flattening e) eccentricity (Spherical _) = 0 -- | Computes the mean radius of the given 'Earth' model. @@ -57,7 +57,7 @@ meanRadius (Ellipsoidal e) = metres ((2.0 * a + b) / 3.0) where a = semiMajorAxis e - b = semiMinorAxis a (inverseFlattening e) + b = semiMinorAxis a (flattening e) meanRadius (Spherical r) = r -- | Computes the polar radius or semi-minor axis (b) of the given 'Earth' model. @@ -65,7 +65,7 @@ polarRadius (Ellipsoidal e) = metres (semiMinorAxis a f) where a = semiMajorAxis e - f = inverseFlattening e + f = flattening e polarRadius (Spherical r) = r -- | Spherical model derived from given model. @@ -74,15 +74,15 @@ -- | World Geodetic System WGS84 ellipsoid. wgs84 :: Earth -wgs84 = Ellipsoidal (Ellipsoid (metres 6378137.0) (1.0 / 298.257223563)) +wgs84 = Ellipsoidal (Ellipsoid (metres 6378137.0) 298.257223563) -- | Geodetic Reference System 1980 ellipsoid. grs80 :: Earth -grs80 = Ellipsoidal (Ellipsoid (metres 6378137.0) (1.0 / 298.257222101)) +grs80 = Ellipsoidal (Ellipsoid (metres 6378137.0) 298.257222101) -- | World Geodetic System WGS72 ellipsoid. wgs72 :: Earth -wgs72 = Ellipsoidal (Ellipsoid (metres 6378135.0) (1.0 / 298.26)) +wgs72 = Ellipsoidal (Ellipsoid (metres 6378135.0) 298.26) -- | Spherical earth model derived from 'wgs84'. s84 :: Earth @@ -112,6 +112,10 @@ semiMajorAxis :: Ellipsoid -> Double semiMajorAxis = toMetres . equatorialRadius --- | Computes the polar semi-minor axis (b) from @a@ anf @f@. +-- | Computes the polar semi-minor axis (b) from semi major axis @a@ and flattening @f@. semiMinorAxis :: Double -> Double -> Double semiMinorAxis a f = a * (1.0 - f) + +-- | flattening of ellispoid @e@ +flattening :: Ellipsoid -> Double +flattening e = 1.0 / inverseFlattening e
src/Data/Geo/Jord/EcefPosition.hs view
@@ -24,7 +24,7 @@ -- | An earth position expressed in the Earth Centred, Earth Fixed (ECEF) coordinates system. -- --- @ex-ey@ plane is the equatorial plane, @ey@ is on the prime meridian, and @ez@ on the polar axis. +-- @ex-ey@ plane is the equatorial plane, @ex@ is on the prime meridian, and @ez@ on the polar axis. -- -- Note: on a spherical model earth, an /n/-vector is equivalent to a normalised version of an (ECEF) cartesian coordinate. newtype EcefPosition =