naqsha-0.1.0.0: A library for working with map and various maping formats.

Safe HaskellNone
LanguageHaskell2010

Naqsha.Position

Contents

Description

This module captures position of a point on the globe.

Synopsis

Basics

A point on the globe is specified by giving its geo coordinates captures by the type Geo. It is essentially a pair of the Latitude and Longitude of the point.

Examples

kanpurLatitude  :: Latitude
kanpurLatitude  = lat $ degree 26.4477777
kanpurLongitude :: Longitude
kanpurLongitude = lon $ degree 80.3461111
kanpurLatitude  = lat $ degree 26 <> minute 26 <> second 52
kanpurLongitude = lon $ degree 80 <> minute 20 <> second 46

The show and read instance of the Latitude and Longitude types uses degrees for displaying and reading respectively. Show and Read instances can express these quantities up to Nano degree precision.

Convention on sign.

For latitudes, positive means north and negative means south. For longitudes, positive means east and negative means west. However, if you find these conventions confusing you can use the combinators north, south, east, and west when constructing latitudes or longitudes.

data Geo Source #

The coordinates of a point on the earth's surface.

Constructors

Geo !Latitude !Longitude 

Instances

Eq Geo Source # 

Methods

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

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

Show Geo Source # 

Methods

showsPrec :: Int -> Geo -> ShowS #

show :: Geo -> String #

showList :: [Geo] -> ShowS #

Default Geo Source # 

Methods

def :: Geo #

Vector Vector Geo Source # 
MVector MVector Geo Source # 
data Vector Geo Source # 
data MVector s Geo Source # 

northPole :: Geo Source #

The North pole

southPole :: Geo Source #

The South pole

Latitudes

data Latitude Source #

The latitude of a point. Positive denotes North of Equator where as negative South.

Instances

Bounded Latitude Source # 
Eq Latitude Source # 
Ord Latitude Source # 
Read Latitude Source # 
Show Latitude Source # 
Default Latitude Source # 

Methods

def :: Latitude #

Angular Latitude Source # 
Vector Vector Latitude Source # 
MVector MVector Latitude Source # 
data Vector Latitude Source # 
data MVector s Latitude Source # 

north :: Angle -> Latitude Source #

Convert an angle to a northern latitude

tropicOfCancer = north $ degree 23.5

south :: Angle -> Latitude Source #

Convert an angle to a southern latitude.

 tropicOfCapricon = south $ degree 23.5

lat :: Angle -> Latitude Source #

Construct latitude out of an angle.

equator :: Latitude Source #

The latitude of equator.

tropicOfCancer :: Latitude Source #

The latitude corresponding to the Tropic of Cancer.

tropicOfCapricon :: Latitude Source #

The latitude corresponding to the Tropic of Capricon

Longitudes.

data Longitude Source #

The longitude of a point. Positive denotes East of the Greenwich meridian where as negative denotes West.

Instances

Bounded Longitude Source # 
Eq Longitude Source # 
Ord Longitude Source # 
Read Longitude Source # 
Show Longitude Source # 
Monoid Longitude Source # 
Default Longitude Source # 

Methods

def :: Longitude #

Group Longitude Source # 
Angular Longitude Source # 
Vector Vector Longitude Source # 
MVector MVector Longitude Source # 
data Vector Longitude Source # 
data MVector s Longitude Source # 

east :: Angle -> Longitude Source #

Convert angle to an eastern longitude.

kanpurLongitude = east $ degree 80.3461

west :: Angle -> Longitude Source #

Convert angle to a western longitude

newyorkLongitude = west $ degree 74.0059

lon :: Angle -> Longitude Source #

Convert angles to longitude.

greenwich :: Longitude Source #

The zero longitude.