Safe Haskell | None |
---|---|
Language | Haskell2010 |
The internal module that exposes the basic geometric types in naqsha. This interface is subject to change and hence use with caution.
Synopsis
- newtype Angle = Angle {}
- degree :: Rational -> Angle
- minute :: Rational -> Angle
- second :: Rational -> Angle
- radian :: Double -> Angle
- toDegree :: Fractional r => Angle -> r
- toRadian :: Angle -> Double
- newtype Latitude = Latitude {}
- newtype Longitude = Longitude {}
- lat :: Angle -> Latitude
- lon :: Angle -> Longitude
Documentation
An abstract angle. Internally, angles are represented as a 64-bit integer with each unit contribute 1/2^64 fraction of a complete circle. This means that angles are accurate up to a resolution of 2 π / 2^64 radians. Angles form a group under the angular addition and the fact that these are represented as integers means one can expect high speed accurate angle arithmetic.
When expressing angles one can use a more convenient notation:
myAngle = degree 21.71167 yourAngle = degree 21 <> minute 42 <> second 42
Instances
toDegree :: Fractional r => Angle -> r Source #
Measure angle in degrees. This conversion may lead to loss of precision.
toRadian :: Angle -> Double Source #
Measure angle in radians. This conversion may lead to loss of precision.
The latitude of a point. Positive denotes North of Equator where as negative South.
Instances
The longitude of a point. Positive denotes East of the Greenwich meridian where as negative denotes West.