The Longitude class

class nvgr.Longitude(deg: float = 0.0)

Bases: object

The longitude in degrees E (positive) or W (negative)

Attributes

degreesfloat

the longitude in degrees: -180 <= degrees <= -180

radiansfloat, readonly

the longitude in radians: -Pi <= radians <= Pi

Members

__add__(other) - Add a longitude

__sub__(other) - Subtract a longitude

__str__() - Returns the longitude as a string

parse(fmt: str) - Parse a string into a longitude

property degrees

Gets the longitude in degrees

Returns

float

the longitude in degrees: -180 <= degrees <= 180

classmethod parse(fmt: str) Longitude

Parse a longitude in the format: 000-00.0E or 000-00.0W

Parameters

fmtstr

the string to parse into a longitude

Returns

Longitude :

the new longitude

property radians

Gets the longitude in radians

Returns

float

the longitude in radians: -Pi <= radians <= Pi