Angles¶
Angle Types¶
GeodePy supports Angular Notation in 9 different formats
ABRV |
FORMAT (type) |
|---|---|
rad |
Radians (stored as float) |
dec |
Decimal Degrees (stored as float) |
Decimal Degrees (via DECAngle class) |
|
hp |
Hewlett Packard (HP) Notation (stored as float) |
Hewlett Packard (HP) Notation (via HPAngle class) |
|
gon |
Gradians (stored as float) |
Gradians (via GONAngle class) |
|
Degrees, Minutes and Seconds Notation (via DMSAngle class) |
|
Degrees and Decimal Minutes Notation (via DDMAngle class) |
Conversion between all formats is supported as shown below:
Radians to/from Decimal Degrees via built in math.radians and math.degrees
Formats as floats to all other types via functions in the form abrv2abrv
e.g. gon2hpa()
DECAngle, HPAngle, GONAngle, DMSAngle and DDMAngle class objects via methods in the form CLASS.abrv()
e.g. HPAngle(value).dec()
All angle classes can be seen below:
- class geodepy.angles.DECAngle(dec_angle=0.0)[source]¶
Class for working with angles in Decimal Degrees
Note: GeodePy also supports working with angles in Decimal Degrees as floats
- Parameters:
dec_angle – float Decimal Degrees angle
- ddm()[source]¶
Convert to Degrees, Decimal Minutes Object
- Returns:
Degrees, Decimal Minutes Object
- Return type:
- dms()[source]¶
Convert to Degrees, Minutes, Seconds Object
- Returns:
Degrees, Minutes, Seconds Object
- Return type:
- class geodepy.angles.HPAngle(hp_angle=0.0)[source]¶
Class for working with angles in Hewlett-Packard (HP) format
Note: GeodePy also supports working with angles in HP format as floats
- Parameters:
hp_angle – float HP angle
- ddm()[source]¶
Convert to Degrees, Decimal Minutes Object
- Returns:
Degrees, Decimal Minutes Object
- Return type:
- class geodepy.angles.GONAngle(gon_angle=0.0)[source]¶
Class for working with angles in Gradians (90 degrees == 100 Gradians)
Note: GeodePy also supports working with angles in Gradians as floats
- Parameters:
gon_angle – float Gradian angle
- ddm()[source]¶
Convert to Degrees, Decimal Minutes Object
- Returns:
Degrees, Decimal Minutes Object
- Return type:
- dms()[source]¶
Convert to Degrees, Minutes, Seconds Object
- Returns:
Degrees, Minutes, Seconds Object
- Return type:
- class geodepy.angles.DMSAngle(degree, minute=0, second=0.0, positive=None)[source]¶
Class for working with angles in Degrees, Minutes and Seconds format
- Parameters:
degree (float | str) – Angle: whole degrees component (floats truncated) Alt: formatted string ‘±DDD MM SS.SSS’
minute (float) – Angle: whole minutes component (floats truncated)
second (float) – Angle: seconds component (floats preserved)
positive (bool) – Optional. True is positive, False is negative. Evaluated from deg/min/sec where None
- ddm()[source]¶
Convert to Degrees, Decimal Minutes Object
- Returns:
Degrees, Decimal Minutes Object
- Return type:
- class geodepy.angles.DDMAngle(degree, minute=0.0, positive=None)[source]¶
Class for working with angles in Degrees, Decimal Minutes format
- Parameters:
degree (float | str) – Angle: whole degrees component (floats truncated)
minute (float) – Angle: minutes component (floats preserved)
positive (bool) – Optional. True is positive, False is negative. Evaluated from deg/min/sec where None
- dms()[source]¶
Convert to Degrees, Minutes, Seconds Object
- Returns:
Degrees, Minutes, Seconds Object
- Return type:
Angle Conversions¶
All conversion functions can be seen below.
For converting decimal degree to other formats:
- geodepy.angles.dec2hp(dec)[source]¶
Converts Decimal Degrees to HP Notation (float) :param dec: Decimal Degrees :type dec: float :return: HP Notation (DDD.MMSSSS) :rtype: float
- geodepy.angles.dec2hpa(dec)[source]¶
Converts Decimal Degrees to HP Angle Object
- Parameters:
dec (float) – Decimal Degrees
- Returns:
HP Angle Object (DDD.MMSSSS)
- Return type:
- geodepy.angles.dec2gon(dec)[source]¶
Converts Decimal Degrees to Gradians
- Parameters:
dec (float) – Decimal Degrees
- Returns:
Gradians
- Return type:
float
- geodepy.angles.dec2gona(dec)[source]¶
Converts Decimal Degrees to Gradians (class)
- Parameters:
dec (float) – Decimal Degrees
- Returns:
Gradians
- Return type:
- geodepy.angles.dec2dms(dec)[source]¶
Converts Decimal Degrees to Degrees, Minutes, Seconds Object
- Parameters:
dec (float) – Decimal Degrees
- Returns:
Degrees, Minutes, Seconds Object
- Return type:
- geodepy.angles.dec2ddm(dec)[source]¶
Converts Decimal Degrees to Degrees, Decimal Minutes Object
- Parameters:
dec (float) – Decimal Degrees
- Returns:
Degrees, Decimal Minutes Object
- Return type:
For converting Hewlett Packard to other formats:
- geodepy.angles.hp2dec(hp)[source]¶
Converts HP Notation to Decimal Degrees
- Parameters:
hp (float) – HP Notation (DDD.MMSSSS)
- Returns:
Decimal Degrees
- Return type:
float
- geodepy.angles.hp2deca(hp)[source]¶
Converts HP Notation to DECAngle Object
- Parameters:
hp (float) – HP Notation (DDD.MMSSSS)
- Returns:
Decimal Degrees Object
- Return type:
- geodepy.angles.hp2rad(hp)[source]¶
Converts HP Notation to radians
- Parameters:
hp (float) – HP Notation (DDD.MMSSSS)
- Returns:
radians
- Return type:
float
- geodepy.angles.hp2gon(hp)[source]¶
Converts HP Notation to Gradians
- Parameters:
hp (float) – HP Notation (DDD.MMSSSS)
- Returns:
Gradians
- Return type:
float
- geodepy.angles.hp2gona(hp)[source]¶
Converts HP Notation to Gradians (class)
- Parameters:
hp (float) – HP Notation (DDD.MMSSSS)
- Returns:
Gradians
- Return type:
- geodepy.angles.hp2dms(hp)[source]¶
Converts HP Notation to Degrees, Minutes, Seconds Object
- Parameters:
hp (float) – HP Notation (DDD.MMSSSS)
- Returns:
Degrees, Minutes, Seconds Object
- Return type:
- geodepy.angles.hp2ddm(hp)[source]¶
Converts HP Notation to Degrees, Decimal Minutes Object
- Parameters:
hp (float) – HP Notation (DDD.MMSSSS)
- Returns:
Degrees, Decimal Minutes Object
- Return type:
For converting Gradians to other formats:
- geodepy.angles.gon2dec(gon)[source]¶
Converts Gradians to Decimal Degrees
- Parameters:
gon (float) – Gradians
- Returns:
Decimal Degrees
- Return type:
float
- geodepy.angles.gon2deca(gon)[source]¶
Converts Gradians to DECAngle Object
- Parameters:
gon (float) – Gradians
- Returns:
Decimal Degrees Object
- Return type:
- geodepy.angles.gon2hp(gon)[source]¶
Converts Gradians to HP Notation (float)
- Parameters:
gon (float) – Gradians
- Returns:
HP Notation (DDD.MMSSSS)
- Return type:
float
- geodepy.angles.gon2hpa(gon)[source]¶
Converts Gradians to HP Angle Object
- Parameters:
gon (float) – Gradians
- Returns:
HP Angle Object (DDD.MMSSSS)
- Return type:
- geodepy.angles.gon2rad(gon)[source]¶
Converts Gradians to radians
- Parameters:
gon (float) – Gradians
- Returns:
Radians
- Return type:
float
- geodepy.angles.gon2dms(gon)[source]¶
Converts Gradians to Degrees, Minutes, Seconds Object
- Parameters:
gon (float) – Gradians
- Returns:
Degrees, Minutes, Seconds Object
- Return type:
- geodepy.angles.gon2ddm(gon)[source]¶
Converts Gradians to Degrees, Decimal Minutes Object
- Parameters:
gon (float) – Gradians
- Returns:
Degrees, Decimal Minutes Object
- Return type:
Other Converstion Functions:
- geodepy.angles.dd2sec(dd)[source]¶
Converts angle in decimal degrees to angle in seconds
- Parameters:
dd – Decimal Degrees
- Returns:
Seconds