DegreesMinutesSeconds¶
Namespace: ThinkGeo.Core
This structure represents a degrees, minutes and seconds value.
public struct DegreesMinutesSeconds
Inheritance object → ValueType → DegreesMinutesSeconds
Remarks:
This structure is used in many places to represent decimal degree numbers as degrees, minutes and seconds.
Properties¶
Degrees¶
This property returns the degrees portion of the structure.
public int Degrees { get; set; }
Property Value¶
Remarks:
None
Minutes¶
This property returns the minutes portion of the structure.
public int Minutes { get; set; }
Property Value¶
Remarks:
None
Seconds¶
This property returns the seconds portion of the structure.
public double Seconds { get; set; }
Property Value¶
Remarks:
None
Constructors¶
DegreesMinutesSeconds(int, int, double)¶
This constructor allows you to create an instance of the class by specifying the degree, minute and second values.
DegreesMinutesSeconds(int degrees, int minutes, double seconds)
Parameters¶
degrees int
This parameter represents the degree portion of the structure.
minutes int
This parameter represents the minute portion of the structure.
seconds double
This parameter represents the second portion of the structure.
Remarks:
None
Methods¶
GetHashCode()¶
Serves as hash function for the particular type.
int GetHashCode()
Returns¶
int
The hash code for this particular type.
Equals(object)¶
Compares current DegreesMinutesSeconds with a passing object.
bool Equals(object obj)
Parameters¶
obj object
The passing object which will be used to compare with current DegreesMinutesSeconds.
Returns¶
True if the passing object satisfies the following two conditions:
1) The object is of DegreesMinutesSeconds type.
2) The Degrees, Minutes and Seconds of both DegreesMinutesSeconds should be the
same.
If both conditions are not met, will return false.
Add(DegreesMinutesSeconds)¶
Add two DegreesMinutsSeconds together and return back a summary of the two.
DegreesMinutesSeconds Add(DegreesMinutesSeconds targetDegreesMinutesSeconds)
Parameters¶
targetDegreesMinutesSeconds DegreesMinutesSeconds
The target DegreesMinutesSeconds to be added together.
Returns¶
DegreesMinutesSeconds
The summary of the two DegreesMinutesSeconds.
ToString()¶
This method returns a formatted representation of the degrees, minutes and seconds value.
string ToString()
Returns¶
Remarks:
The value will be formatted in the standard string format: 75º 21' 28"
GetFormattedString(int)¶
This method returns a formatted representation of the degrees, minutes and seconds value that has been rounded to the specified decimals.
string GetFormattedString(int decimals)
Parameters¶
decimals int
The target decimals that the degrees, minutes, seconds value will be rounded to.
Returns¶
This method returns a formatted representation of the degrees, minutes and seconds
value.
Remarks:
The value will be formatted in the standard string format. For example, 75º 21' 2.1235" (when the decimals parameter is set to 4).
GetFormattedString(DegreesMinutesSecondsFormatType)¶
Returns formatted string for .
string GetFormattedString(DegreesMinutesSecondsFormatType formatType)
Parameters¶
formatType DegreesMinutesSecondsFormatType
The format type.
Returns¶
string
A string result.
GetFormattedString(DegreesMinutesSecondsFormatType, int)¶
Returns formatted string for the specified parameters.
string GetFormattedString(DegreesMinutesSecondsFormatType formatType, int decimals)
Parameters¶
formatType DegreesMinutesSecondsFormatType
The format type.
decimals int
The decimals.
Returns¶
string
A string result.