DotSpatial.Positioning
Represents an angular measurement around a circle.
Azimuth Class
Elevation Class
Latitude Class
Longitude Class
These examples create new instances of Angle objects.
Dim MyAngle As New Angle(90)
Angle MyAngle = new Angle(90);
Angle MyAngle = new Angle(90);
Dim MyAngle1 As New Angle(105, 30, 21.4)
Angle MyAngle = new Angle(105, 30, 21.4);
Angle MyAngle = new Angle(105, 30, 21.4);
This class serves as the base class for angular measurement classes within
the framework, such as the Azimuth, Elevation,
Latitude and Longitude classes. An "angular
measurement" is a measurement around a circle. Typically, angular measurements are
between 0° and 360°.
Angles can be represented in two forms: decimal and sexagesimal. In decimal
form, angles are represented as a single number. In sexagesimal form, angles are
represented in three components: hours, minutes, and seconds, very much like a
clock.
Upon creating an Angle object, other properties such as
DecimalDegrees, DecimalMinutes,
Hours, Minutes and Seconds are
calculated automatically.
Instances of this class are guaranteed to be thread-safe because they are
immutable (properties can only be modified via constructors).
Facilitates the creation of a deep copy of an object.
The destination type for the ICloneable interface.
Creates a deep copy of the object.
Represents the minimum value of an angle in one turn of a circle.
This example creates an angle representing the minimum allowed value.
Dim MyAngle As Angle = Angle.Minimum
Angle MyAngle = Angle.Minimum;
Angle MyAngle = Angle.Minimum;
An Angle with a value of -359.999999°.
Represents an angle with no value.
An Angle containing a value of zero (0°).
IsEmpty Property
Represents an angle with infinite value.
Represents the maximum value of an angle in one turn of a circle.
This example creates an angle representing the maximum allowed value of 359.9999°.
Dim MyAngle As Angle = Angle.Maximum
Angle MyAngle = Angle.Maximum;
Represents an invalid or unspecified value.
Creates a new instance with the specified decimal degrees.
The decimal degrees.
This example demonstrates how to create an angle with a measurement of 90°.
Dim MyAngle As New Angle(90)
Angle MyAngle = new Angle(90);
An Angle containing the specified value.
Creates a new instance with the specified degrees.
The hours.
An Angle containing the specified value.
Creates a new instance with the specified hours, minutes and
seconds.
The hours.
The minutes.
The seconds.
This example demonstrates how to create an angular measurement of 34°12'29.2 in
hours, minutes and seconds.
Dim MyAngle As New Angle(34, 12, 29.2)
Angle MyAngle = new Angle(34, 12, 29.2);
An Angle containing the specified value.
Creates a new instance with the specified hours and decimal minutes.
The hours.
The decimal minutes.
This example demonstrates how an angle can be created when only the hours and
minutes (in decimal form) are known. This creates a value of 12°42.345'.
Dim MyAngle As New Angle(12, 42.345)
Angle MyAngle = new Angle(12, 42.345);
An Angle containing the specified value.
Creates a new instance by converting the specified string.
The value.
Parse Method
This example creates a new instance by parsing a string. (Notice The double-quote is
doubled up to represent a single double-quote in the string.)
Dim MyAngle As New Angle("123°45'67.8""")
Angle MyAngle = new Angle("123°45'67.8\"");
An Angle containing the specified value.
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
This constructor parses the specified string into an Angle
object using the current culture. This constructor can parse any strings created via
the ToString method.
Creates a new instance by converting the specified string using the specified
culture.
The value.
The culture.
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
This constructor parses the specified string into an Angle
object using a specific culture. This constructor can parse any strings created via the
ToString method.
Creates a new instance by deserializing the specified XML.
The reader.
Returns the object with the largest value.
An Angle object to compare to the current instance.
An Angle containing the largest value.
Returns the object with the smallest value.
An Angle object to compare to the current instance.
The Angle containing the smallest value.
Returns an angle opposite of the current instance.
An Angle representing the mirrored value.
This example creates a new Angle of 45° then calculates its mirror
of 225°. (45 + 180)
Dim Angle1 As New Angle(45)
Dim Angle2 As Angle = Angle1.Mirror()
Debug.WriteLine(Angle2.ToString())
' Output: 225
Angle Angle1 = new Angle(45);
Angle Angle2 = Angle1.Mirror();
Console.WriteLine(Angle2.ToString());
// Output: 225
This method returns the "opposite" of the current instance. The opposite is
defined as the point on the other side of an imaginary circle. For example, if an angle
is 0°, at the top of a circle, this method returns 180°, at the bottom of the
circle.
Modifies a value to its equivalent between 0° and 360°.
An Angle representing the normalized angle.
Normalize(Angle) Method
This example demonstrates how normalization is used. The Stop statement is hit.
This example demonstrates how the Normalize method can ensure that an angle fits
between 0° and 359.9999°. This example normalizes 725° into 5°.
Dim MyAngle As New Angle(720)
MyAngle = MyAngle.Normalize()
Angle MyAngle = new Angle(720);
MyAngle = MyAngle.Normalize();
Dim MyValue As New Angle(725)
MyValue = MyValue.Normalize()
Angle MyValue = new Angle(725);
MyValue = MyValue.Normalize();
This function is used to ensure that an angular measurement is within the
allowed bounds of 0° and 360°. If a value of 360° or 720° is passed, a value of 0°
is returned since 360° and 720° represent the same point on a circle. For the Angle
class, this function is the same as "value Mod 360".
Converts the current instance into radians.
A Radian object.
Radian Class
Converts an angular measurement into radians before further processing.
This example converts a measurement of 90° into radians.
Dim MyAngle As New Angle(90)
Dim MyRadians As Radian = MyAngle.ToRadians()
Angle MyAngle = new Angle(90);
Radian MyRadians = MyAngle.ToRadians();
This function is typically used to convert an angular measurement into
radians before performing a trigonometric function.
Outputs the angle as a string using the specified format.
The format.
A String in the specified format.
ToString Method
Parse Method
This example uses the ToString method to output an angle in a
custom format. The " h° " code represents hours along with a
degree symbol (Alt+0176 on the keypad), and " m.mm " represents
the minutes out to two decimals. Mmm.
Dim MyAngle As New Angle(45, 16.772)
Debug.WriteLine(MyAngle.ToString("h°m.mm"))
' Output: 45°16.78
Dim MyAngle As New Angle(45, 16.772);
Debug.WriteLine(MyAngle.ToString("h°m.mm"));
// Output: 45°16.78
This method returns the current instance output in a specific format. If no
value for the format is specified, a default format of "d.dddd°" is used. Any
string output by this method can be converted back into an Angle object using the
Parse method or Angle(string) constructor.
Returns the smallest integer greater than the specified value.
Returns the largest integer which is smaller than the specified value.
Returns a new instance whose Seconds property is evenly divisible by 15.
An Angle containing the rounded value.
This method is used to align or "snap" an angle to a regular interval. For
example, a grid might be easier to read if it were drawn at 30-second intervals instead
of 24.198-second intervals.
Returns a new instance whose value is rounded the specified number of decimals.
An Integer specifying the number of decimals to round off to.
Returns a new angle whose Seconds property is evenly divisible by the specified amount.
A Double between 0 and 60 indicating the interval to round
to.
An Angle containing the rounded value.
This method is used to align or "snap" an angle to a regular interval. For
example, a grid might be easier to read if it were drawn at 30-second intervals instead
of 24.198-second intervals.
Compares the current value to another Angle object's value.
An Angle, Double, or Integer
to compare with.
A Boolean, True if the object's DecimalDegrees
properties match.
This
Returns a unique code for this instance.
An Integer representing a unique code for the current
instance.
Since the Angle class is immutable, this property may be used
safely with hash tables.
Outputs the angle as a string using the default format.
A String created using the default format.
Parse Method
This example outputs a value of 90 degrees in the default format of ###.#°.
Dim MyAngle As New Angle(90)
Debug.WriteLine(MyAngle.ToString)
' Output: "90°"
Angle MyAngle = new Angle(90);
Debug.WriteLine(MyAngle.ToString());
// Output: "90°"
This method formats the current instance using the default format of
"d.dddd°." Any string output by this method can be converted back into an Angle
object using the Parse method or Angle(string)
constructor.
Converts the specified value to its equivalent between 0° and 360°.
A Double value to be normalized.
An Angle containing a value equivalent to the value specified, but between 0° and
360°.
Converts an angular measurement into radians.
The value.
A Radian object.
This example shows a quick way to convert an angle of 90° into radians.
Dim MyRadian As Radian = Angle.ToRadians(90)
Radian MyRadian = Angle.ToRadians(90);
This function is typically used to convert an angular measurement into
radians before performing a trigonometric function.
Converts a value in radians into an angular measurement.
The radians.
ToRadians
Radian Class
This example uses the FromRadians method to convert a value of one
radian into an Angle of 57°.
' Create a new angle equal to one radian
Dim MyRadians As New Radian(1)
Dim MyAngle As Angle = Angle.FromRadians(MyRadians)
Debug.WriteLine(MyAngle.ToString())
' Output: 57°
// Create a new angle equal to one radian
Radian MyRadians = new Radian(1);
Angle MyAngle = Angle.FromRadians(MyRadians);
Console.WriteLine(MyAngle.ToString());
// Output: 57°
This function is typically used in conjunction with the
ToRadians
method after a trigonometric function has completed. The converted value is stored in
the DecimalDegrees property.
Froms the radians.
The radians.
Convers a sexagesimal number into an Angle.
A Double value, a number in the form of DDD.MMSSSSS format
An Angle object.
Returns the object with the smallest value.
A Angle object to compare to value2.
A Angle object to compare to value1.
The Angle containing the smallest value.
Returns the object with the largest value.
A Angle object to compare to value2.
A Angle object to compare to value1
A Angle containing the largest value.
Returns a random angle between 0° and 360°.
An Angle containing a random value.
Returns a random Angle between 0° and 360°
A Random object used to ogenerate random values.
An Angle containing a random value.
Converts a decimal degree measurement as a Double into an Angle.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Single into an Angle.
The value.
The result of the conversion.
Converts a measurement in Radians into an Angle.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Angle into an Double.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Angle into a Single.
The value.
The result of the conversion.
Converts a measurement in degrees as an Integer into an Angle.
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Converts a measurement in the form of a formatted String into an Angle.
The value.
The result of the conversion.
Converts an Angle into a String.
The value.
The result of the conversion.
This operator calls the ToString() method using the current culture.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Returns the current instance increased by one.
An Angle object.
This example uses the Increment method to increase an angle's
value. It also demonstrates the subtle error which can be caused if
Increment is called while ignoring the return value.
' Correct use of Increment
Dim Angle1 As New Angle(89)
Angle1 = Angle1.Increment()
' Incorrect use of Increment
Dim Angle1 = New Angle(89)
Angle1.Increment()
' Notice: Angle1 will still be 89°!
// Correct use of Increment
Angle Angle1 = new Angle(89);
Angle1 = Angle1.Increment();
// Incorrect use of Increment
Angle Angle1 = new Angle(89);
Angle1.Increment();
// Notice: Angle1 will still be 89°!
This method increases the DecimalDegrees property by 1.0,
returned as a new instance.
Since the Angle class is immutable, this
method cannot be used to modify an existing instance.
Increases the current instance by the specified value.
A Double to add to the current instance.
A new Angle containing the summed values.
This example adds 45° to the current instance of 45°, returning 90°.
Dim Angle1 As New Angle(45)
Angle1 = Angle1.Add(45)
Angle Angle1 = new Angle(45);
Angle1 = Angle1.Add(45);
Adds the specified angle.
The angle.
Returns the current instance decreased by one.
An Angle object.
This example uses the Decrement method to decrease an angle's
value. It also demonstrates the subtle error which can be caused if
Decrement is called while ignoring the return value.
' Correct use of Decrement
Dim Angle1 As New Angle(91)
Angle1 = Angle1.Decrement()
' Incorrect use of Decrement
Dim Angle1 = New Angle(91)
Angle1.Increment()
' NOTE: Angle1 will still be 91°!
// Correct use of Decrement
Angle Angle1 = new Angle(91);
Angle1 = Angle1.Decrement();
// Incorrect use of Decrement
Angle Angle1 = new Angle(91);
Angle1.Decrement();
// NOTE: Angle1 will still be 91°!
This method decreases the DecimalDegrees property by 1.0,
returned as a new instance.
Since the Angle class is immutable, this
method cannot be used to modify an existing instance.
Decreases the current instance by the specified value.
A Double to subtract from the current instance.
A new Angle containing the new value.
This example subtracts 30° from the current instance of 90°, returning 60°.
Dim Angle1 As New Angle(90)
Angle1 = Angle1.Subtract(30)
Angle Angle1 = new Angle(90);
Angle1 = Angle1.Subtract(30);
Subtracts the specified value.
The value.
Multiplies the current instance by the specified value.
A Double to multiply with the current instance.
A new Angle containing the product of the two numbers.
This example multiplies 30° with three, returning 90°.
Dim Angle1 As New Angle(30)
Angle1 = Angle1.Multiply(3)
Angle Angle1 = new Angle(30);
Angle1 = Angle1.Multiply(3);
Multiplies the specified value.
The value.
Divides the current instance by the specified value.
A Double representing a denominator to divide by.
An Angle containing the new value.
This example divides 90° by three, returning 30°.
Dim Angle1 As New Angle(90)
Angle1 = Angle1.Divide(3)
Angle Angle1 = new Angle(90);
Angle1 = Angle1.Divide(3);
Divides the specified angle.
The angle.
Indicates if the current instance is smaller than the specified value.
An Angle to compare with the current instance.
A Boolean, True if the current instance is
smaller than the specified value.
Determines whether [is less than] [the specified value].
The value.
true if [is less than] [the specified value]; otherwise, false.
Indicates if the current instance is smaller than or equal to the specified
value.
An Angle to compare with the current instance.
A Boolean, True if the current instance is
smaller than or equal to the specified value.
This method compares the DecimalDegrees property with the
specified value. This method is the same as the "<=" operator.
Determines whether [is less than or equal to] [the specified value].
The value.
true if [is less than or equal to] [the specified value]; otherwise, false.
Indicates if the current instance is larger than the specified value.
An Angle to compare with the current instance.
A Boolean, True if the current instance is
greater than the specified value.
Determines whether [is greater than] [the specified value].
The value.
true if [is greater than] [the specified value]; otherwise, false.
Indicates if the current instance is larger than or equal to the specified
value.
An Angle to compare with the current instance.
A Boolean, True if the current instance is
greater than or equal to the specified value.
Determines whether [is greater than or equal to] [the specified value].
The value.
true if [is greater than or equal to] [the specified value]; otherwise, false.
Converts the specified string into an Angle object.
The value.
A new Angle object populated with the specified
values.
ToString Method
This example creates a new angular measurement using the Parse
method.
Dim NewAngle As Angle = Angle.Parse("123.45°")
Angle NewAngle = Angle.Parse("123.45°");
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
This method parses the specified string into an Angle object
using the current culture. This constructor can parse any strings created via the
ToString method.
Converts the specified string into an Angle object using the
specified culture.
A String describing an angle in the form of decimal degrees or a
sexagesimal.
A CultureInfo object describing the numeric format to use during
conversion.
A new Angle object equivalent to the specified string.
This powerful method is typically used to process data from a data store or a
value input by the user in any culture. This function can accept any format which
can be output by the ToString method.
Converts arbitrary hour, minute and seconds into decimal degrees.
The hours.
The minutes.
The seconds.
A Double containing the decimal degree version of the specified
values.
DecimalDegrees Property
Normalize Method
This example converts a value of 10°30'0" into decimal degrees (10.5).
Dim MyValue As Double = Latitude.ToDecimalDegrees(10, 30, 0)
double MyValue = Latitude.ToDecimalDegrees(10, 30, 0);
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Converts arbitrary hour and decimal minutes into decimal degrees.
The hours.
The decimal minutes.
A Double containing the decimal degree version of the specified
values.
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Converts an hour value into decimal degrees.
The hours.
A Double containing the decimal degree version of the specified
values.
The specified value will be converted to a double value.
Creates a copy of the current instance.
An Angle of the same value as the current instance.
Returns a value indicating the relative order of two objects.
An Angle object to compare with.
A value of -1, 0, or 1 as documented by the IComparable interface.
This method allows collections of Azimuth objects to be sorted.
The DecimalDegrees property of each instance is compared.
Compares the current instance to another instance using the specified
precision.
The angle.
A Boolean, True if the
DecimalDegrees property of the current instance matches the
specified instance's DecimalDegrees property.
Equals Method
These examples compare two fractional values using specific numbers of digits for
comparison.
' Equals will return False
Dim Angle1 As New Angle(90.15);
Dim Angle2 As New Angle(90.12);
If Angle1.Equals(Angle2, 2) Then
Debug.WriteLine("The values are the same to two digits of precision.");
' Equals will return True
Dim Angle1 As New Angle(90.15);
Dim Angle2 As New Angle(90.12);
If Angle1.Equals(Angle2, 1) Then
Debug.WriteLine("The values are the same to one digit of precision.");
// Equals will return False
Angle Angle1 = new Angle(90.15);
Angle Angle2 = new Angle(90.12);
if (Angle1.Equals(Angle2, 2))
Console.WriteLine("The values are the same to two digits of precision.");
// Equals will return True
Angle Angle1 = new Angle(90.15);
Angle Angle2 = new Angle(90.12);
if (Angle1.Equals(Angle2, 1))
Console.WriteLine("The values are the same to one digits of precision.");
This is typically used in cases where precision is only significant for a few
digits and exact comparison is not necessary.
NOTE: This method compares objects by value, not by
reference.
Compares the current instance to another instance using the specified
precision.
The angle.
The decimals.
A Boolean, True if the
DecimalDegrees property of the current instance matches the
specified instance's DecimalDegrees property.
Equals Method
These examples compare two fractional values using specific numbers of digits for
comparison.
' Equals will return False
Dim Angle1 As New Angle(90.15);
Dim Angle2 As New Angle(90.12);
If Angle1.Equals(Angle2, 2) Then
Debug.WriteLine("The values are the same to two digits of precision.");
' Equals will return True
Dim Angle1 As New Angle(90.15);
Dim Angle2 As New Angle(90.12);
If Angle1.Equals(Angle2, 1) Then
Debug.WriteLine("The values are the same to one digit of precision.");
// Equals will return False
Angle Angle1 = new Angle(90.15);
Angle Angle2 = new Angle(90.12);
if (Angle1.Equals(Angle2, 2))
Console.WriteLine("The values are the same to two digits of precision.");
// Equals will return True
Angle Angle1 = new Angle(90.15);
Angle Angle2 = new Angle(90.12);
if (Angle1.Equals(Angle2, 1))
Console.WriteLine("The values are the same to one digits of precision.");
This is typically used in cases where precision is only significant for a few
digits and exact comparison is not necessary.
NOTE: This method compares objects by value, not by
reference.
Outputs the angle as a string using the specified format.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A String in the specified format.
ToString Method
Parse Method
This example uses the ToString method to output an angle in a
custom format. The " h° " code represents hours along with a
degree symbol (Alt+0176 on the keypad), and " m.mm " represents
the minutes out to two decimals. Mmm.
Dim MyAngle As New Angle(45, 16.772)
Debug.WriteLine(MyAngle.ToString("h°m.mm", CultureInfo.CurrentCulture))
' Output: 45°16.78
Dim MyAngle As New Angle(45, 16.772);
Debug.WriteLine(MyAngle.ToString("h°m.mm", CultureInfo.CurrentCulture));
// Output: 45°16.78
This method returns the current instance output in a specific format. If no
value for the format is specified, a default format of "d.dddd" is used. Any string
output by this method can be converted back into an Angle object using the
Parse method or Angle(string) constructor.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Returns the value of the angle as decimal degrees.
A Double value.
Hours Property
Minutes Property
Seconds Property
This example demonstrates how the
DecimalDegrees property is
calculated automatically when creating an angle using hours, minutes and seconds.
' Create an angle of 20°30'
Dim MyAngle As New Angle(20, 30)
' Setting the DecimalMinutes recalculated other properties
Debug.WriteLine(MyAngle.DecimalDegrees)
' Output: "20.5" the same as 20°30'
// Create an angle of 20°30'
Angle MyAngle = New Angle(20, 30);
// Setting the DecimalMinutes recalculated other properties
Console.WriteLine(MyAngle.DecimalDegrees)
// Output: "20.5" the same as 20°30'
This property returns the value of the angle as a single number.
Returns the minutes and seconds as a single numeric value.
A Double value.
Minutes Property
DecimalDegrees Property
This example demonstrates how the DecimalMinutes property is
automatically calculated when creating a new angle.
' Create an angle of 20°10'30"
Dim MyAngle As New Angle(20, 10, 30)
' The DecimalMinutes property is automatically calculated
Debug.WriteLine(MyAngle.DecimalMinutes)
' Output: "10.5"
// Create an angle of 20°10'30"
Angle MyAngle = new Angle(20, 10, 30);
// The DecimalMinutes property is automatically calculated
Console.WriteLine(MyAngle.DecimalMinutes)
// Output: "10.5"
This property is used when minutes and seconds are represented as a single
decimal value.
Returns the integer hours (degrees) portion of an angular
measurement.
An Integer value.
Minutes Property
Seconds Property
This example creates an angle of 60.5° then outputs the value of the
Hours property, 60.
Dim MyAngle As New Angle(60.5)
Debug.WriteLine(MyAngle.Hours)
' Output: 60
Angle MyAngle = new Angle(60.5);
Console.WriteLine(MyAngle.Hours);
// Output: 60
This property is used in conjunction with the Minutes
and Seconds properties to create a full angular measurement.
This property is the same as DecimalDegrees without any fractional
value.
Returns the integer minutes portion of an angular measurement.
An Integer.
Hours Property
Seconds Property
This example creates an angle of 45.5° then outputs the value of the
Minutes property, 30.
Dim MyAngle As New Angle(45.5)
Debug.WriteLine(MyAngle.Minutes)
' Output: 30
Angle MyAngle = new Angle(45.5);
Console.WriteLine(MyAngle.Minutes);
// Output: 30
This property is used in conjunction with the Hours and
Seconds properties to create a sexagesimal
measurement.
Returns the seconds minutes portion of an angular measurement.
A Double value.
Hours Property
Minutes Property
This example creates an angle of 45°10.5' then outputs the value of the
Seconds property, 30.
Dim MyAngle As New Angle(45, 10.5)
Debug.WriteLine(MyAngle.Seconds)
' Output: 30
Dim MyAngle As New Angle(45, 10.5);
Console.WriteLine(MyAngle.Seconds);
// Output: 30
This property is used in conjunction with the Hours and
Minutes properties to create a sexagesimal
measurement.
Indicates if the current instance has a non-zero value.
A Boolean, True if the
DecimalDegrees property is zero.
Empty Field
Indicates if the current instance represents an infinite value.
Indicates whether the value is invalid or unspecified.
Indicates whether the value has been normalized and is within the
allowed bounds of 0° and 360°.
Represents the measurement of surface area of a polygon on Earth's
surface.
This example demonstrates how to create an Area structure and
convert it to another unit type.
' Declare a Area of 50 meters
Dim Area1 As New Area(50, AreaUnit.SquareMeters)
' Convert it into acres
Dim Area2 As Area = Area2.ToAcres()
// Declare a Area of 50 meters
Area Area1 = new Area(50, AreaUnit.SquareMeters);
// Convert it into acres
Area Area2 = Area2.ToAcres();
This structure is used to represent measurements of arbitrary polygons on
Earth's surface. Measurements can be converted to different unit types, such as
acres, square kilometers, and square miles.
Instances of this structure are guaranteed to be thread-safe because they are
immutable (properties can only be modified via constructors).
Represents an area with no value.
Represents an area of infinite value.
Represents the largest possible area which can be stored.
Represents the smallest possible area which can be stored.
Represents an invalid or unspecified area.
Creates a new instance using the specified value and unit type.
The value.
The units.
This example uses a constructor to create a new Area of fifty
square kilometers.
Dim MyArea As New Area(50, AreaUnit.SquareKilometers)
Area MyArea = new Area(50, AreaUnit.SquareKilometers);
Creates a new instance using the specified string.
The value.
Parse method requires a valid Area measurement.
1. The numeric portion of the Area measurement was not recognized.
2. The Area unit type was not recognized or not specified.
This example demonstrates how the to use this constructor.
Dim MyArea As Area
' Create a Area of 50 square kilometers
MyArea = New Area("50 sq. km")
' Create a Area of 14, 387 miles, then convert it into square inches
MyArea = New Area("14, 387 sq. statute miles").ToSquareInches()
' Create a Area of 50 square feet
MyArea = New Area(" 50 sq ' ")
Area MyArea;
' Create a Area of 50 square kilometers
MyArea = new Area("50 sq. km");
' Create a Area of 14, 387 miles, then convert it into square inches
MyArea = new Area("14, 387 sq. statute miles").ToSquareInches();
' Create a Area of 50 square feet
MyArea = new Area(" 50 sq ' ");
An Area object.
Parse(string) Method
This powerful constructor is used to convert an area measurement in the form of a
string into an object, such as one entered by a user or read from a file. This
constructor can accept any output created via the ToString
method.
Creates a new instance using the specified string and culture.
The value.
The culture.
Parse method requires a valid Area measurement.
1. The numeric portion of the Area measurement was not recognized.
2. The Area unit type was not recognized or not specified.
This example demonstrates how the to use this constructor.
Dim MyArea As Area
' Create a Area of 50 square kilometers
MyArea = New Area("50 sq. km", CultureInfo.CurrentCulture)
' Create a Area of 14, 387 miles, then convert it into square inches
MyArea = New Area("14, 387 sq. statute miles", CultureInfo.CurrentCulture).ToSquareInches()
' Create a Area of 50 square feet
MyArea = New Area(" 50 sq ' ", CultureInfo.CurrentCulture)
Area MyArea;
' Create a Area of 50 square kilometers
MyArea = new Area("50 sq. km", CultureInfo.CurrentCulture);
' Create a Area of 14, 387 miles, then convert it into square inches
MyArea = new Area("14, 387 sq. statute miles", CultureInfo.CurrentCulture).ToSquareInches();
' Create a Area of 50 square feet
MyArea = new Area(" 50 sq ' ", CultureInfo.CurrentCulture);
An Area object.
Parse(string) Method
This powerful constructor is used to convert an area measurement in the form of a
string into an object, such as one entered by a user or read from a file. This
constructor can accept any output created via the ToString
method.
Creates a new instance by deserializing the specified XML.
The reader.
Converts the current measurement into square feet.
A new Area object containing the converted
value.
ToSquareInches Method
ToSquareKilometers Method
ToSquareMeters Method
ToSquareNauticalMiles Method
ToSquareStatuteMiles Method
This example converts various three Area objects, each with a
different unit type, into square feet.
' Create Areas of different unit types
Dim Area1 As New Area(10, AreaUnit.SquareInches)
Dim Area2 As New Area(20, AreaUnit.SquareStatuteMiles)
Dim Area3 As New Area(50, AreaUnit.SquareKilometers)
' Convert the Area measurements to square feet and output the result
Debug.WriteLine(Area1.ToSquareFeet().ToString())
Debug.WriteLine(Area2.ToSquareFeet().ToString())
Debug.WriteLine(Area3.ToSquareFeet().ToString())
// Create Areas of different unit types
Area Area1 = new Area(10, AreaUnit.SquareInches);
Area Area2 = new Area(20, AreaUnit.SquareStatuteMiles);
Area Area3 = new Area(50, AreaUnit.SquareKilometers);
// Convert the Area measurements to square feet and output the result
Console.WriteLine(Area1.ToSquareFeet().ToString());
Console.WriteLine(Area2.ToSquareFeet().ToString());
Console.WriteLine(Area3.ToSquareFeet().ToString());
This method will perform a conversion regardless of the current unit type. You
may convert from any unit type to any other unit type.
Converts the current measurement into square inches.
A new Area object containing the converted
value.
This example converts various three Area objects, each with a
different unit type, into square inches.
' Create Areas of different unit types
Dim Area1 As New Area(10, AreaUnit.SquareFeet)
Dim Area2 As New Area(20, AreaUnit.SquareStatuteMiles)
Dim Area3 As New Area(50, AreaUnit.SquareKilometers)
' Convert the Area measurements to square inches and output the result
Debug.WriteLine(Area1.ToSquareInches().ToString())
Debug.WriteLine(Area2.ToSquareInches().ToString())
Debug.WriteLine(Area3.ToSquareInches().ToString())
// Create Areas of different unit types
Area Area1 = new Area(10, AreaUnit.SquareFeet);
Area Area2 = new Area(20, AreaUnit.SquareStatuteMiles);
Area Area3 = new Area(50, AreaUnit.SquareKilometers);
// Convert the Area measurements to square inches and output the result
Console.WriteLine(Area1.ToSquareInches().ToString());
Console.WriteLine(Area2.ToSquareInches().ToString());
Console.WriteLine(Area3.ToSquareInches().ToString());
ToSquareFeet Method
ToSquareKilometers Method
ToSquareMeters Method
ToSquareNauticalMiles Method
ToSquareStatuteMiles Method
This method will perform a conversion regardless of the current unit type. You
may convert from any unit type to any other unit type.
Converts the current measurement into square kilometers.
A new Area object containing the converted
value.
This example converts various three Area objects, each with a
different unit type, into square kilometers.
' Create Areas of different unit types
Dim Area1 As New Area(10, AreaUnit.SquareFeet)
Dim Area2 As New Area(20, AreaUnit.SquareStatuteMiles)
Dim Area3 As New Area(50, AreaUnit.SquareInches)
' Convert the Area measurements to square kilometers and output the result
Debug.WriteLine(Area1.ToSquareKilometers().ToString())
Debug.WriteLine(Area2.ToSquareKilometers().ToString())
Debug.WriteLine(Area3.ToSquareKilometers().ToString())
// Create Areas of different unit types
Area Area1 = new Area(10, AreaUnit.SquareFeet);
Area Area2 = new Area(20, AreaUnit.SquareStatuteMiles);
Area Area3 = new Area(50, AreaUnit.SquareInches);
// Convert the Area measurements to square kilometers and output the result
Console.WriteLine(Area1.ToSquareKilometers().ToString());
Console.WriteLine(Area2.ToSquareKilometers().ToString());
Console.WriteLine(Area3.ToSquareKilometers().ToString());
ToSquareFeet Method
ToSquareInches Method
ToSquareMeters Method
ToSquareNauticalMiles Method
ToSquareStatuteMiles Method
This method will perform a conversion regardless of the current unit type. You
may convert from any unit type to any other unit type.
Converts the current measurement into square meters.
A new Area object containing the converted
value.
This example converts various three Area objects, each with a
different unit type, into square meters.
' Create Areas of different unit types
Dim Area1 As New Area(10, AreaUnit.SquareFeet)
Dim Area2 As New Area(20, AreaUnit.SquareStatuteMiles)
Dim Area3 As New Area(50, AreaUnit.SquareInches)
' Convert the Area measurements to square meters and output the result
Debug.WriteLine(Area1.ToSquareMeters().ToString())
Debug.WriteLine(Area2.ToSquareMeters().ToString())
Debug.WriteLine(Area3.ToSquareMeters().ToString())
// Create Areas of different unit types
Area Area1 = new Area(10, AreaUnit.SquareFeet);
Area Area2 = new Area(20, AreaUnit.SquareStatuteMiles);
Area Area3 = new Area(50, AreaUnit.SquareInches);
// Convert the Area measurements to square meters and output the result
Console.WriteLine(Area1.ToSquareMeters().ToString());
Console.WriteLine(Area2.ToSquareMeters().ToString());
Console.WriteLine(Area3.ToSquareMeters().ToString());
ToSquareFeet Method
ToSquareInches Method
ToSquareKilometers Method
ToSquareNauticalMiles Method
ToSquareStatuteMiles Method
This method will perform a conversion regardless of the current unit type. You
may convert from any unit type to any other unit type.
Converts the current measurement into square nautical miles.
A new Area object containing the converted
value.
This example converts various three Area objects, each with a
different unit type, into square nautical miles.
' Create Areas of different unit types
Dim Area1 As New Area(10, AreaUnit.SquareFeet)
Dim Area2 As New Area(20, AreaUnit.SquareStatuteMiles)
Dim Area3 As New Area(50, AreaUnit.SquareInches)
' Convert the Area measurements to square nautical miles and output the result
Debug.WriteLine(Area1.ToSquareNauticalMiles().ToString())
Debug.WriteLine(Area2.ToSquareNauticalMiles().ToString())
Debug.WriteLine(Area3.ToSquareNauticalMiles().ToString())
// Create Areas of different unit types
Area Area1 = new Area(10, AreaUnit.SquareFeet);
Area Area2 = new Area(20, AreaUnit.SquareStatuteMiles);
Area Area3 = new Area(50, AreaUnit.SquareInches);
// Convert the Area measurements to square nautical miles and output the result
Console.WriteLine(Area1.ToSquareNauticalMiles().ToString());
Console.WriteLine(Area2.ToSquareNauticalMiles().ToString());
Console.WriteLine(Area3.ToSquareNauticalMiles().ToString());
ToSquareFeet Method
ToSquareInches Method
ToSquareKilometers Method
ToSquareMeters Method
ToSquareStatuteMiles Method
This method will perform a conversion regardless of the current unit type. You
may convert from any unit type to any other unit type.
Converts the current measurement into square miles.
A new Area object containing the converted
value.
This example converts various three Area objects, each with a
different unit type, into square miles.
' Create Areas of different unit types
Dim Area1 As New Area(10, AreaUnit.SquareFeet)
Dim Area2 As New Area(20, AreaUnit.SquareStatuteMiles)
Dim Area3 As New Area(50, AreaUnit.SquareInches)
' Convert the Area measurements to square statute miles and output the result
Debug.WriteLine(Area1.ToSquareStatuteMiles().ToString())
Debug.WriteLine(Area2.ToSquareStatuteMiles().ToString())
Debug.WriteLine(Area3.ToSquareStatuteMiles().ToString())
// Create Areas of different unit types
Area Area1 = new Area(10, AreaUnit.SquareFeet);
Area Area2 = new Area(20, AreaUnit.SquareStatuteMiles);
Area Area3 = new Area(50, AreaUnit.SquareInches);
// Convert the Area measurements to square statute miles and output the result
Console.WriteLine(Area1.ToSquareStatuteMiles().ToString());
Console.WriteLine(Area2.ToSquareStatuteMiles().ToString());
Console.WriteLine(Area3.ToSquareStatuteMiles().ToString());
ToSquareFeet Method
ToSquareInches Method
ToSquareKilometers Method
ToSquareMeters Method
ToSquareNauticalMiles Method
This method will perform a conversion regardless of the current unit type. A
"statute mile" is frequently referred to as "mile" by itself.
Converts the current measurement into acres.
A new Area object containing the converted value.
This example converts various three Area objects, each with a
different unit type, into acres.
' Create Areas of different unit types
Dim Area1 As New Area(10, AreaUnit.SquareFeet)
Dim Area2 As New Area(20, AreaUnit.SquareStatuteMiles)
Dim Area3 As New Area(50, AreaUnit.SquareInches)
' Convert the Area measurements to acres and output the result
Debug.WriteLine(Area1.ToAcres().ToString())
Debug.WriteLine(Area2.ToAcres().ToString())
Debug.WriteLine(Area3.ToAcres().ToString())
// Create Areas of different unit types
Area Area1 = new Area(10, AreaUnit.SquareFeet);
Area Area2 = new Area(20, AreaUnit.SquareStatuteMiles);
Area Area3 = new Area(50, AreaUnit.SquareInches);
// Convert the Area measurements to acres and output the result
Console.WriteLine(Area1.ToAcres().ToString());
Console.WriteLine(Area2.ToAcres().ToString());
Console.WriteLine(Area3.ToAcres().ToString());
This method will perform a conversion regardless of the current unit type.
Converts the current measurement into square centimeters.
A new Area object containing the converted value.
This example converts various three Area objects, each with a
different unit type, into square centimeters.
' Create Areas of different unit types
Dim Area1 As New Area(10, AreaUnit.SquareFeet)
Dim Area2 As New Area(20, AreaUnit.SquareStatuteMiles)
Dim Area3 As New Area(50, AreaUnit.SquareInches)
' Convert the Area measurements to square centimeters and output the result
Debug.WriteLine(Area1.ToSquareCentimeters().ToString())
Debug.WriteLine(Area2.ToSquareCentimeters().ToString())
Debug.WriteLine(Area3.ToSquareCentimeters().ToString())
// Create Areas of different unit types
Area Area1 = new Area(10, AreaUnit.SquareFeet);
Area Area2 = new Area(20, AreaUnit.SquareStatuteMiles);
Area Area3 = new Area(50, AreaUnit.SquareInches);
// Convert the Area measurements to square centimeters and output the result
Console.WriteLine(Area1.ToSquareCentimeters().ToString());
Console.WriteLine(Area2.ToSquareCentimeters().ToString());
Console.WriteLine(Area3.ToSquareCentimeters().ToString());
This method will perform a conversion regardless of the current unit type.
Converts the current instance to an Imperial unit type which minimizes numeric
value.
An Area converted to Imperial units. (i.e. feet, inches,
miles)
This example converts a measurement of 10560 feet into 1 square statute mile using
the ToMetricUnitType method.
Dim Area1 As New Area(27878400, AreaUnit.SquareFeet)
Dim Area2 As Area = Area1.ToImperialUnitType()
Debug.WriteLine(Area2.ToString())
' Output: 1 square statute mile
Area Area1 = new Area(27878400, AreaUnit.SquareFeet);
Area Area2 = Area1.ToImperialUnitType();
Console.WriteLine(Area2.ToString());
// Output: 1 square statute mile
This method is used to make an area measurement easier to read by choosing
another unit type. For example, "27, 878, 400 square feet" would be easier to
understand as "1 square statute mile." This method converts the current instance to
Metric unit which brings the Value closest to 1, then returns the
new value. This method will perform a conversion regardless of the current unit
type.
Converts the current instance to a Metric unit type which minimizes numeric
value.
An Area converted to Metric units. (i.e. centimeter, meter,
kilometer)
This example converts a measurement of 0.0001 kilometers into 1 meter using the
ToMetricUnitType method.
Dim Area1 As New Area(0.0001, AreaUnit.SquareKilometers)
Dim Area2 As Area = Area1.ToMetricUnitType()
Debug.WriteLine(Area2.ToString())
' Output: 1 square meter
Area Area1 = new Area(0.0001, AreaUnit.SquareKilometers);
Area Area2 = Area1.ToMetricUnitType();
Console.WriteLine(Area2.ToString());
// Output: 1 square meter
This method is used to make an area measurement easier to read by choosing
another unit type. For example, "0.0002 kilometers" would be easier to read as "2
meters." This method converts the current instance to Metric unit which brings the
Value closest to 1, then returns the new value. This method will
perform a conversion regardless of the current unit type.
Converts the current instance to a Metric or Imperial unit type depending on the
local culture.
An Area converted to Metric or Imperial units, depending on the
local culture.
See
ToImperialUnitType and
ToMetricUnitType methods
for examples.
This method is used to make an area measurement easier to read by choosing
another unit type. For example, "0.0002 kilometers" would be easier to read as "2
meters." This method converts the current instance to either a Metric or an Imperial
unit (depending on the local culture) which brings the Value closest
to 1. This method will perform a conversion regardless of the current unit type.
Converts the current instance into the specified unit type.
An AreaUnit value specifying the unit type to convert to.
A new Area object containing the converted value.
This example uses the ToUnitType method to convert an area
measurement of 27, 878, 400 square feet into 1 square statute mile.
Dim Area1 As New Area(27878400, AreaUnit.SquareFeet)
Dim Area2 As Area = Area1.ToUnitType(AreaUnit.SquareStatuteMiles)
Debug.WriteLine(Area2.ToString())
' Output: 1 square statute mile
Area Area1 As New Area(27878400, AreaUnit.SquareFeet);
Area Area2 As Area = Area1.ToUnitType(AreaUnit.SquareStatuteMiles);
Console.WriteLine(Area2.ToString());
// Output: 1 square statute mile
This method will perform a conversion regardless of the current unit type.
Outputs the current instance as a string using the specified format.
The format.
A String containing the Area in the specified format.
This example uses the ToString method to populate a TextBox with a Area measurement
using a custom format.
' Declare a area of 75 square statute miles
Dim MyArea As New Area(75, AreaUnit.SquareStatuteMiles)
' Output the result using the default format
Debug.WriteLine(MyArea.ToString("v.v uuu"))
' Output: 75.0 square statute miles
// Declare a area of 75 square statute miles
Area MyArea As New Area(75, AreaUnit.SquareStatuteMiles);
// Output the result using the default format
Console.WriteLine(MyArea.ToString("v.v uuu"));
// Output: 75.0 square statute miles
This method allows a custom format to be applied to the ToString method. Numeric formats
will be adjusted to the machine's local UI culture.
Adds the specified area to the current instance.
The value.
A new Area structure containing the summed values.
This example demonstrates how two areas of different unit types can be safely added
together. A value of 144 square inches (which is the same as one square foot) is
added to one square foot, producing two square feet.
Dim Area1 As New Area(1, AreaUnit.SquareFeet)
Dim Area2 As New Area(144, AreaUnit.SquareInches)
Dim Area3 As Area = Area1.Add(Area2)
Debug.WriteLine(Area3.ToString())
' Output: 2 square feet
Area Area1 = new Area(1, AreaUnit.SquareFeet);
Area Area2 = new Area(144, AreaUnit.SquareInches);
Area Area3 = Area1.Add(Area2);
Console.WriteLine(Area3.ToString());
// Output: 2 square feet
This method can add any Area object to the current instance. If
the unit type of the Value parameter does not match that of the
current instance, the value is converted to the unit type of the current instance
before adding.
Subtracts the specified area from the current instance.
The value.
A new Area structure containing the new value.
This example demonstrates how two areas of different unit types can be safely
subtracted. A value of 144 square inches (which is the same as one square foot) is
subtracted from one square foot, producing a result of zero.
Dim Area1 As New Area(1, AreaUnit.SquareFeet)
Dim Area2 As New Area(144, AreaUnit.SquareInches)
Dim Area3 As Area = Area1.Subtract(Area2)
Debug.WriteLine(Area3.ToString())
' Output: 0 square feet
Area Area1 = new Area(1, AreaUnit.SquareFeet);
Area Area2 = new Area(144, AreaUnit.SquareInches);
Area Area3 = Area1.Subtract(Area2);
Console.WriteLine(Area3.ToString());
// Output: 0 square feet
This method will subtract any Area object from the current
instance. If the unit type of the Value parameter does not match that
of the current instance, the value is converted to the unit type of the current
instance before subtracting.
Multiplies the specified area with the current instance.
The value.
A new Area structure containing the product of the two
values.
This example demonstrates how two areas can be multiplied together. A value of 50
square inches is multiplied by two square inches, producing a result of 100 square
inches.
Dim Area1 As New Area(50, AreaUnit.SquareInches)
Dim Area2 As New Area(2, AreaUnit.SquareInches)
Dim Area3 As Area = Area1.Multiply(Area2)
Debug.WriteLine(Area3.ToString())
' Output: 100 square inches
Area Area1 = new Area(50, AreaUnit.SquareInches);
Area Area2 = new Area(2, AreaUnit.SquareInches);
Area Area3 = Area1.Multiply(Area2);
Console.WriteLine(Area3.ToString());
// Output: 100 square inches
This method will multiply any Area object from the current
instance. If the unit type of the Value parameter does not match that
of the current instance, the value is converted to the unit type of the current
instance before multiplication.
Divides the current instance by the specified area.
The value.
A new Area structure containing the new value.
This example demonstrates how two areas can be divided. A value of 100 square
inches is divided by two square inches, producing a result of 50 square inches.
Dim Area1 As New Area(100, AreaUnit.SquareInches)
Dim Area2 As New Area(2, AreaUnit.SquareInches)
Dim Area3 As Area = Area1.Divide(Area2)
Debug.WriteLine(Area3.ToString())
' Output: 50 square inches
Area Area1 = new Area(100, AreaUnit.SquareInches);
Area Area2 = new Area(2, AreaUnit.SquareInches);
Area Area3 = Area1.Divide(Area2);
Debug.WriteLine(Area3.ToString());
// Output: 50 square inches
This method will devide the current instance by any Area object.
If the unit type of the Value parameter does not match that of the
current instance, the value is converted to the unit type of the current instance
before devision.
Returns the current instance increased by one.
A new Area structure containing the new value.
This example uses the Increment method to increase an area's
value. It also demonstrates the subtle error which can be caused if
Increment is called while ignoring the return value.
' Correct use of Increment
Dim Area1 As New Area(1, AreaUnit.SquareMeters)
Area1 = Area1.Increment()
' Incorrect use of Increment
Dim Area1 As New Area(1, AreaUnit.SquareMeters)
Area1.Increment()
' NOTE: Area1 will still be 1 square meter, not 2!
// Correct use of Increment
Area Area1 = new Area(1, AreaUnit.SquareMeters);
Area1 = Area1.Increment();
// Incorrect use of Increment
Area Area1 = new Area(1, AreaUnit.SquareMeters);
Area1.Increment();
// NOTE: Area1 will still be 1 square meter, not 2!
This method increases the Value property by 1.0, returned as
a new instance. The Units property is preserved.
NOTE: Since the Area
class is immutable, this method will not modify the current
instance.
Returns the current instance decreased by one.
A new Area structure containing the new value.
This example uses the Decrement method to decrease an area's
value. It also demonstrates the subtle error which can be caused if
Decrement is called while ignoring the return value.
' Correct use of Increment
Dim Area1 As New Area(1, AreaUnit.SquareMeters)
Area1 = Area1.Increment()
' Incorrect use of Increment
Dim Area1 As New Area(1, AreaUnit.SquareMeters)
Area1.Increment()
' NOTE: Area1 will still be 1 square meter, not 0!
// Correct use of Increment
Area Area1 = new Area(1, AreaUnit.SquareMeters);
Area1 = Area1.Decrement();
// Incorrect use of Increment
Area Area1 = new Area(1, AreaUnit.SquareMeters);
Area1.Decrement();
// NOTE: Area1 will still be 1 square meter, not 0!
This method decreases the Value property by 1.0, returned as
a new instance. The Units property is preserved.
NOTE: Since the Area class is immutable,
this method will not modify the current instance.
Indicates if the current instance is smaller than the specified value.
An Area to compare with the current instance.
A Boolean, True if the current instance is
smaller than the Value parameter.
If the Value parameter's unit type does not match the current
instance, it will be converted to the current instance's unit type before performing
the comparison.
Indicates if the current instance is smaller than or equal to the specified
value.
An Area to compare with the current instance.
A Boolean, True if the current instance is
smaller than or equal to the Value parameter.
If the Value parameter's unit type does not match the current
instance, it will be converted to the current instance's unit type before performing
the comparison.
Indicates if the current instance is larger than the specified value.
An Area to compare with the current instance.
A Boolean, True if the current instance is
larger than the Value parameter.
If the Value parameter's unit type does not match the current
instance, it will be converted to the current instance's unit type before performing
the comparison.
Indicates if the current instance is larger than or equal to the specified
value.
An Area to compare with the current instance.
A Boolean, True if the current instance is
larger than or equal to the Value parameter.
If the Value parameter's unit type does not match the current
instance, it will be converted to the current instance's unit type before performing
the comparison.
Creates a new instance using the specified string.
The value.
A new Area object containing the parsed value and
unit type.
Parse method requires a valid Area measurement.
1. The numeric portion of the Area measurement was not recognized.
2. The Area unit type was not recognized or not specified.
This example demonstrates how the Parse method can convert several string formats
into a Area object.
Dim NewArea As Area
' Create a Area of 50 kilometers
NewArea = Area.Parse("50 km")
' Create a Area of 14, 387 miles, then convert it into square inches
NewArea = Area.Parse("14, 387 statute miles").ToSquareInches()
' Parse an untrimmed measurement into 50 feet
NewArea = Area.Parse(" 50 ' ")
Area NewArea;
// Create a Area of 50 kilometers
NewArea = Area.Parse("50 km");
// Create a Area of 14, 387 miles, then convert it into square inches
NewArea = Area.Parse("14, 387 statute miles").ToInches();
// Parse an untrimmed measurement into 50 feet
NewArea = Area.Parse(" 50 ' ");
This powerful method is typically used to convert a string-based Area
measurement, such as one entered by a user or read from a file, into a
Area object. This method will accept any output created via the
ToString method.
Creates a new instance using the specified string and culture.
A String describing an area measurement.
A CultureInfo object specifying which numeric and text formats to use during parsing.
Dim NewArea As Area
' Create a Area of 50 kilometers
NewArea = Area.Parse("50 km", CultureInfo.CurrentCulture)
' Create a Area of 14, 387 miles, then convert it into inches
NewArea = Area.Parse("14, 387 statute miles", CultureInfo.CurrentCulture).ToSquareInches()
' Parse an untrimmed measurement into 50 feet
NewArea = Area.Parse(" 50 ' ", CultureInfo.CurrentCulture)
Area NewArea;
// Create a Area of 50 kilometers
NewArea = Area.Parse("50 km", CultureInfo.CurrentCulture);
// Create a Area of 14, 387 miles, then convert it into square inches
NewArea = Area.Parse("14, 387 statute miles", CultureInfo.CurrentCulture).ToInches();
// Parse an untrimmed measurement into 50 feet
NewArea = Area.Parse(" 50 ' ", CultureInfo.CurrentCulture);
This powerful method is typically used to convert a string-based Area
measurement, such as one entered by a user or read from a file, into a
Area object. This method will accept any output created via the
ToString method.
Returns a random distance between 0 and 1, 000 square meters.
A Distance containing a random value, converted to local units.
Returns a random distance between 0 and 1, 000 square meters.
A Random object used to ogenerate random values.
A Distance containing a random value, converted to local units.
Compares the current instance with the specified object.
An Area object to compare with.
A Boolean, True if the two objects have the
same value.
Returns a unique code for the current instance.
An Integer representing a unique code for the current
instance.
Since the Area class is immutable, this property may be used
safely with hash tables.
Outputs the current instance as a string using the default format.
A String containing the current Area in the default format.
This example uses the ToString method to populate a TextBox with a Area
measurement.
' Declare a area of 75 square statute miles
Dim MyArea As New Area(75, AreaUnit.SquareStatuteMiles)
' Output the result using the default format
Debug.WriteLine(MyArea.ToString())
' Output: 75 sq. statute miles
// Declare a area of 75 square statute miles
Area MyArea = nre Area(75, AreaUnit.SquareStatuteMiles);
// Output the result using the default format
Console.WriteLine(MyArea.ToString());
// Output: 75 sq. statute miles
The default format used is "v uu" where v
represents the numerical portion of the area and uu is the unit
type.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Compares the current instance to the specified area.
An Area object to compare with.
An Integer: 0 if the object's values are equivalent, -1 if the
current instance is smaller, or 1 if the current instance is larger.
If the Value parameter's unit type does not match the current
instance, it will be converted to the current instance's unit type before performing
the comparison.
Compares the current instance to the specified Area
object.
A Area object to compare with.
A Boolean, True if the values are equivalent.
This method will compare the value of the current instance against
the Value parameter. If the Value parameter's
unit type does not match the current instance, it will be converted to the current
instance's unit type before performing the comparison.
NOTE: This method compares objects by value, not by
reference.
Compares the current instance to the specified Area
object.
A Area object to compare with.
An integer specifies the precision for the comparison.
A Boolean, True if the values are equivalent.
This method will compare the value of the current instance against
the Value parameter. If the Value parameter's
unit type does not match the current instance, it will be converted to the current
instance's unit type before performing the comparison.
NOTE: This method compares objects by value, not by
reference.
Outputs the current instance as a string using the specified format and local culture.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A String containing the Area in the specified format.
This example uses the ToString method to populate a TextBox with a Area measurement
using a custom format and culture information.
' Declare a area of 75 square statute miles
Dim MyArea As New Area(75, AreaUnit.SquareStatuteMiles)
' Output the result using the default format
Debug.WriteLine(MyArea.ToString("v.v uuu", CultureInfo.CurrentCulture))
' Output: 75.0 square statute miles
// Declare a area of 75 square statute miles
Area MyArea As New Area(75, AreaUnit.SquareStatuteMiles);
// Output the result using the default format
Console.WriteLine(MyArea.ToString("v.v uuu", CultureInfo.CurrentCulture));
// Output: 75.0 square statute miles
This method allows a custom format to be applied to the ToString method. Numeric formats
will be adjusted to the machine's local UI culture.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Returns the units portion of an area measurement.
An AreaUnit value. Default is Meters.
Value Property
Each area measurement consists of a numeric value paired with a unit type
describing the value. It is not possible to create an area measurement without also
specifying a value.
Returns the numeric portion of an area measurement.
A Double value.
Units Property
This property is paired with the Units property to form a
complete area measurement.
Indicates if the value of the current instance is zero.
A Boolean, True if the Value
property is zero.
Indicates if the current instance is using a Metric unit.
A Boolean, True if the Units
property is SquareCentimeters, SquareMeters or
SquareKilometers.
This property is typically used to see if an area measurement is in a unit type
used by a specific culture. Area measurements can be adjusted to either Metric or
Imperial units using the ToMetricUnitType and
ToImperialUnitType methods.
Indicates if the current instance represents an infinite value.
A Boolean, True if the current instance
represents an infinite value.
Indicates the unit of measure for area measurements.
Value Property (Area Class)
Units Property (Area Class)
This example uses the AreaUnit enumeration to create a new
Area object.
Dim Area1 As New Area(1, AreaUnit.SquareKilometers)
Area Area1 = new Area(1, AreaUnit.SquareKilometers);
This enumeration is most frequently used by the Units property of the Area
structure to describe an area measurement.
Metric System. Kilometers (thousands of meters).
Metric System. 1/1000th of a square kilometer.
Metric System. 1/100th of a square meter.
Imperial System. A statute mile, most often referred to just as "mile."
Nautical miles, also known as "sea miles".
Imperial System. Feet.
Imperial System. Inches.
Imperial System. Inches.
Represents an angular measurement around the horizon between 0° and
360°.
These examples create new instances of an Azimuth object using different
techniques.
Dim MyAzimuth As New Azimuth(45)
Azimuth MyAzimuth = new Azimuth(45);
Dim MyAzimuth As New Azimuth(45, 30, 15)
Azimuth MyAzimuth = new Azimuth(45, 30, 15);
Dim MyAzimuth As Azimuth = Azimuth.NorthNorthwest
Azimuth MyAzimuth = Azimuth.NorthNorthwest;
This class is used to indicate a horizontal direction of travel, such as the
bearing from one point on Earth to another. This class can also be combined with an
Elevation object to form a three-dimensional direction towards an object in space,
such as a GPS satellite.
Controls the number of digits of precision supported by the class.
Creates a new instance with the specified decimal degrees.
The decimal degrees.
This example demonstrates how to create an angle with a measurement of 90°.
Dim MyAzimuth As New Azimuth(90)
Azimuth MyAzimuth = new Azimuth(90);
An Azimuth containing the specified value.
Creates a new instance with the specified degrees.
The hours.
An Azimuth containing the specified value.
Creates a new instance with the specified hours, minutes and
seconds.
The hours.
The minutes.
The seconds.
This example demonstrates how to create an angular measurement of 34°12'29.2 in
hours, minutes and seconds.
Dim MyAzimuth As New Azimuth(34, 12, 29.2)
Azimuth MyAzimuth = new Azimuth(34, 12, 29.2);
An Azimuth containing the specified value.
Creates a new instance with the specified hours and decimal minutes.
The hours.
The decimal minutes.
This example demonstrates how an angle can be created when only the hours and
minutes (in decimal form) are known. This creates a value of 12°42.345'.
Dim MyAzimuth As New Azimuth(12, 42.345)
Azimuth MyAzimuth = new Azimuth(12, 42.345);
An Azimuth containing the specified value.
Creates a new instance by converting the specified string.
The value.
Parse Method
This example creates a new instance by parsing a string. (Notice The double-quote is
doubled up to represent a single double-quote in the string.)
Dim MyAzimuth As New Azimuth("123°45'67.8""")
Azimuth MyAzimuth = new Azimuth("123°45'67.8\"");
This example creates a new Azimuth object by converting the string
"NW," short for Northwest. or 315°.
Dim NewAzimuth As New Azimuth("NW")
Azimuth NewAzimuth = new Azimuth("NW");
An Azimuth containing the specified value.
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
This constructor parses the specified string into an Azimuth
object using the current culture. This constructor can parse any strings created via
the ToString method.
Creates a new instance by converting the specified string using the specified
culture.
The value.
The culture.
This example creates a new Azimuth object by converting the string
"NW," short for Northwest. or 315°.
Dim NewAzimuth As New Azimuth("NW", CultureInfo.CurrentCulture)
Azimuth NewAzimuth = new Azimuth("NW", CultureInfo.CurrentCulture);
This constructor parses the specified string into an Azimuth
object using the specified culture. This constructor can parse any strings created via
the ToString method.
Creates a new instance by deserializing the specified XML.
The reader.
Represents the minimum value of an angle in one turn of a circle.
This example creates an angle representing the minimum allowed value.
Dim MyAzimuth As Azimuth = Azimuth.Minimum
Azimuth MyAzimuth = Azimuth.Minimum;
Azimuth MyAzimuth = Azimuth.Minimum;
An Azimuth with a value of -359.999999°.
Represents an angle with no value.
An Azimuth containing a value of zero (0°).
IsEmpty Property
Represents an angle with infinite value.
Represents the maximum value of an angle in one turn of a circle.
This example creates an angle representing the maximum allowed value of 359.9999°.
Dim MyAzimuth As Azimuth = Azimuth.Maximum
Azimuth MyAzimuth = Azimuth.Maximum;
Represents a direction of travel of 0°.
This example creates an Azimuth representing North.
Dim MyAzimuth As Azimuth = Azimuth.North
Azimuth MyAzimuth = Azimuth.North;
Represents a direction of travel of 22.5°, between north and northeast.
Dim MyAzimuth As Azimuth = Azimuth.NorthNortheast
Azimuth MyAzimuth = Azimuth.NorthNortheast;
Represents a direction of travel of 45°.
Dim MyAzimuth As Azimuth = Azimuth.Northeast
Azimuth MyAzimuth = Azimuth.Northeast;
Represents a direction of travel of 67.5°.
Dim MyAzimuth As Azimuth = Azimuth.EastNortheast
Azimuth MyAzimuth = Azimuth.EastNortheast;
Represents a direction of travel of 90°.
Dim MyAzimuth As Azimuth = Azimuth.East
Azimuth MyAzimuth = Azimuth.East;
Represents a direction of travel of 112.5°, between east and southeast.
Dim MyAzimuth As Azimuth = Azimuth.EastSoutheast
Azimuth MyAzimuth = Azimuth.EastSoutheast;
Represents a direction of travel of 135°.
Dim MyAzimuth As Azimuth = Azimuth.Southeast
Azimuth MyAzimuth = Azimuth.Southeast;
Represents a direction of travel of 157.5°, between south and southeast.
Dim MyAzimuth As Azimuth = Azimuth.SouthSoutheast
Azimuth MyAzimuth = Azimuth.SouthSoutheast;
Represents a direction of travel of 180°.
Dim MyAzimuth As Azimuth = Azimuth.South
Azimuth MyAzimuth = Azimuth.South;
Represents a direction of travel of 202.5°, between south and southwest.
Dim MyAzimuth As Azimuth = Azimuth.SouthSouthwest
Azimuth MyAzimuth = Azimuth.SouthSouthwest;
Represents a direction of travel of 225°.
Dim MyAzimuth As Azimuth = Azimuth.Southwest
Azimuth MyAzimuth = Azimuth.Southwest;
Represents a direction of travel of 247.5°, between west and southwest.
Dim MyAzimuth As Azimuth = Azimuth.WestSouthwest
Azimuth MyAzimuth = Azimuth.WestSouthwest;
Represents a direction of travel of 270°.
Dim MyAzimuth As Azimuth = Azimuth.West
Azimuth MyAzimuth = Azimuth.West;
Represents a direction of travel of 292.5°, between west and northwest.
Dim MyAzimuth As Azimuth = Azimuth.WestNorthwest
Azimuth MyAzimuth = Azimuth.WestNorthwest;
Represents a direction of travel of 315°.
Dim MyAzimuth As Azimuth = Azimuth.Northwest
Azimuth MyAzimuth = Azimuth.Northwest;
Represents a direction of travel of 337.5°, between north and northwest.
Dim MyAzimuth As Azimuth = Azimuth.NorthNorthwest
Azimuth MyAzimuth = Azimuth.NorthNorthwest;
Represents an invalid or unspecified value.
Modifies a value to its equivalent between 0° and 360°.
An Azimuth representing the normalized angle.
Normalize(Azimuth) Method
This example demonstrates how normalization is used. The Stop statement is hit.
This example demonstrates how the Normalize method can ensure that an angle fits
between 0° and 359.9999°. This example normalizes 725° into 5°.
Dim MyAzimuth As New Azimuth(720)
MyAzimuth = MyAzimuth.Normalize()
Azimuth MyAzimuth = new Azimuth(720);
MyAzimuth = MyAzimuth.Normalize();
Dim MyValue As New Azimuth(725)
MyValue = MyValue.Normalize()
Azimuth MyValue = new Azimuth(725);
MyValue = MyValue.Normalize();
This function is used to ensure that an angular measurement is within the
allowed bounds of 0° and 360°. If a value of 360° or 720° is passed, a value of 0°
is returned since 360° and 720° represent the same point on a circle. For the Azimuth
class, this function is the same as "value Mod 360".
Returns whether the current value is between the specified values.
An Azimuth marking the start of a range.
An Azimuth marking the end of a range.
A Boolean value.
This property is used to determine whether a value is within a specified range. If the
starting value is less than the end value, a basic greater-than or less-than comparison is performed.
If, however, the end value is greater than the start, it is assumed that the range crosses the 0/360
boundary. For example, if the start is 270 and the end is 90, a value of True is
returned if the current value is between 270 and 360, or 0 and 90.
Returns the smallest integer greater than the specified value.
Returns the largest integer which is smaller than the specified value.
Returns a new instance whose value is rounded the specified number of decimals.
An Integer specifying the number of decimals to round off to.
Returns a new instance whose Seconds property is evenly divisible by 15.
An Azimuth containing the rounded value.
This method is used to align or "snap" an angle to a regular interval. For
example, a grid might be easier to read if it were drawn at 30-second intervals instead
of 24.198-second intervals.
Returns a new angle whose Seconds property is evenly divisible by the specified amount.
A Double between 0 and 60 indicating the interval to round
to.
An Azimuth containing the rounded value.
This method is used to align or "snap" an angle to a regular interval. For
example, a grid might be easier to read if it were drawn at 30-second intervals instead
of 24.198-second intervals.
Outputs the azimuth as a string using the specified format.
A String consisting of any number of the following
codes:
-
c
The object is output as an abbreviated direction.
N, NE,
NNW
-
cc
The object is output as a full direction.
North, Northeast,
North-Northwest
-
d
Represents one digit from the
DecimalDegrees property.
-
h
Represents one digit from the
Hours property.
-
m
Represents one digit from the Minutes
property.
-
s
Represents one digit from the Seconds
property.
A String in the specified format.
ToString Method
Parse Method
This example uses the ToString method to output an azimuth in a
custom format. The " d.dd " code represents decimal degrees
rounded to two digits, and " cc " represents the direction in
verbose form.
Dim MyAzimuth As New Azimuth(90.946)
Debug.WriteLine(MyAzimuth.ToString("d.dd (cc)"))
' Output: 90.95 (East)
Azimuth MyAzimuth = new Azimuth(90.946);
Console.WriteLine(MyAzimuth.ToString("d.dd (cc)"));
// Output: 90.95 (East)
This method returns the current instance output in a specific format. If no
value for the format is specified, a default format of "cc" is used. Any string
output by this method can be converted back into an Azimuth object using the
Parse method or Azimuth(string)
constructor.
Returns the object with the smallest value.
An Azimuth object to compare to the current instance.
The Azimuth containing the smallest value.
Returns the object with the largest value.
An Azimuth object to compare to the current instance.
An Azimuth containing the largest value.
Returns an angle opposite of the current instance.
An Azimuth representing the mirrored value.
This example creates a new Azimuth of 45° then calculates its mirror
of 225°. (45 + 180)
Dim Azimuth1 As New Azimuth(45)
Dim Azimuth2 As Azimuth = Azimuth1.Mirror()
Debug.WriteLine(Azimuth2.ToString())
' Output: 225
Azimuth Azimuth1 = new Azimuth(45);
Azimuth Azimuth2 = Azimuth1.Mirror();
Console.WriteLine(Azimuth2.ToString());
// Output: 225
This method returns the "opposite" of the current instance. The opposite is
defined as the point on the other side of an imaginary circle. For example, if an angle
is 0°, at the top of a circle, this method returns 180°, at the bottom of the
circle.
Converts the current instance into radians.
A Radian object.
Radian Class
Converts an angular measurement into radians before further processing.
This example converts a measurement of 90° into radians.
Dim MyAzimuth As New Azimuth(90)
Dim MyRadians As Radian = MyAzimuth.ToRadians()
Azimuth MyAzimuth = new Azimuth(90);
Radian MyRadians = MyAzimuth.ToRadians();
This function is typically used to convert an angular measurement into
radians before performing a trigonometric function.
Compares the current value to another Azimuth object's value.
An Azimuth, Double, or Integer
to compare with.
A Boolean, True if the object's DecimalDegrees
properties match.
This
Returns a unique code for this instance.
An Integer representing a unique code for the current
instance.
Since the Azimuth class is immutable, this property may be used
safely with hash tables.
Outputs the current instance as a string using the default format.
A String representing the current instance.
Parse Method
This example outputs a value of 90 degrees in the default format of ###.#°.
Dim MyAzimuth As New Azimuth(90)
Debug.WriteLine(MyAzimuth.ToString)
' Output: "90°"
Azimuth MyAzimuth = new Azimuth(90);
Debug.WriteLine(MyAzimuth.ToString());
// Output: "90°"
This method formats the current instance using the default format of "cc." Any
string output by this method can be converted back into an Azimuth object using the
Parse method or Azimuth(string) constructor.
Converts the specified value to its equivalent between 0° and 360°.
A Double value to be normalized.
An Azimuth containing a value equivalent to the value specified, but between 0° and
360°.
Converts a Direction value into an Azimuth
object.
A value from the Direction enumeration to convert.
An Azimuth equivalent to the specified direction.
Returns a random angle between 0° and 360°.
An Azimuth containing a random value.
Returns a random Azimuth between 0° and 360° using the specified random number
seed.
A Random object used to generate random values.
An Azimuth containing a random value.
Converts arbitrary hour, minute and seconds into decimal degrees.
The hours.
The minutes.
The seconds.
A Double containing the decimal degree version of the specified
values.
DecimalDegrees Property
Normalize Method
This example converts a value of 10°30'0" into decimal degrees (10.5).
Dim MyValue As Double = Latitude.ToDecimalDegrees(10, 30, 0)
double MyValue = Latitude.ToDecimalDegrees(10, 30, 0);
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Converts arbitrary hour and decimal minutes into decimal degrees.
The hours.
The decimal minutes.
A Double containing the decimal degree version of the specified
values.
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Converts an hour value into decimal degrees.
The hours.
A Double containing the decimal degree version of the specified
values.
The specified value will be converted to a double value.
Returns the object with the smallest value.
A Azimuth object to compare to value2.
A Azimuth object to compare to value1.
The Azimuth containing the smallest value.
Returns the object with the largest value.
A Azimuth object to compare to value2.
A Azimuth object to compare to value1.
A Azimuth containing the largest value.
Converts the specified string into an Azimuth object.
The value.
A new Azimuth object populated with the specified
values.
ToString Method
This example creates a new angular measurement using the Parse
method.
Dim NewAzimuth As Azimuth = Azimuth.Parse("123.45°")
Azimuth NewAzimuth = Azimuth.Parse("123.45°");
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
This method parses the specified string into an Azimuth object
using the current culture. This constructor can parse any strings created via the
ToString method.
Converts the specified string into an Azimuth object using the
specified culture.
A String describing an angle in the form of decimal degrees or a
sexagesimal.
A CultureInfo object describing the numeric format to use during
conversion.
A new Azimuth object equivalent to the specified string.
This example creates a new Azimuth object by converting the string
"NW," short for Northwest. or 315°.
Dim NewAzimuth As Azimuth = Azimuth.Parse("NW", CultureInfo.CurrentCulture)
Azimuth NewAzimuth = Azimuth.Parse("NW", CultureInfo.CurrentCulture);
This method parses the specified string into an Azimuth
object using the specified culture. This method can parse any string created via
the ToString method.
Converts an angular measurement into radians.
The value.
A Radian object.
This example shows a quick way to convert an angle of 90° into radians.
Dim MyRadian As Radian = Azimuth.ToRadians(90)
Radian MyRadian = Azimuth.ToRadians(90);
This function is typically used to convert an angular measurement into
radians before performing a trigonometric function.
Converts a value in radians into an angular measurement.
The radians.
ToRadians
Radian Class
This example uses the FromRadians method to convert a value of one
radian into an Azimuth of 57°.
' Create a new angle equal to one radian
Dim MyRadians As New Radian(1)
Dim MyAzimuth As Azimuth = Azimuth.FromRadians(MyRadians)
Debug.WriteLine(MyAzimuth.ToString())
' Output: 57°
// Create a new angle equal to one radian
Radian MyRadians = new Radian(1);
Azimuth MyAzimuth = Azimuth.FromRadians(MyRadians);
Console.WriteLine(MyAzimuth.ToString());
// Output: 57°
This function is typically used in conjunction with the
ToRadians
method after a trigonometric function has completed. The converted value is stored in
the DecimalDegrees property.
Froms the radians.
The radians.
Converts a measurement in Radians into an Azimuth.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Azimuth.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Azimuth.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Azimuth.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Azimuth.
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Converts a measurement in degrees as an Integer into an Azimuth.
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Converts a measurement in the form of a formatted String into an Azimuth.
The value.
The result of the conversion.
Converts an Azimuth into a String.
The value.
The result of the conversion.
This operator calls the ToString() method using the current culture.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Returns the current instance increased by one.
An Azimuth object.
This example uses the Increment method to increase an Azimuth's
value. It also demonstrates the subtle error which can be caused if
Increment is called while ignoring the return value.
' Correct use of Increment
Dim Azimuth1 As New Azimuth(89)
Azimuth1 = Azimuth1.Increment()
' Incorrect use of Increment
Dim Azimuth1 = New Azimuth(89)
Azimuth1.Increment()
' NOTE: Azimuth1 will still be 89°!
// Correct use of Increment
Azimuth Azimuth1 = new Azimuth(89);
Azimuth1 = Azimuth1.Increment();
// Incorrect use of Increment
Azimuth Azimuth1 = new Azimuth(89);
Azimuth1.Increment();
// NOTE: Azimuth1 will still be 89°!
This method increases the DecimalDegrees property by 1.0,
returned as a new instance.
Since the Azimuth class is immutable, this
method cannot be used to modify an existing instance.
Increases the current instance by the specified value.
A Double to add to the current instance.
A new Azimuth containing the summed values.
This example adds 45° to the current instance of 45°, returning 90°.
Dim Azimuth1 As New Azimuth(45)
Azimuth1 = Azimuth1.Add(45)
Azimuth Azimuth1 = new Azimuth(45);
Azimuth1 = Azimuth1.Add(45);
Adds the specified value.
The value.
Returns the current instance decreased by one.
An Azimuth object.
This example uses the Decrement method to decrease an Azimuth's
value. It also demonstrates the subtle error which can be caused if
Decrement is called while ignoring the return value.
' Correct use of Decrement
Dim Azimuth1 As New Azimuth(91)
Azimuth1 = Azimuth1.Decrement()
' Incorrect use of Decrement
Dim Azimuth1 = New Azimuth(91)
Azimuth1.Increment()
' NOTE: Azimuth1 will still be 91°!
// Correct use of Decrement
Azimuth Azimuth1 = new Azimuth(91);
Azimuth1 = Azimuth1.Decrement();
// Incorrect use of Decrement
Azimuth Azimuth1 = new Azimuth(91);
Azimuth1.Decrement();
// NOTE: Azimuth1 will still be 91°!
This method decreases the DecimalDegrees property by 1.0,
returned as a new instance.
Since the Azimuth class is immutable, this
method cannot be used to modify an existing instance.
Decreases the current instance by the specified value.
A Double to subtract from the current instance.
A new Azimuth containing the new value.
This example subtracts 30° from the current instance of 90°, returning 60°.
Dim Azimuth1 As New Azimuth(90)
Azimuth1 = Azimuth1.Subtract(30)
Azimuth Azimuth1 = new Azimuth(90);
Azimuth1 = Azimuth1.Subtract(30);
Subtracts the specified value.
The value.
Multiplies the current instance by the specified value.
A Double to multiply with the current instance.
A new Azimuth containing the product of the two numbers.
This example multiplies 30° with three, returning 90°.
Dim Azimuth1 As New Azimuth(30)
Azimuth1 = Azimuth1.Multiply(3)
Azimuth Azimuth1 = new Azimuth(30);
Azimuth1 = Azimuth1.Multiply(3);
Multiplies the specified value.
The value.
Divides the current instance by the specified value.
A Double representing a denominator to divide by.
An Azimuth containing the new value.
This example divides 90° by three, returning 30°.
Dim Azimuth1 As New Azimuth(90)
Azimuth1 = Azimuth1.Divide(3)
Azimuth Azimuth1 = new Azimuth(90);
Azimuth1 = Azimuth1.Divide(3);
Divides the specified value.
The value.
Indicates if the current instance is smaller than the specified value.
An Azimuth to compare with the current instance.
A Boolean, True if the current instance is
smaller than the specified value.
Determines whether [is less than] [the specified value].
The value.
true if [is less than] [the specified value]; otherwise, false.
Indicates if the current instance is smaller than or equal to the specified
value.
An Azimuth to compare with the current instance.
A Boolean, True if the current instance is
smaller than or equal to the specified value.
This method compares the DecimalDegrees property with the
specified value. This method is the same as the "<=" operator.
Determines whether [is less than or equal to] [the specified value].
The value.
true if [is less than or equal to] [the specified value]; otherwise, false.
Indicates if the current instance is larger than the specified value.
An Azimuth to compare with the current instance.
A Boolean, True if the current instance is
greater than the specified value.
Determines whether [is greater than] [the specified value].
The value.
true if [is greater than] [the specified value]; otherwise, false.
Indicates if the current instance is larger than or equal to the specified
value.
An Azimuth to compare with the current instance.
A Boolean, True if the current instance is
greater than or equal to the specified value.
Determines whether [is greater than or equal to] [the specified value].
The value.
true if [is greater than or equal to] [the specified value]; otherwise, false.
Creates a copy of the current instance.
An Azimuth of the same value as the current instance.
Returns a value indicating the relative order of two objects.
An Azimuth object to compare with.
A value of -1, 0, or 1 as documented by the IComparable interface.
This method allows collections of Azimuth objects to be sorted.
The DecimalDegrees property of each instance is compared.
Compares the current instance to another instance using the specified
precision.
The value.
The decimals.
A Boolean, True if the
DecimalDegrees property of the current instance matches the
specified instance's DecimalDegrees property.
These examples compare two fractional values using specific numbers of digits for
comparison.
' Equals will return False
Dim Azimuth1 As New Azimuth(90.15);
Dim Azimuth2 As New Azimuth(90.12);
If Azimuth1.Equals(Azimuth2, 2) Then
Debug.WriteLine("The values are the same to two digits of precision.");
' Equals will return True
Dim Azimuth1 As New Azimuth(90.15);
Dim Azimuth2 As New Azimuth(90.12);
If Azimuth1.Equals(Azimuth2, 1) Then
Debug.WriteLine("The values are the same to one digit of precision.");
// Equals will return False
Azimuth Azimuth1 = new Azimuth(90.15);
Azimuth Azimuth2 = new Azimuth(90.12);
if (Azimuth1.Equals(Azimuth2, 2))
Console.WriteLine("The values are the same to two digits of precision.");
// Equals will return True
Azimuth Azimuth1 = new Azimuth(90.15);
Azimuth Azimuth2 = new Azimuth(90.12);
if (Azimuth1.Equals(Azimuth2, 1))
Console.WriteLine("The values are the same to one digits of precision.");
This is typically used in cases where precision is only significant for a few
digits and exact comparison is not necessary.
NOTE: This method compares objects by value, not by
reference.
Equalses the specified value.
The value.
Compares the current instance to the specified compass direction.
A Direction value to compare with the current instance.
A Boolean, True if the current instance's
Direction property matches the specified value.
This method is typically used to approximate if two directions are equivalent.
For example, if two objects are traveling at a bearing of 41° and 46°, they both could
be considered to be traveling Northeast even though their bearings are not precisely
the same.
Outputs the azimuth as a string using the specified format.
A String consisting of any number of the following
codes:
-
c
The object is output as an abbreviated direction.
N, NE,
NNW
-
cc
The object is output as a full direction.
North, Northeast,
North-Northwest
-
d
Represents one digit from the
DecimalDegrees property.
-
h
Represents one digit from the
Hours property.
-
m
Represents one digit from the Minutes
property.
-
s
Represents one digit from the Seconds
property.
A CultureInfo object used to properly format numeric
information.
A String in the specified format.
ToString Method
Parse Method
This example uses the ToString method to output an azimuth in a
custom format. The " d.dd " code represents decimal degrees
rounded to two digits, and " cc " represents the direction in
verbose form.
Dim MyAzimuth As New Azimuth(90.946)
Debug.WriteLine(MyAzimuth.ToString("d.dd (cc)", CultureInfo.CurrentCulture))
' Output: 90.95 (East)
Azimuth MyAzimuth = new Azimuth(90.946);
Console.WriteLine(MyAzimuth.ToString("d.dd (cc)", CultureInfo.CurrentCulture));
// Output: 90.95 (East)
This method returns the current instance output in a specific format. If no
value for the format is specified, a default format of "cc" is used. Any string
output by this method can be converted back into an Azimuth object using the
Parse method or Azimuth(string)
constructor.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Returns the value of the angle as decimal degrees.
A Double value.
Hours Property
Minutes Property
Seconds Property
This example demonstrates how the
DecimalDegrees property is
calculated automatically when creating an angle using hours, minutes and seconds.
' Create an angle of 20°30'
Dim MyAzimuth As New Azimuth(20, 30)
' Setting the DecimalMinutes recalculated other properties
Debug.WriteLine(MyAzimuth.DecimalDegrees)
' Output: "20.5" the same as 20°30'
// Create an angle of 20°30'
Azimuth MyAzimuth = New Azimuth(20, 30);
// Setting the DecimalMinutes recalculated other properties
Console.WriteLine(MyAzimuth.DecimalDegrees)
// Output: "20.5" the same as 20°30'
This property returns the value of the angle as a single number.
Returns the minutes and seconds as a single numeric value.
A Double value.
Minutes Property
DecimalDegrees Property
This example demonstrates how the DecimalMinutes property is
automatically calculated when creating a new angle.
' Create an angle of 20°10'30"
Dim MyAzimuth As New Azimuth(20, 10, 30)
' The DecimalMinutes property is automatically calculated
Debug.WriteLine(MyAzimuth.DecimalMinutes)
' Output: "10.5"
// Create an angle of 20°10'30"
Azimuth MyAzimuth = new Azimuth(20, 10, 30);
// The DecimalMinutes property is automatically calculated
Console.WriteLine(MyAzimuth.DecimalMinutes)
// Output: "10.5"
This property is used when minutes and seconds are represented as a single
decimal value.
Returns the integer hours (degrees) portion of an angular
measurement.
An Integer value.
Minutes Property
Seconds Property
This example creates an angle of 60.5° then outputs the value of the
Hours property, 60.
Dim MyAzimuth As New Azimuth(60.5)
Debug.WriteLine(MyAzimuth.Hours)
' Output: 60
Azimuth MyAzimuth = new Azimuth(60.5);
Console.WriteLine(MyAzimuth.Hours);
// Output: 60
This property is used in conjunction with the Minutes
and Seconds properties to create a full angular measurement.
This property is the same as DecimalDegrees without any fractional
value.
Returns the integer minutes portion of an angular measurement.
An Integer.
Hours Property
Seconds Property
This example creates an angle of 45.5° then outputs the value of the
Minutes property, 30.
Dim MyAzimuth As New Azimuth(45.5)
Debug.WriteLine(MyAzimuth.Minutes)
' Output: 30
Azimuth MyAzimuth = new Azimuth(45.5);
Console.WriteLine(MyAzimuth.Minutes);
// Output: 30
This property is used in conjunction with the Hours and
Seconds properties to create a sexagesimal
measurement.
Returns the seconds minutes portion of an angular measurement.
A Double value.
Hours Property
Minutes Property
This example creates an angle of 45°10.5' then outputs the value of the
Seconds property, 30.
Dim MyAzimuth As New Azimuth(45, 10.5)
Debug.WriteLine(MyAzimuth.Seconds)
' Output: 30
Dim MyAzimuth As New Azimuth(45, 10.5);
Console.WriteLine(MyAzimuth.Seconds);
// Output: 30
This property is used in conjunction with the Hours and
Minutes properties to create a sexagesimal
measurement.
Returns the current instance expressed as a compass direction.
A Direction value.
This example outputs the direction associated 272°, which is West.
Dim MyAzimuth As New Azimuth(272)
Debug.WriteLine(MyAzimuth.Direction.ToString())
' Output: West
Azimuth MyAzimuth = new Azimuth(272);
Console.WriteLine(MyAzimuth.Direction.ToString());
// Output: West
This property converts an azimuth to the nearest of sixteen compass directions.
For example, an azimuth of 89° points almost east, therefore a value of
East would be returned. This property is typically used for user
interfaces to express an azimuth in a form that is easy to understand.
Indicates if the current instance has a non-zero value.
A Boolean, True if the
DecimalDegrees property is zero.
Empty Field
Indicates if the current instance represents an infinite value.
Indicates whether the value is invalid or unspecified.
Indicates whether the value has been normalized and is within the
allowed bounds of 0° and 360°.
Represents an approximate direction of motion.
This example outputs the direction associated 272°, which is West
.
Dim MyAzimuth As New Azimuth(272)
Debug.WriteLine(MyAzimuth.Direction.ToString())
' Output: West
Azimuth MyAzimuth = new Azimuth(272);
Console.WriteLine(MyAzimuth.Direction.ToString());
// Output: West
This enumeration is used primarily by the Azimuth class when
converting a numeric angle measurement into a compass direction.
An azimuth of approximately 0°
Between north and northeast
Between north and east
Between east and northeast
An azimuth of approximately 90°
Between east and southeast
Between south and east
Between south and southeast
An azimuth of approximately 180°
Between south and southwest
Between south and west
Between west and southwest
An azimuth of approximately 270°
Between west and northwest
Between north and west
Between north and northwest
Represents a base class for designing GPS packets which store binary data.
Represents a base class for designing GPS data packets.
Converts the packet into an array of bytes.
Returns a string representation of the packet
A that represents this instance.
Returns a string representing the packet
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Returns whether the pack data is well-formed.
Creates a BinaryPacket
BinaryPacket with the specified capacity
The capacity.
Creates a BinaryPacket from an IEnumerable
The bytes.
Returns the index of the specified byte
The object to locate in the .
The index of if found in the list; otherwise, -1.
Inserts a byte at the specified index
The zero-based index at which should be inserted.
The object to insert into the .
is not a valid index in the .
The is read-only.
Removes the item at the specified index.
The zero-based index of the item to remove.
is not a valid index in the .
The is read-only.
Adds an item to the .
The object to add to the .
The is read-only.
Removes all items from the .
The is read-only.
Determines whether the contains a specific value.
The object to locate in the .
true if is found in the ; otherwise, false.
Copies to.
The array.
Index of the array.
Removes the first occurrence of a specific object from the .
The object to remove from the .
true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original .
The is read-only.
Returns an enumerator that iterates through the collection.
A that can be used to iterate through the collection.
Returns an enumerator that iterates through a collection.
An object that can be used to iterate through the collection.
Gets or sets the element at the specified index.
The element at the specified index.
is not a valid index in the .
The property is set and the is read-only.
Gets the number of elements contained in the .
The number of elements contained in the .
Gets a value indicating whether the is read-only.
true if the is read-only; otherwise, false.
Represents an address used to identify a unique Bluetooth device.
Each Bluetooth device has a unique address, in the form of a six-byte address.
Creates a new instance from the specified byte array.
The address.
Creates a new instance using the specified unsigned 64-bit integer.
The address.
Creates a new instance using the specified 64-bit integer.
The address.
Creates a new instance using the specified string.
The address.
Returns the address as a 64-bit integer.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Returns a that represents this instance.
A that represents this instance.
Converts the specified string into an address.
The address.
Bluetooth Address
The address.
The result of the conversion.
Bluetooth address
The address.
The result of the conversion.
Bluetooth address
The address.
The result of the conversion.
Bluetooth address
The address.
The result of the conversion.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Returns the bytes of the address.
Represents a service on a Bluetooth(tm) device.
Bluetooth GPS devices often provide access to data using sockets. In order to establish a connection
to a Bluetooth GPS device,
Represents a GPS device which is accessed via a socket connection.
Represents a device on the local machine.
Releases unmanaged resources and performs other cleanup operations before the is reclaimed by garbage collection.
Occurs when a connection is about to be attempted.
Occurs when a connection has been successfully established.
Occurs when an open connection is about to be closed.
Occurs when an open connection has been successfully closed.
Updates the date a connection was last opened.
The date.
Updates the date the device was last confirmed as a GPS device.
The date.
Updates the total time spent connecting to this device.
The time.
Updates the number of times detection has failed.
The count.
Updates the number of times detection has succeeded.
The count.
Creates a new Stream object for the device.
The access.
The sharing.
A Stream object.
Developers who design their own GPS device classes will need to override this method and use it to establish
a new connection. This method is called by the Open method. The Stream returned by
this method will be assigned to the BaseStream property, it it will be used for all device communications,
including GPS protocol detection.
Records information about this device to the registry.
In order to organize and maximize performance of GPS device detection, information about devices
is saved to the registry. This method, when overridden, serializes the device to the registry. All registry
keys should be saved under the branch HKLM\Software\DotSpatial.Positioning\GPS.NET\3.0\Devices\[Type]\[ID], where
[Type] is the name of the technology used by the device (e.g. Serial, Bluetooth, etc.), and [ID]
is a unique ID for the device (e.g. "COM3", an address, etc.). Enough information should be written to be able to
establish a connection to the device after reading registry values.
Reads information about this device from the registry.
In order to organize and maximize performance of GPS device detection, information about devices
is saved to the registry. This method, when overridden, reads information for this device from the registry. All registry
values should have been previously saved via the OnCacheWrite method.
Removes previously cached information for this device from the registry.
In some cases, the information about previously detected devices may interfere with system changes such as adding
a replacement GPS device. This method will remove the entire registry key for a device, causing GPS.NET 3.0 to start over when
GPS devices need to be detected.
Performs a test on the device to confirm that it transmits GPS data.
A Boolean value, True if the device is confirmed.
This method will open a connection if necessary via the Open method, then proceed to
examine it for GPS data. This method will always be called on a separate thread to keep detection from slowing
down or blocking the main application.
Developers who override this method should ensure that the method can clean up any resources used, even if a
ThreadAbortException is raised, as a result of the detection thread being aborted. This can be done by wrapping all code in a
try..catch block, and placing all clean-up code in a finally block.
Opens a new connection to the device.
This method will create a new connection to the device. The connection will be created in the form of a
Stream object. If a connection is already open, this method has no effect.
Opens a new connection to the device.
The access.
The sharing.
This method will create a new connection to the device. The connection will be created in the form of a
Stream object. If a connection is already open, this method has no effect.
Forces a device to a closed state without disposing the underlying stream.
Cancels detection and removes any cached information about the device.
Use the method to re-detect the device and re-add it to the device cache.
Performs an analysis of the device and its capabilities.
Starts a new thread which checks the device for GPS data in the background.
Closes any open connection to the device.
This method will close any open connection to the device. Any associated Stream object
will be disposed. If no open connection exists, this method has no effect. This method is called automatically
when the device is disposed, either manually or automatically via the finalizer.
Waits for the device to be checked for GPS data.
Waits for the device to be checked for GPS data, up to the specified timeout period.
The timeout.
Stops any GPS protocol detection in progress.
Detections the thread proc.
Sets the is GPS device.
if set to true [value].
Esitmates device prcision based on the fix quality.
The current fix quality of a device or emulation
The estimated error of latitude/longitude coordinates attributed to the device.
If a the fix quality is unknown or NoFix, this method returns the value stored
in the DillutionOfPrecision.CurrentAverageDevicePrecision property.
Compares two devices for the purpose of finding the device most likely to provide a successful connection.
The left.
The right.
An Integer value.
This method is used during Sort methods to choose the device most likely to respond.
The date the device last successfully opened a connection is examined, along with historical connection statistics.
The "best" device is the device which has most recently opened a connection successfully, with the fewest amount of
connection failures.
Disposes of any managed or unmanaged resources used by the device.
Since the Device class implements the IDisposable interface, all managed or
unmanaged resources used by the class will be disposed. Any open connection will be closed. The Dispose
method is also called (if necessary) during the finalizer for this class.
Disposes of any unmanaged (or optionally, managed) resources used by the device.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
This method is called when the object is no longer needed. Typically, this happens during the shutdown of the parent
application. If device detection is in progress, it will be immediately cancelled. If any connection is open, it will immediately
be closed and disposed. This method is called via the finalizer if necessary, thus removing the need for explicit calls. Developers
who prefer to call this method explicitly, however, may do so.
Returns a that represents this instance.
A that represents this instance.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Compares two devices for the purpose of finding the device most likely to provide a successful connection.
An object to compare with this object.
An Integer value.
This method is used during Sort methods to choose the device most likely to respond.
The date the device last successfully opened a connection is examined, along with historical connection statistics.
The "best" device is the device which has most recently opened a connection successfully, with the fewest amount of
connection failures.
Occurs when a connection is about to be opened.
Occurs when a new connection has opened successfully.
Occurs when an open connection is about to be closed.
Occurs when an open connection has been closed.
Returns a natural language name for the device.
Returns a reset event used to determine when GPS detection has completed.
Returns whether a connection is established with the device.
Returns the stream associated with this device.
This property is provided solely for more advanced developers who need to interact directly with a device.
During normal operations, the stream returned by this property is managed by this class. As a result, it is not necessary
to dispose of this stream. If no connection is open, this property will return null.
Returns the date and time the device was last confirmed as a GPS device.
Returns the date and time the device last opened a connection.
Returns whether the device is currently being examined for GPS data.
Controls whether the device can be queried for GPS data.
true if [allow connections]; otherwise, false.
In some cases, an attempt to open a connection to a device can cause problems. For example,
a serial port may be assigned to a barcode reader, or a Bluetooth device may represent a downstairs neighbor's
computer. This property allows a device to be left alone; no connection will be attempted to the device
for any reason.
Returns whether GPS protocol detection has been completed.
Returns whether the device has been confirmed as a GPS device.
Controls the number of times this device has been confirmed as a GPS device.
In order to maximize the performance of detecting GPS devices, statistics are maintained for each device. This
property indicates how many times the device has been confirmed as a GPS device. It will be incremented automatcially if
a call to DetectProtocol has been successful.
Controls the number of times this device has failed to identify itself as a GPS device.
In order to prioritize and maximize performance of GPS device detection, statistics are kept for each device.
These statistics control how detection is performed in the future. For example, a device with a success rate of 100 and a failure
rate of 1 would be tested before a device with a success rate of zero. This property is updated automatically based on the
results of a call to DetectProtocol.
Returns the chance that a connection to the device will be successful.
Returns the average amount of time required to open a connection.
Returns the total amount of time spent so far opening a connection.
Controls the amount of time to wait before aborting a read operation.
The default read timeout.
Controls the amount of time to wait before aborting a write operation.
The default write timeout.
Creates a NetworkDevice from the specified parameters
The address family.
Type of the socket.
Type of the protocol.
Creates a NetworkDevice from the specified parameters
The address family.
Type of the socket.
Type of the protocol.
The end point.
Creates a new connection to the specified endpoint.
The end point.
Occurs immediately before a socket is opened.
Creates a new Stream object for the device.
The access.
The sharing.
A Stream object.
Disposes of any unmanaged (or optionally, managed) resources used by the device.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Removes previously cached information for this device from the registry.
Records information about this device to the registry.
Reads information about this device from the registry.
Returns the addressing scheme the socket can use.
Returns the type of protocol used by the socket.
Returns the protocol supported by the socket.
Returns the network address for the device.
The end point.
Returns the socket associated with this device.
Controls the amount of time allowed for a connection to be successfully opened.
The default connect timeout.
Returns a natural language name for the device.
Returns a GUID which represents the RFComm service.
Creates a new instance using the specified address.
The address.
Creates a new instance using the specified address and name.
The address.
The name.
Creates a new instance using the specified endpoint and friendly name.
The end point.
The name.
Releases unmanaged and - optionally - managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Performs a test on the device to confirm that it transmits GPS data.
A Boolean value, True if the device is confirmed.
Called when [cache remove].
Called when [cache write].
Called when [cache read].
Searches the room for Bluetooth devices.
This method will perform discovery of nearby Bluetooth devices. Discovery will take place on a separate thread,
and the DeviceDiscovered event will be raised for each device service discovered. If a device publishes multiple
services, multiple events will be raised for each service.
Searches the room for Bluetooth devices.
A Boolean indicating whether the cache of Bluetooth information should be cleared.
This method will perform discovery of nearby Bluetooth devices. Discovery will take place on a separate thread,
and the DeviceDiscovered event will be raised for each device service discovered. If a device publishes multiple
services, multiple events will be raised for each service.
If the IsCacheFlushed parameter is True, any cached information will be cleared, and a
wireless scan of devices will be performed. This kind of scan is preferable since it can detect which devices are actually responding
right now, even though the query will take several seconds to occur. A value of False is typically used if a
device scan was recently performed and responsiveness is necessary.
Wait for discovery
boolean
Waits for discovery, specifying a timeout
The TimeSpan specifying the timeout where waiting ends.
Discovers the devices thread proc.
Refreshes this instance.
Loads the Bluetooth devices that have been cached by GPS.Net. This list contains previously-detected GPS devices,
along with devices which were tested but found to NOT be GPS devices. By keeping these statistics,
the detection system can become faster over time by first testing devices which have a better success rate.
The list to which the cached devices are added.
Loads the Bluetooth devices that have already been discovered by Windows. This list includes non-GPS devices.
The list to which the devices are added.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Occurs when a new Bluetooth device has been detected.
Returns the address of the device.
Returns the primary purpose of the device.
Returns a sub-category describing the purpose of the device.
Returns the major type of device.
Returns a serial device which has been linked to this device.
Returns the name of the Bluetooth device.
If the device has been identified, the actual name of the device will be returned. Otherwise, the
device's address will be returned.
Controls whether the device can be queried for GPS data.
true if [allow connections]; otherwise, false.
Controls the maximum allowed detection failures before a device is excluded from detection.
The maximum allowed failures.
Some devices involved with device detection are not GPS devices. For example, a Bluetooth search
could return wireless headphones, or the neighbor's computer. This property controls how many times a device will be
tested before it is no longer included for searches. If a device's failure count goes beyond this number, attempts
will no longer be made to connect to the device.
Returns a list of known Bluetooth devices.
To maximize performance, GPS.NET will record information about each device it encounters for the purposes of organizing
and speeding up the GPS device detection process. This property returns a list of all known Bluetooth devices.
Since this list is managed automatically, it should not be modified.
Controls the amount of time spent searching for Bluetooth devices.
The discovery timeout.
Indicates the classification of a Bluetooth device.
Misc
Computer
Phone
Lan
Audio
Peripheral
Imaging
Unclassified
Indicates the kind of service provided by a Bluetooth device.
None
Limited Disoverable mode
Positioning
Networking
Rendering
Capturing
Object Transfer
Audio
Telephony
Information
all
Represents a Bluetooth service on a device.
Creates a new instance using the specified address.
The address.
Creates a new instance using the specified address and service GUID.
The address.
The service.
Creates a new instance using the specified address, service GUID, and remote port number.
The address.
The service.
The port.
Creates a new instance from the specified socket address.
The socket address.
Sets the name.
The name.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Determines whether the specified is equal to this instance.
The to compare with the current .
true if the specified is equal to this instance; otherwise, false.
Creates an instance from a instance.
The socket address that serves as the endpoint for a connection.
A new instance that is initialized from the specified instance.
Any attempt is made to access the method when the method is not overridden in a descendant class.
Serializes endpoint information into a instance.
A instance that contains the endpoint information.
Any attempt is made to access the method when the method is not overridden in a descendant class.
Returns a that represents this instance.
A that represents this instance.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Returns a GUID indentifying the service.
Returns the port used for opening connections.
Returns a friendly name for the endpoint.
Returns the unique address of the device, used for connections.
Controls the number of times this endpoint has been identified as a GPS service.
The successful detection count.
Controls the number of times this endpoint has failed to identify itself as a GPS service.
The failed detection count.
Gets the address family to which the endpoint belongs.
One of the values.
Any attempt is made to get or set the property when the property is not overridden in a descendant class.
Represents a Bluetooth radio.
Most computers have a single Bluetooth radio attached to them. The radio is responsible for wireless communications
with all Bluetooth devices. This class provides the ability to enable or disable the radio, as well as to access devices which
the radio can detect.
Initializes a new instance of the class.
Initializes a new instance of the class.
The handle.
Controls whether the radio can accept incoming connections.
Controls whether the radio can accept incoming connections.
if set to true [value].
Determines whether the specified is equal to this instance.
The to compare with the current .
true if the specified is equal to this instance; otherwise, false.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a that represents this instance.
A that represents this instance.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Returns the current Bluetooth radio if one is installed.
Gets the handle.
Returns the name of the radio.
Returns the primary purpose of the device.
Returns a sub-category describing the purpose of the device.
Returns the major type of device.
Represents an Earth-centered, Earth-fixed (ECEF) Cartesian coordinate.
Creates a new instance using the specified X, Y and Z values.
The x.
The y.
The z.
Creates a new instance from the specified block of GML.
The reader.
Returns a cartesian coordinate with empty values.
Returns a cartesian point with infinite values.
Represents an invalid or unspecified value.
Converts the current instance to a geodetic (latitude/longitude) coordinate.
A Position object containing the converted result.
The conversion formula will convert the Cartesian coordinate to
latitude and longitude using the WGS1984 ellipsoid (the default ellipsoid for
GPS coordinates).
Converts the current instance to a geodetic (latitude/longitude) coordinate using the specified ellipsoid.
The ellipsoid.
A Position object containing the converted result.
The conversion formula will convert the Cartesian coordinate to
latitude and longitude using the WGS1984 ellipsoid (the default ellipsoid for
GPS coordinates). The resulting three-dimensional coordinate is accurate to within two millimeters
(2 mm).
Returns the distance from the current instance to the specified cartesian point.
A CartesianPoint object representing the end of a segment.
Returns a that represents this instance.
The format.
A that represents this instance.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a that represents this instance.
A that represents this instance.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Implements the operator +.
A.
The b.
The result of the operator.
Implements the operator -.
A.
The b.
The result of the operator.
Implements the operator *.
A.
The b.
The result of the operator.
Implements the operator /.
A.
The b.
The result of the operator.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Returns the horizontal (longitude) portion of a Cartesian coordinate.
Returns the vertical (latitude) portion of a Cartesian coordinate.
Returns the altitude portion of a Cartesian coordinate.
Indicates whether the current instance has no value.
Indicates whether the current instance is invalid or unspecified.
Represents information about a GPS device when a device-related event is raised.
A default instance
Creates a new instance of the event args
The device.
The device
Represents an examination of a GPS device for its capabilities and health.
Initializes a new instance of the class.
The device.
if set to true [is working properly].
The log.
The supported sentences.
if set to true [is position supported].
if set to true [is altitude supported].
if set to true [is bearing supported].
if set to true [is precision supported].
if set to true [is speed supported].
if set to true [is satellites supported].
Sends this analysis anonymously to DotSpatial.Positioning for further study.
A Boolean value, True if the HTTP response indicates success.
DotSpatial.Positioning collects device detection information for the purposes of improving
software, widening support for devices, and providing faster technical support. This method
will cause an HTTP POST to be sent to the DotSpatial.Positioning web server with the values in this class.
The information is collected anonymously.
One benefit of sending an analysis is that it can instantly update statistics for supported
GPS devices. The anonymous results will be compiled into an RSS feed which developers can use to
instantly be notified of both healthy and problematic devices.
The DotSpatial.Positioning server can handle repeated calls to this method, though requests should not
be sent more than every few seconds. Duplicate reports are automatically ignored by our system. So
long as customers are aware of the implications of an HTTP request (such as possible cell phone charges),
you are welcome to use this functionality in your application.
Sends this analysis anonymously to the specified Uri for further study.
The URI.
A Boolean value, True if the HTTP response indicates success.
Developers may wish to generate detection logs from customers for the purposes of
improving technical support. This can also be used to collect statistics about GPS devices which
customers use. This method will create an HTTP POST to the specified address with the information in this
class.
The actual fields sent will vary depending on the type of object being reported. Currently, this
feature works for SerialDevice, BluetoothDevice, and GpsIntermediateDriver device objects.
Returns a log of activity while the device was tested.
Returns whether the device is healthy
Returns NMEA sentences discovered during analysis.
Returns whether real-time latitude and longitude are reported by the device.
Returns whether the distance above sea level is reported by the device.
Returns whether the real-time direction of travel is reported by the device.
Returns whether dilution of precision information is reported by the device.
Returns whether the real-time rate of travel is reported by the device.
Returns whether real-time satellite information is reported by the device.
Encapsulates GPS device detection features and information about known devices.
Initializes a new instance of the class.
Aborts the process of finding GPS devices and blocks until the cancellation is complete.
Aborts the process of finding GPS devices and optionally blocks until the cancellation is complete.
If set to , then the method will return immediately rather than waiting
for the cancellation to complete.
Starts looking for GPS devices on a separate thread.
Cancels detection and removes any cached information about known devices.
Use the method to re-detect devices and re-create the device cache.
Waits for any GPS device to be detected.
Waits for any GPS device to be detected up to the specified timeout period.
The timeout.
Waits for device detection to complete.
Waits for device detection to complete up to the specified timeout period.
The timeout.
Raises the event.
The instance containing the event data.
Raises the event.
The instance containing the event data.
Handles the DeviceDiscovered event of the BluetoothDevice control.
The source of the event.
The instance containing the event data.
Detections the thread proc.
This method, spawned by the ThreadPool, monitors detection and aborts it if it's taking too long.
The over9000.
Begins detecting all bluetooth devices to determine if they are GPS devices.
All detection is done asynchronously, so this method returns immediately.
Use the method if you need to block until detection is completed.
Begins detecting all serial devices to determine if they are GPS devices.
All detection is done asynchronously, so this method returns immediately.
Use the method if you need to block until detection is completed.
If set to , the colon character (":") will be omitted from the port names.
This is required on some systems in order for the device to be detected properly.
Discovers any new bluetooth devices.
Waits for device detection to complete.
Renames the specified serial device, only if there is not already another serial device with the specified name.
The device to be renamed.
The new name for the device.
Clears the , , and lists.
This will cause the lists to be rebuilt the next time the or
methods are called.
Called when [device detection attempted].
The device.
Called when [device detection attempt failed].
The exception.
Called when [device detection started].
Called when [device detection completed].
Called when [device discovered].
The device.
Adds a GPS device to the list of known GPS devices.
The device.
Occurs when the process of finding GPS devices has begun.
Occurs immediately before a device is about to be tested for GPS data.
Occurs when a device has failed to transmit recognizable GPS data.
Occurs when a device is responding and transmitting GPS data.
Occurs when a Bluetooth device has been found.
Occurs when the process of finding GPS devices has been interrupted.
Occurs when the process of finding GPS devices has finished.
Occurs when any interpreter detects a change in the current location.
Occurs when any interpreter detects a change in the distance above sea level.
Occurs when any interpreter detects a change in the current rate of travel.
Occurs when any interpreter detects a change in GPS satellite information.
Occurs when any interpreter detects a change in the direction of travel.
Occurs when any interpreter detects a change in the direction of heading.
Occurs when any interpreter detects when a GPS device can no longer calculate the current location.
Occurs when any interpreter detects when a GPS device becomes able to calculate the current location.
Occurs when any interpreter detects a change in the satellite-derived date and time.
Returns a GPS device which is connectable and is reporting data.
Controls whether Bluetooth devices are included in the search for GPS devices.
true if [allow bluetooth connections]; otherwise, false.
Controls whether serial devices are included in the search for GPS devices.
true if [allow serial connections]; otherwise, false.
Controls whether a complete range of serial devices is searched, regardless of which device appear to actually exist.
true if [allow exhaustive serial port scanning]; otherwise, false.
Controls the maximum serial port to test when exhaustive detection is enabled.
The maximum serial port number.
Returns a list of confirmed GPS devices.
Returns a list of known wireless Bluetooth devices (not necessarily GPS devices).
Returns a list of known serial devices (not necessarily GPS devices).
Controls the amount of time allowed for device detection to complete before it is aborted.
The device detection timeout.
Controls whether detection is aborted once one device has been found.
true if this instance is only first device detected; otherwise, false.
Controls whether the system clock should be synchronized to GPS-derived date and time.
true if this instance is clock synchronization enabled; otherwise, false.
Controls whether the Bluetooth receiver is on and accepting connections.
true if this instance is bluetooth enabled; otherwise, false.
Returns whether the Bluetooth stack on the local machine is supported by GPS.NET.
Returns whether a GPS device has been found.
Returns whether the process of finding a GPS device is still working.
Controls the current location on Earth's surface.
The position.
Controls the current rate of travel.
The speed.
Controls the current list of GPS satellites.
The satellites.
Controls the current satellite-derived date and time.
The UTC date time.
Controls the current satellite-derived date and time.
The date time.
Controls the current distance above sea level.
The altitude.
Controls the current direction of travel.
The bearing.
Controls the current direction of heading.
The heading.
Gets a value indicating whether this instance is stream needed.
Represents a problem which has occured during device detection.
Creates a new instance of a DeviceDetectionException
The device.
The inner exception.
Creates a new instance of a DeviceDetectionException
The device.
The message.
Creates a new instance of a DeviceDetectionException
The device.
The message.
The inner exception.
The device that caused the exception
Represents information about a device detection problem during detection-related events.
Creates a new instance of the DeviceDetectionException event arguments.
The exception.
The device that is involved in the event
The exception
Represents a confidence level in the precision of GPS data.
Dilution of Precision (or "DOP" for short) is a very important concept for GPS software
developers. When GPS devices calculate the current location on Earth's surface, inaccuracies
can cause the calculated position to be incorrect by as much as an American football field! To
help minimize these effects, the GPS device also reports DOP values. A low DOP value (such as 2)
indicates excellent precision, whereas a high value (such as 50) indicates that precision is very
poor.
As a rule of thumb, a DOP value can be multiplied by the average precision of a GPS device
to get a measurable amount of error. Most consumer GPS devices are capable of about four to six meters
of precision at their best, or as low as one to three meters if DGPS services such as WAAS or EGNOS are
being utilized. Or, an average of five meters without DGPS, and an average of two meters with DGPS.
So, if the current Dilution of Precision is four, and WAAS is in effect, the current precision is
"2 meters * four = 8 meters" of precision.
GPS.NET includes features to help you monitor and control the precision of your GPS devices. Properties
such as MaximumHorizontalDilutionOfPrecision will cause a GPS.NET interpreter to throw out
any real-time data until the DOP is at or below a specific number. To help you determine this maximum number for
your application, an article is available to help you. You can find it online at the DotSpatial.Positioning web site here:
http://dotspatial.codeplex.com/Articles/WritingApps2_1.aspx.
Represents the typical precision of a consumer-grade GPS device: six meters.
Represents the typical precision of a consumer-grade GPS device with WAAS, MSAS or EGNOS: two meters.
Represents the worst possible DOP value of fifty.
Represents the best possible DOP value of one.
Represents a DOP reading signifying nearly-ideal precision.
Represents a DOP reading signifying inaccurate positional measurements.
Represents a FOP reading signifying grossly inaccurate positional
measurements.
Represents a value of 1, where the GPS device is making the most accurate
measurements possible.
Represents a DOP reading signifying inaccurate positional measurements.
Represents a DOP reading signifying fairly accurate positional
measurements.
Represents an invalid or unspecified DOP value.
Creates a new instance using the specified value.
The value.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a that represents this instance.
A that represents this instance.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Compares the current object with another object of the same type.
An object to compare with this object.
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings:
Value
Meaning
Less than zero
This object is less than the parameter.
Zero
This object is equal to .
Greater than zero
This object is greater than .
Returns the numeric value of the rating.
Returns whether the value is zero.
Returns whether the value is invalid or unspecified.
Returns the estimated precision as a measurable distance.
The precision estimate is a product of this value and the value of the
CurrentAverageDevicePrecision static property.
Returns a friendly name for the level of precision.
Controls the estimated average precision possible by the current GPS device.
The current average device precision.
Most consumer GPS devces are capable of about six meters of precision without DGPS features
such as WAAS or EGNOS. When DGPS features are utilized, a typical cunsumer device is capable of about
two meters of precision. If you know of a specific amount for your device, you can set this property to
assist GPS.NET in calculating the current estimated measurable amount of error in latitude/longitude reports.
Indicates an interpretation of the accuracy of a measurement made by the GPS
device.
This enumeration is used by the
Rating property of the
DilutionOfPrecision class. This interpretation is subject to discussion as to
what precisely constitutes a "good" versus "bad" DOP. Use your own best judgement based
on the needs of your application. Generally speaking, a DOP of six or less is
recommended for en-route navigation, and three or less for highly-precise measurements.
A rating of Moderate corresponds with six or better, a rating of
Excellent means three or less, and a rating of Ideal
means the best value of one.
The rating is unknown or not yet available.
Represents a value of 1, where the GPS device is making the most accurate
measurements possible.
The GPS device is making high-quality measurements, good enough for applications
requiring higher levels of precision. Represents a value of 2 or 3.
The GPS device is making measurements accurate enough for en-route navigation.
Represents a value between 4 and 6.
The GPS device is making measurements good enough to indicate the approximate
location, but should be ignored by applications requiring high accuracy. Represents a
value of 7 or 8.
The GPS device is making measurements with an accuracy which should only be used
to indicate the approximate location, but is not accurate enough for en-route
navigation. Represents a value between 9 and 20.
The GPS device is calculating the current location, but the accuracy is extremely
low and may be off by a factor of fifty. Represents a value between 21 and the maximum
possible of 50.
Represents information about a DOP measurement when an DOP-related event is raised.
This example demonstrates how to use this class when raising an event.
' Declare a new event
Dim MyDilutionOfPrecisionEvent As EventHandler
' Create a DilutionOfPrecision of 30 horizontal
Dim MyDilutionOfPrecision As New DilutionOfPrecision(DilutionOfPrecisionType.Horizontal, 30.0)
Sub Main()
' Raise our custom event
RaiseEvent MyDilutionOfPrecisionEvent(Me, New DilutionOfPrecisionEventArgs(MyDilutionOfPrecision))
End Sub
// Declare a new event
EventHandler MyDilutionOfPrecisionEvent;
// Create a DilutionOfPrecision of 30 horizontal
DilutionOfPrecision MyDilutionOfPrecision = new DilutionOfPrecision(DilutionOfPrecisionType.Horizontal, 30.0);
void Main()
{
// Raise our custom event
MyDilutionOfPrecisionEvent(this, New DilutionOfPrecisionEventArgs(MyDilutionOfPrecision));
}
DilutionOfPrecision Class
EventHandler Delegate
This class is typically used for events in the DilutionOfPrecision class to
provide notification when hours, minutes, decimal minutes or seconds properties have changed.
Creates a new instance with the specified DOP measurement.
The dilution of precision.
A DilutionOfPrecision object which is the target of the event.
Represents a simulated GPS device.
An Excpetion occured
Initializes a new instance of the class.
Initializes a new instance of the class.
The name.
Open
Emulators the thread proc.
Called when [emulation].
Toggles the IsRandom flag.
The state to toggle the flag.
Randomizes the emulation by changing speed and direction
GPS coordinate emulation can be randomized by any number of factors, depending on the emulator type used.
Any emulation can have it's direction and speed randomized within specified tolerances. By default, speed is
limited to between 0 (low) and 5 (high) meters/second and bearing changes are limited to +/- 45 degrees
(a 90 degree arc) from North (0) degrees.
Randomizes the emulation by changing speed and direction
The randomizer to use.
The minimum travel speed.
The maximum travel speed.
The initial direction of travel.
The arc in which random directional changes will occur.
GPS coordinate emulation can be randomized by any number of factors, depending on the emulator type used.
Any emulation can have it's direction and speed randomized within specified tolerances. By default, speed is
limited to between 0 (low) and 5 (high) meters/second and bearing changes are limited to +/- 45 degrees
(a 90 degree arc) from North (0) degrees.
Returns a that represents this instance.
A that represents this instance.
When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.
An I/O error occurs.
When overridden in a derived class, sets the position within the current stream.
A byte offset relative to the parameter.
A value of type indicating the reference point used to obtain the new position.
The new position within the current stream.
An I/O error occurs.
The stream does not support seeking, such as if the stream is constructed from a pipe or console output.
Methods were called after the stream was closed.
When overridden in a derived class, sets the length of the current stream.
The desired length of the current stream in bytes.
An I/O error occurs.
The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output.
Methods were called after the stream was closed.
When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
An array of bytes. When this method returns, the buffer contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source.
The zero-based byte offset in at which to begin storing the data read from the current stream.
The maximum number of bytes to be read from the current stream.
The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
The sum of and is larger than the buffer length.
is null.
or is negative.
An I/O error occurs.
The stream does not support reading.
Methods were called after the stream was closed.
Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.
The unsigned byte cast to an Int32, or -1 if at the end of the stream.
The stream does not support reading.
Methods were called after the stream was closed.
When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
An array of bytes. This method copies bytes from to the current stream.
The zero-based byte offset in at which to begin copying bytes to the current stream.
The number of bytes to be written to the current stream.
The sum of and is greater than the buffer length.
is null.
or is negative.
An I/O error occurs.
The stream does not support writing.
Methods were called after the stream was closed.
Writes a byte to the current position in the stream and advances the position within the stream by one byte.
The byte to write to the stream.
An I/O error occurs.
The stream does not support writing, or the stream is already closed.
Methods were called after the stream was closed.
Closes the emulation stream, but doesn't dispose of it.
The Emulator.Close() method simply terminates the thread that feeds data to
a virtual Device. This allows the emulator to be reused indefinately.
Releases the unmanaged resources used by the and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Default Read Buffer Size
The default size of the read buffer.
Default Write Buffer Size
The default size of the write buffer.
Default Read Timeout
The default read timeout.
The Timespan of before the write operation times out.
The default write timeout.
Gets a value indicating whether this instance is emulation thread alive.
Returns the current randomizer for emulation.
Returns the amount of time the emulator waits before processing new data.
The interval.
Indicates whether enough satellite signals exist to determine the current location.
Gets a value indicating whether or not the emulator is generating data that
changes in random manner.
the string Name ofhte emulator
The string altitude
The altitude.
the speed
The speed.
The Directional azimuth angle
The bearing.
The integer count of fixed satellites
The quality of the GPS signal
The fix quality.
The mode of the signal fix
The fix mode.
the fix method
The fix method.
The status of the fix
The fix status.
the Horizontal Dilution of Precision (HPDOP)
The horizontal dilution of precision.
The Vertical Dilution of Precision (VPDOP)
The vertical dilution of precision.
The average of the Dilution of precision values.
The mean dilution of precision.
Gets the list of satellites.
Gets the list of positions that make up this route
Gets the Position structure for the current position
The current position.
Gets or sets the position with the new destination
The current destination.
Gets the DateTime structure for Now
Gets the UtcCorrected value for Now
When overridden in a derived class, gets a value indicating whether the current stream supports reading.
true if the stream supports reading; otherwise, false.
When overridden in a derived class, gets a value indicating whether the current stream supports seeking.
true if the stream supports seeking; otherwise, false.
Gets a value that determines whether the current stream can time out.
A value that determines whether the current stream can time out.
Gets the read buffer.
Gets the read data available wait handle.
Gets the write buffer.
Gets the write data available wait handle.
When overridden in a derived class, gets or sets the position within the current stream.
The position.
The current position within the stream.
An I/O error occurs.
The stream does not support seeking.
Methods were called after the stream was closed.
When overridden in a derived class, gets the length in bytes of the stream.
A long value representing the length of the stream in bytes.
A class derived from Stream does not support seeking.
Methods were called after the stream was closed.
When overridden in a derived class, gets a value indicating whether the current stream supports writing.
true if the stream supports writing; otherwise, false.
Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out.
The read timeout.
A value, in miliseconds, that determines how long the stream will attempt to read before timing out.
The method always throws an .
Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out.
The write timeout.
A value, in miliseconds, that determines how long the stream will attempt to write before timing out.
The method always throws an .
Indicates which devices are being used to obtain a fix, other than the GPS device
itself.
' Declare a new receiver
Private WithEvents MyReceiver As New Receiver()
' Raised when the fix quality has changed
Private Sub OnFixQualityChanged(ByVal sender As Object, ByVal e As FixQualityEventArgs)
' What is the new fix quality°
Select Case e.FixQuality
Case FixQuality.NoFix
' No fix is obtained
Debug.WriteLine("No fix is currently obtained.")
Case FixQuality.GpsFix
' A fix is present
Debug.WriteLine("A fix has been obtained using only GPS satellites.")
Case FixQuality.DifferentialGpsFix
' A differential fix is present
Debug.WriteLine("A fix has been obtained using GPS satellites and correction information from DGPS/WAAS ground stations.")
Case FixQuality.Estimated
' A fix is being estimated (not an actual fix)
Debug.WriteLine("A fix is currently being estimated. ")
End Select
End Sub
// Declare a new receiver
Receiver MyReceiver = new Receiver();
// Raised when the fix quality has changed
void OnFixQualityChanged(Object sender, FixQualityEventArgs e)
{
// What is the new fix quality°
switch (e.FixQuality)
{
case FixQuality.NoFix:
// No fix is obtained
Debug.WriteLine("No fix is currently obtained.");
case FixQuality.GpsFix:
// A fix is present
Debug.WriteLine("A fix has been obtained using only GPS satellites.");
case FixQuality.DifferentialGpsFix:
// A differential fix is present
Debug.WriteLine("A fix has been obtained using GPS satellites and correction information from DGPS/WAAS ground stations.");
case FixQuality.Estimated:
// A fix is being estimated (not an actual fix)
Debug.WriteLine("A fix is currently being estimated. ");
}
}
This enumeration is typically used by the
Not enough information is available to specify the current fix quality.
No fix is currently obtained.
A fix is currently obtained using GPS satellites only.
A fix is obtained using both GPS satellites and DGPS/WAAS ground
stations. Position error is as low as 0.5-5 meters.
A PPS or pulse-per-second fix. PPS signals very accurately indicate the start of a second.
Used for surveying. A fix is obtained with the assistance of a reference station. Position error is as low as 1-5 centimeters.
Used for surveying. A fix is obtained with the assistance of a reference station. Position error is as low as 20cm to 1 meter.
The fix is being estimated.
The fix is being input manually.
The fix is being simulated.
Indicates whether a fix is present and if altitude can be calculated along with
latitude and longitude.
This example demonstrates how to use the FixMethod enumeration to tell if altitude
measurements can be made. Notice: Some devices have built-in altimeters. These devices
can report altitude even when there is no fix present. To support such devices, avoid
using this property entirely and use any non-zero altitude measurement.
Private WithEvents MyReceiver As New Receiver()
' Raised whenever the fix method has changed
Private Sub OnFixMethodChanged(ByVal sender As Object, ByVal e As FixMethodEventArgs)
' What is the new fix method°
Select Case e.FixMethod
Case FixMethod.NoFix
' We have neither position or altitude
Debug.WriteLine("Your position is: Not Yet Available")
Debug.WriteLine("Your altitude is: Not Yet Available")
Case FixMethod.Fix2D
' We have a position but no altitude
Debug.WriteLine("Your position is: " & MyReceiver.Position.ToString)
Debug.WriteLine("Your altitude is: Not Yet Available")
Case FixMethod.Fix3D
' We have both position and altitude
Debug.WriteLine("Your position is: " & MyReceiver.Position.ToString)
Debug.WriteLine("Your altitude is: " & MyReceiver.Altitude.ToString)
End Select
End Sub
// Declare a new receiver
Private WithEvents MyReceiver As New Receiver()
// Raised whenever the fix method has changed
void OnFixMethodChanged(Object sender, FixMethodEventArgs e)
{
// What is the new fix method°
switch (e.FixMethod)
{
case FixMethod.NoFix:
// We have neither position or altitude
Debug.WriteLine("Your position is: Not Yet Available");
Debug.WriteLine("Your altitude is: Not Yet Available");
case FixMethod.Fix2D:
// We have a position but no altitude
Debug.WriteLine("Your position is: " & MyReceiver.Position.ToString());
Debug.WriteLine("Your altitude is: Not Yet Available");
case FixMethod.Fix3D:
// We have both position and altitude
Debug.WriteLine("Your position is: " & MyReceiver.Position.ToString());
Debug.WriteLine("Your altitude is: " & MyReceiver.Altitude.ToString());
}
}
This enumeration is used by the
class to indicate if altitude measurements are possible. Altitude measurements are
possible whenever there are four or more satellites involved in a fix.
The GPS device does not have a fix on the current position.
The GPS device is reporting latitude and longitude.
The GPS device is reporting latitude, longitude, and altitude.
The fix method is not yet known.
Indicates whether a satellite fix is currently active.
The satellite fix is untested
The satellite fix is inactive
The satellite fix is active
Indicates the likelihood that a GPS satellite fix will be obtained or
sustained.
This example uses the FixLikelihood enumeration to make a judgement call on the
stability of the fix.
' Declare a new receiver
Private WithEvents MyReceiver As New Receiver()
Sub Main()
' Start listening for messages
MyReceiver.Start
End Sub
Sub OnFixLikelihoodChanged(ByVal sender As Object, ByVal e As FixLikelihoodEventArgs) Handles MyReceiver.FixLikelihoodChanged
' Do we have a fix currently°
If MyReceiver.IsFixObtained Then
' Yes. What's the likelihood that the fix will be sustained°
Select Case MyReceiver.FixLikelihood
Case FixLikelihood.Unlikely
Debug.WriteLine("The current fix is about to be lost!")
Case FixLikelihood.Possible
Debug.WriteLine("The current fix is unstable. Find a more open view of the sky soon.")
Case FixLikelihood.Likely
Debug.WriteLine("The current fix is nearly stable.")
Case FixLikelihood.Certain
Debug.WriteLine("The current fix is stable.")
End Select
Else
' No. What's the likelihood that a fix will be obtained°
Select Case MyReceiver.FixLikelihood
Case FixLikelihood.Unlikely
Debug.WriteLine("A fix is not possible. Find a more open view of the sky.")
Case FixLikelihood.Possible
Debug.WriteLine("A fix is possible, but satellite signals are still mostly obscured.")
Case FixLikelihood.Likely
Debug.WriteLine("A fix should occur within the next several seconds.")
Case FixLikelihood.Certain
Debug.WriteLine("A fix will occur in a few seconds.")
End Select
End If
End Sub
' Declare a new receiver
Private Receiver MyReceiver = new Receiver();
void Main()
{
// Start listening for messages
MyReceiver.Start();
}
void OnFixLikelihoodChanged(Object sender, FixLikelihoodEventArgs e)
{
// Do we have a fix currently°
if (MyReceiver.IsFixObtained)
{
// Yes. What's the likelihood that the fix will be sustained°
switch (MyReceiver.FixLikelihood)
{
case FixLikelihood.Unlikely:
Debug.WriteLine("The current fix is about to be lost!");
break;
case FixLikelihood.Possible:
Debug.WriteLine("The current fix is unstable. Find a more open view of the sky soon.");
break;
case FixLikelihood.Likely:
Debug.WriteLine("The current fix is nearly stable.");
break;
case FixLikelihood.Certain:
Debug.WriteLine("The current fix is stable.");
break;
}
}
else
{
// No. What's the likelihood that a fix will be obtained°
switch (MyReceiver.FixLikelihood)
{
case FixLikelihood.Unlikely:
Debug.WriteLine("A fix is not possible. Find a more open view of the sky.");
break;
case FixLikelihood.Possible:
Debug.WriteLine("A fix is possible, but satellite signals are still mostly obscured.");
break;
case FixLikelihood.Likely:
Debug.WriteLine("A fix should occur within the next several seconds.");
break;
case FixLikelihood.Certain:
Debug.WriteLine("A fix will occur in a few seconds.");
break;
}
}
}
Indicates that a fix would probably be lost if a fix is acquired.
When this value is returned, nearly all of the available GPS satellite signals are being obscured by buildings, trees, or other solid objects. The device should be moved into a more open view of the sky.
Indicates that a fix would probably be lost after a short period of time if a fix
is acquired.
When this value is returned, a few satellite signals are available, but the combined signals are too weak to maintain a fix for long. The device should be moved into a more open view of the sky.
Indicates that a fix would probably last for a longer period of time if a fix is
acquired.
When this value is returned, at least three satellite signals are being received clearly. If conditions stay the same or improve, a fix is imminent.
Indicates that a fix is very likely to be sustained given the current satellite
signal strengths.
When this value is returned, several satellite signals are being received and are strong enough to maintain a fix.
Indicates if the GPS device is automatically deciding between a 2-D and a 3-D
fix.
This enumeration is used by the
class. A vast majority of GPS devices use a setting of Automatic because there is no
complicated math behind figuring out if a 2-D fix or 3-D fix is present. If there are
three satellites involved in a fix, only the latitude and longitude can be calculated,
so the fix is 2-D. If more than three involved, the fix is 3-D.
Typical value. The GPS device is automatically deciding between a two- and three-dimensional fix.
Rare value. The user must specify whether a two- or three-dimensional fix is to be used.
The fix mode is not yet known.
Represents information about the method used to obtain a fix when a fix-related event is raised.
This example demonstrates how to use this class when raising an event.
' Declare a new event
Dim MyFixMethodEvent As EventHandler
' Create a FixMethod signifying a 3-D fix (both position and altitude)
Dim MyFixMethod As FixMethod = FixMethod.Fix3D
Sub Main()
' Raise our custom event
RaiseEvent MyFixMethodEvent(Me, New FixMethodEventArgs(MyFixMethod))
End Sub
// Declare a new event
EventHandler MyFixMethodEvent;
// Create a FixMethod signifying a 3-D fix (both position and altitude)
FixMethod MyFixMethod = FixMethod.Fix3D;
void Main()
{
// Raise our custom event
MyFixMethodEvent(this, New FixMethodEventArgs(MyFixMethod));
}
This object is used primarily by the FixMethodChanged
event of the Receiver class to provide notification when
updated fix method information has been received from the GPS device.
Creates a new instance with the specified fix method.
The fix method.
Indicates if the GPS device has no fix, a 2-D fix, or a 3-D fix.
A value from the FixMethod enumeration.
FixMethod Property (Receiver Class)
A device is considered to have a "2-D" fix if there are three satellites
involved in the fix. A 2-D fix means that position information is available, but not
altitude. If at least four satellites are fixed, both position and altitude are known,
and the fix is considered 3-D.
Represents information about the likelihood that a fix will be sustained (or obtained) when a when a fix-related event is raised.
This example demonstrates how to use this class when raising an event.
' Declare a new event
Dim MyFixLikelihoodEvent As FixLikelihoodEventHandler
' Create a FixLikelihood signifying a 3-D fix (both position and altitude)
Dim MyFixLikelihood As FixLikelihood = FixLikelihood.Fix3D
Sub Main()
' Raise our custom event
RaiseEvent MyFixLikelihoodEvent(Me, New FixLikelihoodEventArgs(MyFixLikelihood))
End Sub
// Declare a new event
FixLikelihoodEventHandler MyFixLikelihoodEvent;
// Create a FixLikelihood signifying a 3-D fix (both position and altitude)
FixLikelihood MyFixLikelihood = FixLikelihood.Fix3D;
void Main()
{
// Raise our custom event
MyFixLikelihoodEvent(this, New FixLikelihoodEventArgs(MyFixLikelihood));
}
This object is used primarily by the FixLikelihoodChanged
event of the Receiver class to provide notification when
combined satellite radio signal strength has changed.
Creates a new instance with the specified fix Likelihood.
The fix likelihood.
Indicates if the GPS device has no fix, a 2-D fix, or a 3-D fix.
A value from the FixLikelihood enumeration.
A device is considered to have a "2-D" fix if there are three satellites
involved in the fix. A 2-D fix means that position information is available, but not
altitude. If at least four satellites are fixed, both position and altitude are known,
and the fix is considered 3-D.
Represents information about whether the fix method is chosen automatically when a fix-related event is raised.
This example demonstrates how to use this class when raising an event.
' Declare a new event
Dim MyFixModeEvent As EventHandler
' Create a FixMode signifying that the fix method is being chosen automatically
Dim MyFixMode As FixMode = FixMode.Automatic
Sub Main()
' Raise our custom event
RaiseEvent MyFixModeEvent(Me, New FixModeEventArgs(MyFixMode))
End Sub
// Declare a new event
EventHandler MyFixModeEvent;
// Create a FixMode signifying that the fix method is being chosen automatically
FixMode MyFixMode = FixMode.Automatic;
void Main()
{
// Raise our custom event
MyFixModeEvent(this, New FixModeEventArgs(MyFixMode));
}
This object is used primarily by the FixModeChanged
event of the Receiver class to provide notification when
the receiver switches fix modes from Automatic to Manual or vice-versa.
Creates a new instance with the specified fix method.
The fix mode.
Indicates if the GPS device is choosing the fix method automatically.
A value from the FixMode enumeration.
FixMode Property (Receiver Class)
A vast majority of GPS devices calculate the fix mode automatically. This is because
the process of determining the fix mode is a simple process: if there are three fixed satellites,
a 2-D fix is obtained; if there are four or more fixed satellites, a 3-D fix is in progress. Any
less than three satellites means that no fix is possible.
Represents information about the type of fix obtained when fix-related event is raised.
This example demonstrates how to use this class when raising an event.
' Declare a new event
Dim MyFixQualityEvent As EventHandler
' Create a FixQuality signifying that a differential GPS fix is obtained
Dim MyFixQuality As FixQuality = FixQuality.DifferentialGpsFix
Sub Main()
' Raise our custom event
RaiseEvent MyFixQualityEvent(Me, New FixQualityEventArgs(MyFixQuality))
End Sub
// Declare a new event
EventHandler MyFixQualityEvent;
// Create a FixQuality signifying that a differential GPS fix is obtained
FixQuality MyFixQuality = FixQuality.DifferentialGpsFix;
void Main()
{
// Raise our custom event
MyFixQualityEvent(this, New FixQualityEventArgs(MyFixQuality));
}
This object is used primarily by the FixQualityChanged
event of the Receiver class to provide notification when
the receiver switches fix modes from Automatic to Manual or vice-versa.
Creates a new instance with the specified fix quality measurement.
The fix quality.
Indicates whether the current fix involves satellites and/or DGPS/WAAS ground stations.
A value from the FixQuality enumeration.
Kalman filter for improved positioning
Initialise the filter from a specified Position
The GPS position.
Initialise the filter from a specified Position3D
The GPS position.
Filter the Position
The GPS position.
Return filtered position from specified parameters
The GPS position.
The device error.
The horizontal DOP.
The vertical DOP.
The bearing.
The speed.
Return a filtered Position3d
The GPS position.
Return a filtered Position3D from the specified parameters
The GPS position.
The device error.
The horizontal DOP.
The vertical DOP.
The bearing.
The speed.
The default Kalman filter
The obsedrved position
The filtered position
The observed location
The filtered location
Is the precision filter enabled
Gets the delay
$GPGGA, hhmmss.ss, ddmm.mmmm, n, dddmm.mmmm, e, q, ss, y.y, a.a, z, g.g, z, t.t, iii*CC
http://aprs.gids.nl/nmea/#gga
Global Positioning System Fix Data. Time, location and fix related data for a GPS receiver.
eg2. $--GGA, hhmmss.ss, llll.ll, a, yyyyy.yy, a, x, xx, x.x, x.x, M, x.x, M, x.x, xxxx
hhmmss.ss = UTC of location
llll.ll = latitude of location
a = N or S
yyyyy.yy = Longitude of location
a = E or W
x = GPS Quality indicator (0=no fix, 1=GPS fix, 2=Dif. GPS fix)
xx = number of satellites in use
x.x = horizontal dilution of precision
x.x = Antenna altitude above mean-sea-level
M = units of antenna altitude, meters
x.x = Geoidal separation
M = units of geoidal separation, meters
x.x = Age of Differential GPS data (seconds)
xxxx = Differential reference station ID
eg3. $GPGGA, hhmmss.ss, hhmm.mm, i, hhhmm.mm, i, f, ss, x.x, x.x, M, x.x, M, x.x, xxxx*hh
0 = Time in UTC
1 = Latitude
2 = N or S
3 = Longitude
4 = E or W
5 = GPS quality indicator (0=invalid; 1=GPS fix; 2=Diff. GPS fix)
6 = Number of satellites in use [not those in view]
7 = Horizontal dilution of precision
8 = Antenna altitude above/below mean sea level (geoid)
9 = Meters (Antenna height unit)
10 = Geoidal separation (Diff. between WGS-84 earth ellipsoid and
mean sea level. -=geoid is below WGS-84 ellipsoid)
11 = Meters (Units of geoidal separation)
12 = Age in seconds since last update from diff. reference station
13 = Diff. reference station ID#
14 = Checksum
Represents a single line of NMEA GPS data.
Represents the culture used to process all NMEA GPS data, including numbers and dates.
Creates a new instance.
Creates a new instance from the specified string.
Creates a new instance from known values.
A String containing the entire text of the sentence.
A String, the first word of the sentence.
A String array, the comma-separated strings between the command word and checksum.
A String, the correct checksum for the sentence.
This constructor is typically used when it some processing of the sentence has already occurred.
GPS.NET performs an analysis of the sentence to determine its type. For the sake of speed, processed information can
be preserved using this constructor. To process an entire sentence, use the entire NMEA string as a constructor.
Sets the sentence.
The sentence.
Called when [sentence changed].
Calculates and adds a checksum to the end of the sentence.
Converts the packet into an array of bytes.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Returns the body of the sentence split by commas into strings.
Returns the first word of the sentence which indicates its purpose.
Returns the current checksum of the sentence.
Returns the checksum which matches the content of the sentence.
Returns a string representing the entire NMEA sentence.
Returns whether the pack data is well-formed.
Represents an NMEA sentence which contains latitude and longitude values.
Represents an NMEA sentence which contains a position.
Represents an NMEA sentence which contains time in UTC.
Gets the time in UTC from the IUtcTimeSentence
Represents an NMEA sentence which contains
The Altitude
Represents an NMEA sentence which contains
The Geoidal Separation
Represents an NMEA sentence which contains differential GPS information.
Gets the Differential Gps Station ID
Gets the age of the Differential Gps
Represents an NMEA sentence which describes how the fix is being obtained.
The Fix Quality
Represents an NMEA sentence which contains
The Horizontal Dilution of Precision
Represents an NMEA sentence which returns the number of GPS satellites involved in the current fix.
The Fixed Satellite Count
Creates a new GpggaSentence
The sentence.
Initializes a new instance of the class.
The sentence.
The command word.
The words.
The valid checksum.
Creates a new sentence
The UTC time.
The position.
The fix quality.
The tracked satellite count.
The horizontal dilution of precision.
The altitude.
The geoidal separation.
The differential GPS age.
The differential GPS station ID.
Called when [sentence changed].
Represents an NMEA sentence which contains a position.
Gets the time in UTC from the IUtcTimeSentence
The Altitude
The Horizontal Dilution of Precision
The Geoidal Separation
The Fix Quality
The integer ID of the GPS Station
Differntial GPS Age
The Fixed Satellite Count
$--GGK Header including Talker ID
hhmmss.ss UTC time of location
mmddyy UTC date
llll.ll(Latitude)
a(Hemisphere, North Or South)
yyyyy.yy(Longitude)
a(East Or West)
x GPS quality indicator
0 = Fix not available or invalid
1 = No real-time location, navigation fix
2 = Real-time location, ambiguities not fixed
3 = Real-time location, ambiguities fixed
xx Number of satellites in use, 00 to 12.
x.x(GDOP)
EHT Ellipsoidal height
x.x Altitude of location marker as local ellipsoidal height. If the local ellipsoidal
height is not available, the WGS 1984 ellipsoidal height will be exported.
Represents an NMEA sentence which contains date and time in UTC.
Represents an NMEA sentence which contains date and time in UTC.
Represents an NMEA sentence which contains
The Position Dilution of Precision (PDOP)
Represents an NMEA sentence which contains
The Altitude Above Ellipsoid
Creates a GpggkSentence from the specified string
The sentence.
Initializes a new instance of the class.
The sentence.
The command word.
The words.
The valid checksum.
Called when [sentence changed].
Represents an NMEA sentence which contains a position.
The Fix Quality
The Position Dilution of Precision (PDOP)
The Altitude Above Ellipsoid
Represents an NMEA sentence which contains date and time in UTC.
$GPGLL
Geographic Position, Latitude / Longitude and time.
http://aprs.gids.nl/nmea/#gll
eg1. $GPGLL, 3751.65, S, 14507.36, E*77
eg2. $GPGLL, 4916.45, N, 12311.12, W, 225444, A
4916.46, N Latitude 49 deg. 16.45 min. North
12311.12, W Longitude 123 deg. 11.12 min. West
225444 Fix taken at 22:54:44 UTC
A Data valid
eg3. $GPGLL, 5133.81, N, 00042.25, W*75
1 2 3 4 5
1 5133.81 Current latitude
2 N North/South
3 00042.25 Current longitude
4 W East/West
5 *75 checksum
$--GLL, lll.ll, a, yyyyy.yy, a, hhmmss.ss, A
llll.ll = Latitude of location
a = N or S
yyyyy.yy = Longitude of location
a = E or W
hhmmss.ss = UTC of location
A = status: A = valid data
Represents an NMEA sentence which contains whether a fix is currently acquired.
The Fix Status
Initializes a new instance of the class.
The sentence.
The command word.
The words.
The valid checksum.
Creates a GpgllSentence from the specified string
The sentence.
Creates a GpgllSentence from the specified parameters
The position.
The UTC time.
The fix status.
Called when [sentence changed].
Gets the time in UTC from the IUtcTimeSentence
Represents an NMEA sentence which contains a position.
The Fix Status
$GPGSA
GPS DOP and active satellites
eg1. $GPGSA, A, 3, ,, ,, ,16, 18, ,22, 24, ,, 3.6, 2.1, 2.2*3C
$GPGSA, A, 1, ,, ,, ,, ,, ,, ,, 6, 6, 6
eg2. $GPGSA, A, 3, 19, 28, 14, 18, 27, 22, 31, 39, ,, ,, 1.7, 1.0, 1.3*35
1 = Method:
M=Manual, forced to operate in 2D or 3D
A=Automatic, 3D/2D
2 = Mode:
1=Fix not available
2=2D
3=3D
3-14 = IDs of SVs used in position fix (null for unused fields)
15 = PDOP
16 = HDOP
17 = VDOP
Represents an NMEA sentence which contains the method used to acquire a fix.
The Fix Method
Represents an NMEA sentence which describes the current fix.
Gets the fix mode
Represents an NMEA sentence which contains a list of fixed GPS satellites.
the list of FixedSatellites
Represents an NMEA sentence which contains
The Vertical Dilution of Precision
Creates a GpgsaSentence from the specified string
The sentence.
Initializes a new instance of the class.
The sentence.
The command word.
The words.
The valid checksum.
Creates a new GpgsaSentence
The fix mode.
The fix method.
The satellites.
The position dilution of precision.
The horizontal dilution of precision.
The vertical dilution of precision.
Called when [sentence changed].
the list of FixedSatellites
The Fix Method
The Position Dilution of Precision (PDOP)
The Vertical Dilution of Precision
The Horizontal Dilution of Precision
Gets the fix mode
Represents a $GPGSV sentence describing the location and signal strength of GPS
satellites.
This sentence is used to determine the location of GPS satellites relative
to the current location, as well as to indicate the strength of a satellite's radio
signal.
Represents an NMEA sentence which contains GPS satellite information.
The Satellites
Creates a GPSV sentence instance from the specified string
The sentence.
Initializes a new instance of the class.
The sentence.
The command word.
The words.
The valid checksum.
Creates a GPSV sentence instance from the specified parameters describing the location and signal strength of GPS satellites
The total message count.
The current message number.
The satellites in view.
The satellites.
Called when [sentence changed].
Returns a collection of $GPGSV sentences fully describing the specified
collection of satellites.
The satellites.
Returns a collection of Satellite objects describing current
satellite information.
Returns the total number of $GPGSV sentence in a sequence.
Returns the current message index when the sentence is one of several
messages.
Returns the number of satellites whose signals are detected by the GPS
device.
Heading, True
Represents an NMEA sentence which contains the direction of heading.
the Heading
Creates a heading sentence instance from the specified sentence
The sentence.
Initializes a new instance of the class.
The sentence.
The command word.
The words.
The valid checksum.
Overrides OnSentanceChanged for the GPVTGSentence
the Heading
Represents the "recommended minimum" GPS sentence.
Represents an NMEA sentence which contains the direction of travel.
the Bearing
Represents an NMEA sentence which contains
The Speed
Represents an NMEA sentence which contains
The Magnetic Variation
Initializes a new instance of the class.
The sentence.
The command word.
The words.
The valid checksum.
Creates a GprmcSentence from the specified string
The sentence.
Creates a GprmcSentence from the specified parameters
The UTC date time.
if set to true [is fix acquired].
The position.
The speed.
The bearing.
The magnetic variation.
Called when [sentence changed].
Represents an NMEA sentence which contains a position.
Represents an NMEA sentence which contains date and time in UTC.
the Bearing
The Speed
The Magnetic Variation
The Fix Status
Track made good and ground speed sentence
Creates a track made good and ground speed sentence instance from the specified sentence
The sentence.
Initializes a new instance of the class.
The sentence.
The command word.
The words.
The valid checksum.
Overrides OnSentanceChanged for the GPVTGSentence
the Bearing
The Speed
The Magnetic Variation
Represents a base class for designing a GPS data interpreter.
OnReadPacket Method
This class serves as the base class for all GPS data interpreters, regardless
of the protocol being used. For example, the NmeaInterpreter class
inherits from this class to process NMEA-0183 data from any data source. This class
provides basic functionality to start, pause, resume and stop the processing of GPS
data, and provides management of a thread used to process the next set of incoming
data.
Inheritors should override the OnReadPacket event and
provide functionality to read the next packet of data from the underlying stream.
All raw GPS data must be provided in the form of a Stream object,
and the method should read and process only a single packet of data.
Represents a synchronization object which is locked during state changes.
An Object.
Represents a synchronization object which is locked during state changes to recording.
Occurs immediately before a connection is attempted.
Occurs immediately before data is processed.
Occurs immediately before the interpreter is shut down.
Occurs immediately after the interpreter has been shut down.
Occurs when a connection to a GPS device is suddenly lost.
An Exception which further explains why the connection was lost.
Occurs when the interpreter has temporarily stopped processing data.
Occurs when the interpreter is no longer paused.
Occurs when an exception is trapped by the interpreter's thread.
The ex.
Starts processing GPS data using any available GPS device.
This method is used to begin processing GPS data. If no GPS devices are known, GPS.NET will search for GPS devices and use the
first device it finds. If no device can be found, an exception is raised.
Starts processing GPS data from the specified stream.
A device object providing GPS data to process.
This method will start the Interpreter using a separate thread.
The OnReadPacket is then called repeatedly from that thread to process
incoming data. The Pause, Resume and Stop methods are typically called after this
method to change the interpreter's behavior. Finally, a call to
Dispose will close the underlying stream, stop all processing, and
shut down the processing thread.
Begins recording all received data to the specified stream.
The output.
Causes the interpreter to no longer record incoming GPS data.
Stops all processing of GPS data.
This method is used some time after a call to the Start method.
When called, the GPS processing thread is immediately shut down and all processing
stops.
Temporarily halts processing of GPS data.
This method will suspend the processing of GPS data, but will keep the thread and
raw GPS data stream open. This method is intended as a temporary means of stopping
processing. An interpreter should not be paused for an extended period of time because
it can cause a backlog of GPS data
Un-pauses the interpreter from a previously paused state.
Resets the interpreter to it's default values.
Does the initialize.
Updates the UTC and local date/time to the specified UTC value.
The value.
Updates the fix quality to the specified value.
The value.
Updates the fix mode to the specified value.
The value.
Updates the fix method to the specified value.
The value.
Updates the precision as it relates to latitude and longitude.
The value.
Updates the precision as it relates to altitude.
The value.
Updates the precision as it relates to latitude, longitude and altitude.
The value.
Updates the fix status to the specified value.
The value.
Updates the difference between Magnetic North and True North.
The value.
Updates the current location on Earth's surface.
The value.
Updates the current direction of travel.
The value.
Updates the current direction of heading.
The value.
Updates the list of known GPS satellites.
The value.
Sets the fixed satellite count.
The value.
Updates the list of fixed GPS satellites.
The value.
Updates the current rate of travel.
The value.
Updates the distance between the ellipsoid surface and the current altitude.
The value.
Updates the current distance above sea level.
The value.
Updates the current distance above the ellipsoid surface.
The value.
Occurs when new data should be read from the underlying device.
Occurs when the interpreter is using a different device for raw data.
Releases the unmanaged resources used by the and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Parsings the thread proc.
Forces the current device to a closed state without disposing the underlying stream.
Determines if automatic reconnection is currently allowed, based on the values of
, , and .
If reconnection is allowed, then is incremented after a short delay.
True if another reconnection attempt should be made; otherwise, .
Occurs when the current distance above sea level has changed.
Occurs when a new altitude report has been received, even if the value has not changed.
Occurs when the current distance above the ellipsoid has changed.
Occurs when a new altitude-above-ellipsoid report has been received, even if the value has not changed.
Occurs when the current direction of travel has changed.
Occurs when the current direction of heading has changed.
Occurs when a new bearing report has been received, even if the value has not changed.
Occurs when a new heading report has been received, even if the value has not changed.
Occurs when the fix quality has changed.
Occurs when the fix mode has changed.
Occurs when the fix method has changed.
Occurs when the geodal separation changes
Occurs when the GPS-derived date and time has changed.
Occurs when the GPS-derived local time has changed.
Occurs when at least three GPS satellite signals are available to calculate the current location.
Occurs when less than three GPS satellite signals are available.
Occurs when the current location on Earth has changed.
Occurs when a new position report has been received, even if the value has not changed.
Occurs when the magnetic variation for the current location becomes known.
Occurs when the current rate of travel has changed.
Occurs when a new speed report has been received, even if the value has not changed.
Occurs when precision as it relates to latitude and longitude has changed.
Occurs when precision as it relates to altitude has changed.
Occurs when precision as it relates to latitude, longitude and altitude has changed.
Occurs when GPS satellite information has changed.
Occurs when the interpreter is about to start.
Occurs when the interpreter is now processing GPS data.
Occurs when the interpreter is about to stop.
Occurs when the interpreter has stopped processing GPS data.
Occurs when the interpreter has temporarily stopped processing GPS data.
Occurs when the interpreter is no longer paused.
Occurs when an exception has happened during processing.
Occurs when the flow of GPS data has been suddenly interrupted.
Controls the amount of time to wait for the next packet of GPS data to arrive.
The read timeout.
Controls the amount of time allowed to perform a start, stop, pause or resume action.
The command timeout.
The Interpreter class is multithreaded and is also thread-safe. Still, however, in some rare cases,
two threads may attempt to change the state of the interpreter at the same time. Critical sections will allow both threads to
succees whenever possible, but in the event of a deadlock, this property control how much time to allow before giving up.
Returns the device providing raw GPS data to the interpreter.
Controls the priority of the thread which processes GPS data.
The thread priority.
Returns the GPS-derived date and time, adjusted to the local time zone.
Returns the GPS-derived date and time in UTC (GMT-0).
Returns the current estimated precision as it relates to latitude and longitude.
Horizontal Dilution of Precision (HDOP) is the accumulated
error of latitude and longitude coordinates in X and Y directions
(displacement on the surface of the ellipsoid).
Returns the current estimated precision as it relates to altitude.
Vertical Dilution of Precision (VDOP) is the accumulated
error of latitude and longitude coordinates in the Z direction (measurement
from the center of the ellipsoid).
Returns the kind of fix acquired by the GPS device.
Returns the number of satellites being used to calculate the current location.
Returns the quality of the fix and what kinds of technologies are involved.
Controls whether GPS data is ignored until a fix is acquired.
true if this instance is fix required; otherwise, false.
Returns whether a fix is currently acquired by the GPS device.
Returns the difference between magnetic North and True North.
Returns the current location on Earth's surface.
Gets a value indicating whether this instance is running.
true if this instance is running; otherwise, false.
Returns the avereage precision tolerance based on the fix quality reported
by the device.
This property returns the estimated error attributed to the device. To get
a total error estimation, add the Horizontal or the Mean DOP to the
FixPrecisionEstimate.
Returns the current rate of travel.
Returns the current distance above sea level.
Gets the current direction of travel as an Azimuth
Controls the largest amount of precision error allowed before GPS data is ignored.
The maximum horizontal dilution of precision.
This property is important for commercial GPS softwaqre development because it helps the interpreter determine
when GPS data reports are precise enough to utilize. Live GPS data can be inaccurate by up to a factor of fifty, or nearly
the size of an American football field! As a result, setting a vlue for this property can help to reduce precision errors.
When set, reports of latitude, longitude, speed, and bearing are ignored if precision is not at or below the set value.
For more on Dilution of Precision and how to determine your precision needs, please refer to our online article here:
http://dotspatial.codeplex.com/Articles/WritingApps2_1.aspx.
Controls the maximum number of consecutive reconnection retries allowed.
The maximum reconnection attempts.
Controls the largest amount of precision error allowed before GPS data is ignored.
The maximum vertical dilution of precision.
This property is important for commercial GPS softwaqre development because it helps the interpreter determine
when GPS data reports are precise enough to utilize. Live GPS data can be inaccurate by up to a factor of fifty, or nearly
the size of an American football field! As a result, setting a vlue for this property can help to reduce precision errors.
When set, reports of altitude are ignored if precision is not at or below the set value.
For more on Dilution of Precision and how to determine your precision needs, please refer to our online article here:
http://dotspatial.codeplex.com/Articles/WritingApps2_1.aspx.
Controls whether real-time GPS data is made more precise using a filter.
true if this instance is filter enabled; otherwise, false.
Controls the technology used to reduce GPS precision error.
The filter.
Controls whether the interpreter will try to automatically attempt to reconnect anytime a connection is lost.
true if [allow automatic reconnection]; otherwise, false.
Interpreters are able to automatically try to recover from connection failures. When this property is set to True,
the interpreter will detect a sudden loss of connection, then attempt to make a new connection to restore the flow of data. If multiple GPS
devices have been detected, any of them may be utilized as a "fail-over device." Recovery attempts will continue repeatedly until a connection
is restored, the interpreter is stopped, or the interpreter is disposed.
For most applications, this property should be enabled to help improve the stability of the application. In most cases, a sudden loss of
data is only temporary, caused by a loss of battery power or when a wireless device moves too far out of range.
Returns a list of known GPS satellites.
Returns whether resources in this object has been shut down.
Returns the stream used to output data received from the GPS device.
Represents the state of a KalmanFilter
Initializes a new instance of the struct.
The GPS position.
The device error.
The mean DOP.
The ellipsoid.
Initializes a new instance of the struct.
The GPS position.
The device error.
The horizontal DOP.
The vertical DOP.
The ellipsoid.
Initializes a new instance of the struct.
The GPS position.
The device error.
The horizontal DOP.
The vertical DOP.
The ellipsoid.
The u.
The x.
The z.
A.
The b.
The h.
The p.
The q.
The r.
The position reported by the GPS device
The corrected position
Initializes the state to the supplied observation.
The z.
Updates the state.
The current DOP.
The z.
Updates the state.
The device error.
The horizontal DOP.
The vertical DOP.
The bearing.
The speed.
The z.
Gets the delay.
Gets the current error.
Gets the state of the error.
Gets the device error.
Gets the horizontal dilution of precision.
Gets the vertical dilution of precision.
Determines if the Kalman state has an initial observation
Returns the number of intervals that have been applied to the Kalman state
The number of intervals is the number of observations accumulated in the state
interval. The greater the number of observations, the more precise the filter
becomes.
A class that employs a Kalman Filter algorithm to reduce error in GPS
precision.
Kalman Filter
Kalman Filter with parameters
The initial observation.
The device error.
The horizontal DOP.
The vertical DOP.
The ellipsoid.
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
The results of a Kalman filter are cumulative. Each
position processed changes the state of the filter, thus making
the results more accurate with each subsequent position.
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
Distance of the error
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
The mean dilution of precision
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
Distance of the error
The mean dilution of precision
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
Distance of the error
The mean dilution of precision
The ellipsoid
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
Distance of the error
The horizontal dilution of precision
The vertical dilution of precision
The ellipsoid
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
The results of a Kalman filter are cumulative. Each
position processed changes the state of the filter, thus making
the results more accurate with each subsequent position.
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
A distance measure of device error
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
The mean dilution of precision
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
A distance measure of device error
The mean dilution of precision
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
A distance measure of device error
The mean dilution of precision
The ellipsoid
Initializes the Kalman Filter using an initial observation (position)
The position at which tfilter is to begin opperating.
A distance measure of device error
The horizontal dilution of precision
The vertical dilution of precision
The ellipsoid
Filter the Position
The GPS position.
Returns the position
The gps Position
The current dilution of precision
A Position sturcture
Returns the position
The gps Position
The current dilution of precision
the directional azimuth
the magnitude of the velocity
A Position sturcture
Return filtered position from specified parameters
The GPS position.
The device error.
The horizontal DOP.
The vertical DOP.
The bearing.
The speed.
Returns the 3D position
The gps Position
A Position3D sturcture
Returns the 3D position
The gps Position
The current dilution of precision
A Position3D sturcture
Returns the 3D position
The gps Position
The current dilution of precision
the directional azimuth
the magnitude of the velocity
A Position3D sturcture
Return a filtered Position3D from the specified parameters
The GPS position.
The device error.
The horizontal DOP.
The vertical DOP.
The bearing.
The speed.
The filtered location
The observed location
Represents the latency between the current obervation and the filter state
Returns a value indicationg whether or not the filter has been initialized.
Returns the DilutionOfPrecision used in the most recent
Kalman filter calculation.
Returns the device error margin used in the most recent
Kalman filter calculation.
Retrns the of position samples that have been evaluated by
the current Kalman state.
The results of a Kalman filter are cumulative. Each
position processed changes the state of the filter, thus making
the results more accurate with each subsequent position.
Returns the accumulated average error accounted for the Kalman system.
The results of a Kalman filter are cumulative. Each
position processed changes the state of the filter, thus making
the results more accurate with each subsequent position.
Returns the current precision estimate for the Kalman state
The results of a Kalman filter are cumulative. Each
position processed changes the state of the filter, thus making
the results more accurate with each subsequent position.
An internal class for hosting windows members.
Device Connected
Device Remembered
Device Authenticated
The namespace of Bluetooth, used by the WSAQUERYSET structure
The error code for success
Closes an open object handle.
A valid handle to an open object.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.
A handle to the device on which the operation is to be performed. The device is typically a volume,
directory, file, or stream. To retrieve a device handle, use the CreateFile function. For more information, see Remarks.
The control code for the operation. This value identifies the specific operation to be
performed and the type of device on which to perform it. For a list of the control codes, see Remarks.
The documentation for each control code provides usage details for the lpInBuffer, nInBufferSize, lpOutBuffer,
and nOutBufferSize parameters.
A pointer to the input buffer that contains the data required to perform the operation. The format of this data depends on the value of the dwIoControlCode parameter.
This parameter can be NULL if dwIoControlCode specifies an operation that does not require input data.
The size of the input buffer, in bytes.
A pointer to the output buffer that is to receive the data returned by the operation. The format of this data
depends on the value of the dwIoControlCode parameter.
This parameter can be NULL if dwIoControlCode specifies an operation that does not return data.
The size of the output buffer, in bytes.
The number of bytes returned in the out buffer.
A pointer to a callback for async commands.
If the operation completes successfully, the return value is nonzero.
If the operation fails or is pending, the return value is zero. To get extended error information, call GetLastError.
Creates or opens a file or I/O device. The most commonly used I/O devices are as follows: file, file stream,
directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, and pipe.
The function returns a handle that can be used to access the file or device for various types of I/O depending
on the file or device and the flags and attributes specified.
To perform this operation as a transacted operation, which results in a handle that can be used for transacted
I/O, use the CreateFileTransacted function.
The name of the file or device to be created or opened.
The requested access to the file or device, which can be summarized as read, write, both or neither zero).
The requested sharing mode of the file or device, which can be read, write, both,
delete, all of these, or none (refer to the following table). Access requests to attributes or extended
attributes are not affected by this flag.
A pointer to a SECURITY_ATTRIBUTES structure that contains two separate but related data members:
an optional security descriptor, and a Boolean value that determines whether the returned handle can be
inherited by child processes.
An action to take on a file or device that exists or does not exist.
The file or device attributes and flags, FILE_ATTRIBUTE_NORMAL being the most common default value for files.
A valid handle to a template file with the GENERIC_READ access right. The template file supplies file attributes and extended attributes for the file that is being created.
A handle to the device.
Reads data from the specified file or input/output (I/O) device. Reads occur at the position
specified by the file pointer if supported by the device.
A handle to the device (for example, a file, file stream, physical disk, volume, console buffer,
tape drive, socket, communications resource, mailslot, or pipe).
A pointer to the buffer that receives the data read from a file or device.
The maximum number of bytes to be read.
A pointer to the variable that receives the number of bytes read when using
a synchronous hFile parameter. ReadFile sets this value to zero before doing any work or error checking.
Use NULL for this parameter if this is an asynchronous operation to avoid potentially erroneous results.
A pointer to an OVERLAPPED structure is required if the hFile parameter was opened
with FILE_FLAG_OVERLAPPED, otherwise it can be NULL.
If the function succeeds, the return value is nonzero (TRUE).
Writes data to the specified file or input/output (I/O) device.
This function is designed for both synchronous and asynchronous operation. For a similar function
designed solely for asynchronous operation, see WriteFileEx.
A handle to the file or I/O device (for example, a file, file stream, physical disk, volume,
console buffer, tape drive, socket, communications resource, mailslot, or pipe).
A pointer to the buffer containing the data to be written to the file or device.
The number of bytes to be written to the file or device.
A pointer to the variable that receives the number of bytes written when using
a synchronous hFile parameter. WriteFile sets this value to zero before doing any work or error checking.
Use NULL for this parameter if this is an asynchronous operation to avoid potentially erroneous results.
A pointer to an OVERLAPPED structure is required if the hFile parameter was opened
with FILE_FLAG_OVERLAPPED, otherwise this parameter can be NULL.
If the function succeeds, the return value is nonzero (TRUE).
Sets the current local time and date.
A pointer to a SYSTEMTIME structure that contains the new local date and time.
If the function succeeds, the return value is nonzero.
Sets the current system time and date. The system time is expressed in Coordinated Universal Time (UTC).
A pointer to a SYSTEMTIME structure that contains the new system date and time.
If the function succeeds, the return value is nonzero.
The SetupDiClassGuidsFromName function retrieves the GUID(s) associated with the specified class name.
This list is built based on the classes currently installed on the system.
Supplies the name of the class for which to retrieve the class GUID.
Supplies a pointer to an array to receive the list of GUIDs associated with the specified class name.
Supplies the number of GUIDs in the ClassGuidList array.
Supplies a pointer to a variable that receives the number of GUIDs associated with the class name.
If this number is greater than the size of the ClassGuidList buffer, the number indicates how large
the array must be in order to store all the GUIDs.
The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged
error can be retrieved with a call to GetLastError.
The CM_Get_Parent function obtains a device instance handle to the parent node of a
specified device node (devnode) in the local machine's device tree.
Caller-supplied pointer to the device instance handle to the
parent node that this function retrieves. The retrieved handle is bound to the local machine.
Caller-supplied device instance handle that is bound to the local machine.
Not used, must be zero.
If the operation succeeds, the function returns CR_SUCCESS. Otherwise, it returns one of the
CR_-prefixed error codes defined in Cfgmgr32.h.
For information about using a device instance handle that is bound to the local machine, see CM_Get_Child.
The CM_Get_Device_ID function retrieves the device instance ID for a specified device instance on the local machine.
Caller-supplied device instance handle that is bound to the local machine.
Address of a buffer to receive a device instance ID string. The required buffer size
can be obtained by calling CM_Get_Device_ID_Size, then incrementing the received value to allow room for
the string's terminating NULL.
Caller-supplied length, in characters, of the buffer specified by Buffer.
Not used, must be zero.
If the operation succeeds, the function returns CR_SUCCESS. Otherwise, it returns one of the CR_-prefixed error codes defined in Cfgmgr32.h.
The function appends a NULL terminator to the supplied device instance ID string, unless the buffer is too
small to hold the string. In this case, the function supplies as much of the identifier string as will fit
into the buffer, and then returns CR_BUFFER_SMALL.
For information about device instance IDs, see Device Identification Strings.
For information about using device instance handles that are bound to the local machine, see CM_Get_Child.
The SetupDiDestroyDeviceInfoList function deletes a device information set and frees all associated memory.
A handle to the device information set to delete.
The function returns TRUE if it is successful. Otherwise, it returns FALSE and the
logged error can be retrieved with a call to GetLastError.
The SetupDiGetClassDevs function returns a handle to a device information set that contains requested
device information elements for a local computer.
A pointer to the GUID for a device setup class or a device interface class.
This pointer is optional and can be NULL. For more information about how to set ClassGuid, see the
following Remarks section.
A pointer to a NULL-terminated string that specifies:
* An identifier (ID) of a Plug and Play (PnP) enumerator. This ID can either be the value's globally
unique identifier (GUID) or symbolic name. For example, "PCI" can be used to specify the PCI PnP value.
Other examples of symbolic names for PnP values include "USB," "PCMCIA," and "SCSI".
* A PnP device instance ID. When specifying a PnP device instance ID, DIGCF_DEVICEINTERFACE must be set
in the Flags parameter.
This pointer is optional and can be NULL. If an enumeration value is not used to select devices,
set Enumerator to NULL
For more information about how to set the Enumerator value, see the following Remarks section.
A handle to the top-level window to be used for a user interface that is
associated with installing a device instance in the device information set. This handle is optional
and can be NULL.
A variable of type DWORD that specifies control options that filter the device information
elements that are added to the device information set. This parameter can be a bitwise OR of zero
or more of the following flags. For more information about combining these flags, see the following
Remarks section.
DIGCF_ALLCLASSES
Return a list of installed devices for all device setup classes or all device interface classes.
DIGCF_DEVICEINTERFACE
Return devices that support device interfaces for the specified device interface classes.
This flag must be set in the Flags parameter if the Enumerator parameter specifies a device instance ID.
DIGCF_DEFAULT
Return only the device that is associated with the system default device interface, if one is set,
for the specified device interface classes.
DIGCF_PRESENT
Return only devices that are currently present in a system.
DIGCF_PROFILE
Return only devices that are a part of the current hardware profile.
If the operation succeeds, SetupDiGetClassDevs returns a handle to a device information set that contains
all installed devices that matched the supplied parameters. If the operation fails, the function returns
INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
The SetupDiEnumDeviceInfo function returns a SP_DEVINFO_DATA structure that specifies a device
information element in a device information set.
A handle to the device information set for which to return an SP_DEVINFO_DATA
structure that represents a device information element.
A zero-based index of the device information element to retrieve.
A pointer to an SP_DEVINFO_DATA structure to receive information about an enumerated device information
element. The caller must set DeviceInfoData.cbSize to sizeof(SP_DEVINFO_DATA).
The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error
can be retrieved with a call to GetLastError.
Repeated calls to this function return a device information element for a different device. This function
can be called repeatedly to get information about all devices in the device information set.
To enumerate device information elements, an installer should initially call SetupDiEnumDeviceInfo with
the MemberIndex parameter set to 0. The installer should then increment MemberIndex and call
SetupDiEnumDeviceInfo until there are no more values (the function fails and a call to GetLastError
returns ERROR_NO_MORE_ITEMS).
Call SetupDiEnumDeviceInterfaces to get a context structure for a device interface element (versus a device information element).
The SetupDiEnumDeviceInterfaces function enumerates the device interfaces that are contained in a device information set.
A pointer to a device information set that contains the device interfaces for which to return information.
This handle is typically returned by SetupDiGetClassDevs.
A pointer to an SP_DEVINFO_DATA structure that specifies a device information element in DeviceInfoSet.
This parameter is optional and can be NULL. If this parameter is specified, SetupDiEnumDeviceInterfaces
constrains the enumeration to the interfaces that are supported by the specified device. If this parameter
is NULL, repeated calls to SetupDiEnumDeviceInterfaces return information about the interfaces that are
associated with all the device information elements in DeviceInfoSet. This pointer is typically returned
by SetupDiEnumDeviceInfo.
A pointer to a GUID that specifies the device interface class for the requested interface.
A zero-based index into the list of interfaces in the device information set. The caller should call
this function first with MemberIndex set to zero to obtain the first interface. Then, repeatedly increment
MemberIndex and retrieve an interface until this function fails and GetLastError returns ERROR_NO_MORE_ITEMS.
If DeviceInfoData specifies a particular device, the MemberIndex is relative to only the interfaces exposed
by that device.
A pointer to a caller-allocated buffer that contains, on successful return, a completed SP_DEVICE_INTERFACE_DATA
structure that identifies an interface that meets the search parameters. The caller must set DeviceInterfaceData.cbSize
to sizeof(SP_DEVICE_INTERFACE_DATA) before calling this function.
SetupDiEnumDeviceInterfaces returns TRUE if the function completed without error. If the function completed
with an error, FALSE is returned and the error code for the failure can be retrieved by calling GetLastError.
Repeated calls to this function return an SP_DEVICE_INTERFACE_DATA structure for a different device interface.
This function can be called repeatedly to get information about interfaces in a device information set that
are associated with a particular device information element or that are associated with all device information
elements.
DeviceInterfaceData points to a structure that identifies a requested device interface. To get detailed
information about an interface, call SetupDiGetDeviceInterfaceDetail. The detailed information includes
the name of the device interface that can be passed to a Win32 function such as CreateFile
(described in Microsoft Windows SDK documentation) to get a handle to the interface.
The SetupDiGetDeviceInterfaceDetail function returns details about a device interface.
A pointer to the device information set that contains the interface
for which to retrieve details. This handle is typically returned by SetupDiGetClassDevs.
A pointer to an SP_DEVICE_INTERFACE_DATA structure that specifies
the interface in DeviceInfoSet for which to retrieve details. A pointer of this type is typically
returned by SetupDiEnumDeviceInterfaces.
A pointer to an SP_DEVICE_INTERFACE_DETAIL_DATA structure to receive information about the specified
interface. This parameter is optional and can be NULL. This parameter must be NULL if
DeviceInterfaceDetailSize is zero. If this parameter is specified, the caller must set
DeviceInterfaceDetailData.cbSize to sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) before calling this function.
The cbSize member always contains the size of the fixed part of the data structure, not a size reflecting
the variable-length string at the end.
The size of the DeviceInterfaceDetailData buffer. The buffer must be at least
(offsetof(SP_DEVICE_INTERFACE_DETAIL_DATA, DevicePath) + sizeof(TCHAR)) bytes, to contain the fixed part
of the structure and a single NULL to terminate an empty MULTI_SZ string.
This parameter must be zero if DeviceInterfaceDetailData is NULL.
A pointer to a variable of type DWORD that receives the required size of the DeviceInterfaceDetailData buffer.
This size includes the size of the fixed part of the structure plus the number of bytes required for the
variable-length device path string. This parameter is optional and can be NULL.
A pointer to a buffer that receives information about the device that supports the requested interface.
The caller must set DeviceInfoData.cbSize to sizeof(SP_DEVINFO_DATA). This parameter is optional and can
be NULL.
SetupDiGetDeviceInterfaceDetail returns TRUE if the function completed without error. If the function
completed with an error, FALSE is returned and the error code for the failure can be retrieved by calling
GetLastError.
The BluetoothGetDeviceInfo function retrieves information about a remote Bluetooth device.
The Bluetooth device must have been previously identified through a successful device inquiry function call.
A handle to a local radio, obtained from a call to the BluetoothFindFirstRadio or similar functions,
or from a call to the SetupDiEnumerateDeviceInterfaces function.
A pointer to a BLUETOOTH_DEVICE_INFO structure into which data about the first Bluetooth device will be placed.
For more information, see Remarks.
Returns ERROR_SUCCESS upon success, indicating that data about the remote Bluetooth device was retrieved.
Returns error codes upon failure. The following table lists common error codes associated with the
BluetoothGetDeviceInfo function.
The BluetoothGetRadioInfo function obtains information about a Bluetooth radio.
A handle to a local Bluetooth radio, obtained by calling the
BluetoothFindFirstRadio or similar functions, or the SetupDiEnumerateDeviceInterfances function.
A pointer to a BLUETOOTH_RADIO_INFO structure into which information about the radio
will be placed. The dwSize member of the BLUETOOTH_RADIO_INFO structure must match the size of the structure.
The following table lists common return values.
ERROR_SUCCESS - The radio information was retrieved successfully.
ERROR_INVALID_PARAMETER - The hRadio or pRadioInfo parameter is NULL.
ERROR_REVISION_MISMATCH - The dwSize member of the BLUETOOTH_RADIO_INFO structure pointed to by pRadioInfo is not valid.
The BluetoothFindFirstRadio function begins the enumeration of local Bluetooth radios.
Pointer to a BLUETOOTH_FIND_RADIO_PARAMS structure. The dwSize member of the BLUETOOTH_FIND_RADIO_PARAMS
structure pointed to by pbtfrp must match the size of the structure. See Return Values for additional
information about this parameter.
Pointer to where the first enumerated radio handle will be returned. When no longer needed, this handle
must be closed via CloseHandle.
In addition to the handle indicated by phRadio, calling this function will also create a
HBLUETOOTH_RADIO_FIND handle for use with the BluetoothFindNextRadio function. When this handle
is no longer needed, it must be closed via the BluetoothFindRadioClose.
The BluetoothFindRadioClose function closes the enumeration handle associated with finding Bluetooth radios.
Enumeration handle to close, obtained with a previous call to the BluetoothFindFirstRadio function.
Returns TRUE when the handle is successfully closed. Returns FALSE if the attempt fails to close the
enumeration handle. For additional information on possible errors associated with closing the handle,
call the GetLastError function.
The BluetoothIsConnectable function determines whether a Bluetooth radio or radios is connectable.
Valid local radio handle, or NULL. If NULL, all local radios are checked for
connectability; if any radio is connectable, the function call succeeds.
Returns TRUE if at least one Bluetooth radio is accepting incoming connections.
Returns FALSE if no radios are accepting incoming connections.
If multiple Bluetooth radios exist, the first radio to return that it is connectable causes the
BluetoothIsConnectable function to succeed.
The BluetoothIsDiscoverable function determines whether a Bluetooth radio or radios is discoverable.
Valid local radio handle, or NULL. If NULL, discovery is determined for all local radios;
if any radio is discoverable, the function call succeeds.
Returns TRUE if at least one Bluetooth radio is discoverable. Returns FALSE if no Bluetooth radios are discoverable.
The BluetoothEnableDiscovery function changes the discovery state of a local Bluetooth radio or radios.
Valid local radio handle, or NULL. If NULL, discovery is modified on all local radios;
if any radio is modified by the call, the function call succeeds.
Flag specifying whether discovery is to be enabled or disabled. Set to TRUE to enable discovery,
set to FALSE to disable discovery.
Returns TRUE if the discovery state was successfully changed. If hRadio is NULL, a return value of
TRUE indicates that at least one local radio state was successfully changed. Returns FALSE if discovery
state was not changed; if hRadio was NULL, no radio accepted the state change.
Use the BluetoothIsDiscoverable function to determine the current state of a Bluetooth radio. Windows ensures that a discoverable system is connectable, and as such, the radio must allow incoming connections prior to making a radio discoverable. Failure to allow incoming connections results in the BluetoothEnableDiscovery function call failing.
When BluetoothEnableDiscovery changes the discovery state, the new state is valid for the lifetime of the
calling application. Additionally, if a Bluetooth radio previously made discoverable with this function
is disabled and re-enabled via the application, discoverability will not persist. Once the calling application
terminates, the discovery state of the specified Bluetooth radio reverts to the state it was in before
BluetoothEnableDiscovery was called.
The BluetoothEnableIncomingConnections function modifies whether a local Bluetooth radio accepts incoming connections.
Valid local radio handle for which to change whether incoming connections are enabled, or NULL. If NULL,
the attempt to modify incoming connection acceptance iterates through all local radios; if any radio is
modified by the call, the function call succeeds.
Flag specifying whether incoming connection acceptance is to be enabled or disabled. Set to TRUE to
enable incoming connections, set to FALSE to disable incoming connections.
Returns TRUE if the incoming connection state was successfully changed. If hRadio is NULL, a return
value of TRUE indicates that at least one local radio state was successfully changed. Returns FALSE
if incoming connection state was not changed; if hRadio was NULL, no radio accepted the state change.
A radio that is non-connectable is non-discoverable. The radio must be made non-discoverable prior
to making a radio non-connectable. Failure to make a radio non-discoverable prior to making it
non-connectable will result in failure of the BluetoothEnableIncomingConnections function call.
The WSAStartup function initiates use of the Winsock DLL by a process.
The highest version of Windows Sockets specification that the caller can use.
The high-order byte specifies the minor version number; the low-order byte specifies the major version number.
A pointer to the WSADATA data structure that is to receive details of the Windows Sockets implementation.
If successful, the WSAStartup function returns zero. Otherwise, it returns one of the error codes listed below.
WSASYSNOTREADY - The underlying network subsystem is not ready for network communication.
WSAVERNOTSUPPORTED - The version of Windows Sockets support requested is not provided by this particular Windows Sockets implementation.
WSAEINPROGRESS - A blocking Windows Sockets 1.1 operation is in progress.
WSAEPROCLIM - A limit on the number of tasks supported by the Windows Sockets implementation has been reached.
WSAEFAULT - The lpWSAData parameter is not a valid pointer.
The WSACleanup function terminates use of the Winsock 2 DLL (Ws2_32.dll).
The return value is zero if the operation was successful.
Otherwise, the value SOCKET_ERROR is returned, and a specific error number
can be retrieved by calling WSAGetLastError.
The WSALookupServiceBegin function initiates a client query that is constrained by the
information contained within a WSAQUERYSET structure. WSALookupServiceBegin only returns a
handle, which should be used by subsequent calls to WSALookupServiceNext to get the actual results.
Pointer to the search criteria. See the following for details.
Flag that controls the depth of the search.
Handle to be used when calling WSALookupServiceNext in order to start retrieving the results set.
The return value is zero if the operation was successful. Otherwise, the value SOCKET_ERROR is returned,
and a specific error number can be retrieved by calling WSAGetLastError.
The WSALookupServiceNext function is called after obtaining a handle from a previous call to
WSALookupServiceBegin in order to retrieve the requested service information.
The provider will pass back a WSAQUERYSET structure in the lpqsResults buffer. The client should
continue to call this function until it returns WSA_E_NO_MORE, indicating that all of WSAQUERYSET
has been returned.
Handle returned from the previous call to WSALookupServiceBegin.
Flags to control the next operation. Currently, only LUP_FLUSHPREVIOUS is defined as a means to cope
with a result set that is too large. If an application does not (or cannot) supply a large enough buffer,
setting LUP_FLUSHPREVIOUS instructs the provider to discard the last result set—which was too large—and
move on to the next set for this call.
On input, the number of bytes contained in the buffer pointed to by lpqsResults.
On output, if the function fails and the error is WSAEFAULT, then it contains the minimum number
of bytes to pass for the lpqsResults to retrieve the record.
Pointer to a block of memory, which will contain one result set in a WSAQUERYSET structure on return.
The return value is zero if the operation was successful. Otherwise, the value SOCKET_ERROR is returned,
and a specific error number can be retrieved by calling WSAGetLastError.
The WSALookupServiceEnd function is called to free the handle after previous calls to WSALookupServiceBegin and WSALookupServiceNext.
If you call WSALookupServiceEnd from another thread while an existing WSALookupServiceNext is blocked, the end call will have the same effect as a cancel and will cause the WSALookupServiceNext call to return immediately.
Handle previously obtained by calling WSALookupServiceBegin.
The return value is zero if the operation was successful. Otherwise, the value SOCKET_ERROR is returned,
and a specific error number can be retrieved by calling WSAGetLastError.
Size of the block of data pointed to by pBlobData, in bytes. cbSize.
Pointer to a block of data. pInfo.
Flags
The blue tooth address.
The unsigned integer representing the class of the device.
The binary representation of the name.
Converts the object into a BluetoothDevice object.
Returns the address of the device.
Returns the friendly nameof the device.
Bluetooth device status states that can be combined.
The bluetooth address is present.
The class of the device is present.
The name of the device is present.
Whether or not the device is paired.
The bluetooth device is remembered.
The bluetooth device is connected.
Size of the BLUETOOTH_FIND_RADIO_PARAMS structure, in bytes. dwSize.
Size of the BluetoothDeviceInfo structure, in bytes. dwSize.
Address of the device.
Class of the device. ulClassofDevice.
Specifies whether the device is connected. fConnected.
Specifies whether the device is a remembered device. Not all remembered devices are authenticated. fRemembered.
Specifies whether the device is authenticated, paired, or bonded. All authenticated devices are remembered. fAuthenticated.
Last time the device was seen, in the form of a SYSTEMTIME structure. stLastSeen.
Last time the device was used, in the form of a SYSTEMTIME structure. stLastUsed.
Name of the device. szName.
Initializes a new instance of the struct.
The address.
Size, in bytes, of the structure. dwSize.
Address of the local Bluetooth radio.
Name of the local Bluetooth radio. szName.
Device class for the local Bluetooth radio. ClassofDevice.
This member contains data specific to individual Bluetooth device manufacturers. lmpSubversion.
Manufacturer of the Bluetooth radio, expressed as a BTH_MFG_Xxx value. For more
information about the Bluetooth assigned numbers document and a current list of values,
see the Bluetooth specification at www.bluetooth.com.
The BTH_QUERY_DEVICE structure is used when querying for the presence of a Bluetooth device.
Reserved. Must be set to zero.
Requested length of the inquiry, in seconds.
Initializes a new instance of the BthQueryDevice structure.
Specifies a date and time, using individual members for the month, day, year, weekday, hour, minute, second,
and millisecond. The time is either in coordinated universal time (UTC) or local time, depending on the
function that is being called.
The year. The valid values for this member are 1601 through 30827. wYear.
The month. (January = 1).
The day of the week. (Sunday = 0)
The day of the month. The valid values for this member are 1 through 31.
The hour. The valid values for this member are 0 through 23.
The minute. The valid values for this member are 0 through 59.
The second. The valid values for this member are 0 through 59.
The millisecond. The valid values for this member are 0 through 999.
Creates a .Net DateTime structure from the SystemTime structure.
Creates a SystemTime structure based on the specified DateTime structure.
The DateTime value to set.
The SystemTime equivalent to the specified value.
The WSADATA structure contains information about the Windows Sockets implementation.
The version of the Windows Sockets specification that the Ws2_32.dll expects the caller to use.
The high-order byte specifies the minor version number; the low-order byte specifies the major version number.
wVersion.
The highest version of the Windows Sockets specification that the Ws2_32.dll can support. The high-order byte
specifies the minor version number; the low-order byte specifies the major version number.
This is the same value as the wVersion member when the version requested in the wVersionRequested parameter
passed to the WSAStartup function is the highest version of the Windows Sockets specification that the Ws2_32.dll
can support. wHighVersion.
A NULL-terminated ASCII string into which the Ws2_32.dll copies a description of the Windows Sockets implementation.
The text (up to 256 characters in length) can contain any characters except control and formatting characters.
The most likely use that an application would have for this member is to display it (possibly truncated) in a status
message. szDescription.
A NULL-terminated ASCII string into which the Ws2_32.dll copies relevant status or configuration information.
The Ws2_32.dll should use this parameter only if the information might be useful to the user or support staff.
This member should not be considered as an extension of the szDescription parameter. szSystemStatus.
The maximum number of sockets that may be opened. This member should be ignored for Windows Sockets version 2 and later.
The iMaxSockets member is retained for compatibility with Windows Sockets specification 1.1, but should not be used when
developing new applications. No single value can be appropriate for all underlying service providers. The architecture
of Windows Sockets changed in version 2 to support multiple providers, and the WSADATA structure no longer applies to
a single vendor's stack. iMaxSockets.
The maximum datagram message size. This member is ignored for Windows Sockets version 2 and later. iMaxUdpDg.
A pointer to vendor-specific information. This member should be ignored for Windows Sockets version 2 and later.
lpVendorInfo
WAS Lookup Control Options
None of the return options are active.
Returns containers only. LUP_CONTAINERS.
Retrieves the name as lpszServiceInstanceName. LUP_RETURN_NAME.
Retrieves the type as lpServiceClassId. LUP_RETURN_TYPE.
Retrieves the version as lpVersion. LUP_RETURN_VERSION.
Retrieves the comment as lpszComment. LUP_RETURN_COMMENT.
Retrieves the addresses as lpcsaBuffer. LUP_RETURN_ADDR.
Retrieves the private data as lpBlob. LUP_RETURN_BLOB.
If the provider has been caching information, ignores the cache, and queries the namespace itself. LUP_FLUSHCACHE.
This indicates whether prime response is in the remote or local part of CSADDR_INFO structure.
The other part needs to be usable in either case. LUP_RES_SERVICE.
Must be set to sizeof(WSAQUERYSET) in bytes. This is a versioning mechanism. dwSize.
(Optional) Referenced string contains service name. The semantics for using wildcards
within the string are not defined, but can be supported by certain name space providers.
lpszServiceInstanceName.
(Required) The GUID corresponding to the service class.
lpServiceClassId.
(Optional) References desired version number and provides version comparison semantics
(that is, version must match exactly, or version must be not less than the value supplied).
lpVersion.
Ignored for queries. lpszComment.
Identifier of a single name space in which to constrain the search, or NS_ALL to include
all name spaces. dwNameSpace.
(Optional) References the GUID of a specific name-space provider, and limits the query to
this provider only. lpNSProviderId.
(Optional) Specifies the starting point of the query in a hierarchical name space.
lpszContext.
Size of the protocol constraint array, can be zero. dwNumberOfProtocols.
(Optional) References an array of AFPROTOCOLS structure. Only services that utilize
these protocols will be returned. lpafpProtocols.
(Optional)Some name spaces (such as Whois++) support enriched SQL-like queries that are
contained in a simple text string. This parameter is used to specify that string.
lpszQueryString.
Ignored for queries. dwNumberOfCsAddrs
Ignored for queries. lpcsaBuffer.
Ignored for queries. dwOutputFlags.
(Optional)This is a pointer to a provider-specific entity. lbBlob.
Instantiates a new instance of the Wsaqueryset Class.
An SP_DEVINFO_DATA structure defines a device instance that is a member of a device information set.
The size, in bytes, of the SP_DEVINFO_DATA structure. For more information, see the
following Remarks section. cbSize.
The GUID of the device's setup class.
An opaque handle to the device instance (also known as a handle to the devnode).
Some functions, such as SetupDiXxx functions, take the whole SP_DEVINFO_DATA structure
as input to identify a device in a device information set. Other functions, such as
CM_Xxx functions like CM_Get_DevNode_Status, take this DevInst handle as input.
DevInst.
Reserved. For internal use only.
An SP_DEVICE_INTERFACE_DATA structure defines a device interface in a device information set.
A SetupAPI function that takes an instance of the SP_DEVICE_INTERFACE_DATA structure as a parameter
verifies whether the cbSize member of the supplied structure is equal to the size, in bytes, of the
structure. If the cbSize member is not set correctly, the function will fail and set an error code
of ERROR_INVALID_USER_BUFFER.
The size, in bytes, of the SP_DEVICE_INTERFACE_DATA structure. For more information,
see the Remarks section. cbSize.
The GUID for the class to which the device interface belongs.
Can be one or more of the following:
SPINT_ACTIVE - The interface is active (enabled).
SPINT_DEFAULT - The interface is the default interface for the device class.
SPINT_REMOVED - The interface is removed.
Reserved. Do not use.
An SP_DEVICE_INTERFACE_DETAIL_DATA structure contains the path for a device interface.
An SP_DEVICE_INTERFACE_DETAIL_DATA structure identifies the path for a device interface in a
device information set. SetupDiXxx functions that take an SP_DEVICE_INTERFACE_DETAIL_DATA
structure as a parameter verify that the cbSize member of the supplied structure is equal
to the size, in bytes, of the structure. If the cbSize member is not set correctly for an
input parameter, the function will fail and set an error code of ERROR_INVALID_PARAMETER.
If the cbSize member is not set correctly for an output parameter, the function will fail
and set an error code of ERROR_INVALID_USER_BUFFER.
The size, in bytes, of the SP_DEVICE_INTERFACE_DETAIL_DATA structure.
For more information, see the following Remarks section. cbSize.
A NULL-terminated string that contains the device interface path. This path can be passed to Win32 functions such as CreateFile.
Emultor for MNEA devices
Creates a generic NMEA-0183 Emulator
Creates a generic NMEA-0183 Emulator from the specified string name
The name.
Randomizes the emulation by changing speed and direction
Randomize
The max HDOP.
The max VDOP.
Randomize
The min HDOP.
The max HDOP.
The min VDOP.
The max VDOP.
Randomize
The seed.
The speed low.
The speed high.
The bearing start.
The bearing arc.
The min HDOP.
The max HDOP.
The min VDOP.
The max VDOP.
Generates actual data to send to the client.
Data is sent according to the behavior of a typical GPS device: $GPGGA,
$GPGSA, $GPRMC, $GPGSV sentences are sent every second, and a $GPGSV sentence
is sent every five seconds.
Developers who want to emulate a specific model of GPS device should override this
method and generate the sentences specific to that device.
Emulates the position error.
The truth.
Emulates the error.
The dop.
Writes the sentence to client.
The sentence.
Sets the update intervals for the NMEA Emulator's sentence generation.
The interval.
Horizontal dilution of precision
The horizontal dilutiuon of precision.
Vertical dilution of precision
The vertical dilutiuon of precision.
Mean Dilution of Precision
The mean dilutiuon of precision.
Emulated Fix Mode
The emulated fix mode.
Emulated Fix Status
The emulated fix status.
Emulated Fix Method
The emulated fix method.
Emulated Fix Quality
The emulated fix quality.
Magnetic Variation
The magnetic variation.
Represents an interpreter for GPS data from the National Marine Electronics Association (NMEA).
Represents a synchronization object used to prevent changes to GPS data when reading multiple GPS values.
Creates an interpreter to read NMEA streams
Called when [sentence recorded].
The sentence.
Translates the NmeaSentence
The NMeaSentence to parse
Occurs when the interpreter is using a different device for raw data.
Occurs when new data should be read from the underlying device.
Occurs immediately after the interpreter has been shut down.
Occurs when a packet of data has been recorded to the recording stream.
Represents a reader which deserializes raw data into NMEA sentences.
Creates a new instance using the specified stream.
The stream.
Returns whether the specified stream contains valid NMEA data.
An open Stream object which supports read operations.
A Boolean value, True if valid NMEA data has been read from the stream.
Reads the next available sentence, valid or invalid, from the underlying stream.
Reads a well-formed NMEA sentence (with a valid checksum) from the underlying stream.
Reads a single NMEA sentence then attempts to convert it into an object-oriented form.
Reads the current latitude and longitude from the next available sentence.
Reads the UTC date and time from the next available sentence.
Returns the current date and time from the next available sentence.
Returns the current rate of travel from the next available sentence.
Reads the Bearing direction
The direction as an azimuth angle
Reads the Heading direction
The direction as an azimuth angle
Reads the current type of fix acquired from the next available sentence.
Reads the current distance above sea level from the next available sentence.
Reads the current precision as it relates to latitude and longitude from the next available sentence.
Occurs when an unknown sentence type is encountered.
Represents information about an unknown NMEA sentence which has been encountered.
Creates a new instance of the Nmea Sentence Resolver Event arguments class
The sentence.
Returns the NMEA sentence which needs to be resolved.
Controls a more-strongly-typed NMEA sentence if resolution is successful.
The result.
Represents information about raw data received from a GPS device.
This object is used primarily by the SentenceReceived
and UnrecognizedSentenceReceived events of
the Receiver class to provide notification when raw data has been received
from the GPS device.
This example demonstrates how to use this class when raising an event.
' Declare a new event
Dim MySentenceEvent As SentenceEventHandler
' Create an NMEA $GPGLL sentence
Dim MySentence As String = "$GPGLL, 4122, N, 14628, W, 104243.00, A, D*7E"
Sub Main()
' Raise our custom event, also indicating that the sentence was completely recognized
RaiseEvent MySentenceEvent(Me, New SentenceEventArgs(MySentence, SentenceType.Recognized))
End Sub
// Declare a new event
SentenceEventHandler MySentenceEvent;
// Create an NMEA $GPGLL sentence
string MySentence = "$GPGLL, 4122, N, 14628, W, 104243.00, A, D*7E"
void Main()
{
// Raise our custom event, also indicating that the sentence was completely recognized
MySentenceEvent(this, New SentenceEventArgs(MySentence, SentenceType.Recognized));
}
Creates a new instance with the specified block of raw GPS data and a flag indicating if the sentence was fully parsed.
A String containing raw GPS data.
Type Property
Sentence Property
Stores one line of raw GPS data.
A String containing one line of raw NMEA or Garmin® text data.
When using the NMEA-0183 or Garmin® text protocols, this property stores text for one individual line. For the Garmin® binary protocol, a signature such as "(Garmin waypoint data)" is stored instead of actual binary data.
Type Property
Represents a Garmin $PGRMF sentence.
Creates a Garmin $PGRMF sentence from the specified parameters
The sentence.
The command word.
The words.
The valid checksum.
Creates a Garmin $PGRMF sentence from the specified string
The sentence.
OnSentanceChanged event handler
Represents an NMEA sentence which contains date and time in UTC.
Represents an NMEA sentence which contains a position.
Gets the fix mode
The Fix Quality
The Speed
the Bearing
The Position Dilution of Precision (PDOP)
Position averaging filter
Creates an uninitialized filter with a sample count of 4
Creates an uninitialized filter with a sample count.
The sample count.
Creates an initialized filter.
The positions.
The sample count equals the number of positions passed in the positions argument.
Creates an initialzed filter
The positions.
The sample count.
If the number of positions supllied in the positions parameter and the sample
count parameter are not equal, the filter is uninitialized.
Filters this instance.
Initializes the filter
The initial sample positions.
This method updates the SampleCount property to the number of
initialization positions providedand updates the FilteredLocation
property.
Initializes the filter
The initial sample positions.
This method updates the SampleCount property to the number of
initialization positions provided and updates the FilteredLocation
property.
Adds an initialization position.
The initialization position to add.
This method does not update the SampleCount or the FilteredLocation
properties.
Adds an initialization position.
The initialization position to add.
This method does not update the SampleCount or the FilteredLocation
properties.
Adds a new observation and applies the filter.
The new observation to add to the filter.
The filtered position.
This method updates the FilteredLocation property without consideration for SampleCount.
Adds a new observation and applies the filter.
The new observation to add to the filter.
A DeviceError, which does not currently affect position averaging.
A horizontal dilution of position, which does not currently affect position averaging.
A vertical dilution of positoin which does not currently affect position averaging.
A directional bearing, which does not currently affect position averaging.
A speed, which does not currently affect position averaging.
This method updates the FilteredLocation property without consideration for SampleCount.
Adds a new observation and applies the filter.
The new observation to add to the filter.
The filtered position.
This method updates the FilteredLocation property without consideration for SampleCount.
Adds a new observation and applies the filter.
The new observation to add to the filter.
A DeviceError, which does not currently affect position averaging.
A horizontal dilution of position, which does not currently affect position averaging.
A vertical dilution of positoin which does not currently affect position averaging.
A directional bearing, which does not currently affect position averaging.
A speed, which does not currently affect position averaging.
This method updates the FilteredLocation property without consideration for SampleCount.
Gets the number of samples required for a valid fintered value.
Gets a list of the current observed locations
Not implemented in the PrositionAverage filter. Use ObservedLocations to get a list
of observed locations.
Gets the filtered location
Gets a value indicating the state of the filter.
The filter is considered initialized and thus reporting valid filtered
locations, when the SampleCount property equals the number of values returned
by the ObservedLocations property.
Gets the time elapsed from the oldest to the most resent position sample.
A strongly-typed resource class, for looking up localized strings, etc.
Returns the cached ResourceManager instance used by this class.
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
This emulator follows a custom route defined in a text file.
This emulator is similar to the , except that it does not require real
GPS data. Instead, it expects a text file that contains a value on each line
(e.g. HH°MM'SS.SSSS, HH°MM'SS.SSSS).
The will move one point further along its route at each
period, so the will automatically adjust
as needed to move the required distance each time.
Initializes a new instance of the class that reads
its route from the specified file.
The file path.
Initializes a new instance of the class that reads
its route from the specified file in the specified direction.
The file path.
if set to true [reverse].
Initializes a new instance of the class that reads
its route from the specified file in the specified direction at the specified interval.
The file path.
if set to true [reverse].
The interval.
Moves to the next point in the route, and calls the base
implementation to generate the appropriate NMEA sentences.
Reads the route file and populates the property.
The absolute or relative path of the file containing the route.
If , the route file will be read in reverse order. That is, the last
in the file will be the starting point of the route.
Returns the amount of time the emulator waits before processing new data.
The interval.
Represents information about a GPS satellite in orbit above Earth.
GPS devices are able to isolate information about GPS satellites in orbit. Each
satellite's unique identifier,
radio signal strength,
azimuth and
elevation are available once its
radio signal is detected.
Properties in this class are updated automatically as new information is
received from the GPS device.
Creates a new instance using the specified unique identifier.
The pseudorandom number.
Creates a new instance using the specified unique identifier, location around the horizon, and elevation up from the horizon.
The pseudorandom number.
The azimuth.
The elevation.
Creates a new instance using the specified unique identifier, location around the horizon, and elevation up from the horizon.
The pseudorandom number.
The azimuth.
The elevation.
The signal to noise ratio.
Creates a new instance using the specified unique identifier, location around the horizon, and elevation up from the horizon.
The pseudorandom number.
The azimuth.
The elevation.
The signal to noise ratio.
if set to true [is fixed].
REturns the string equivalent of this object using ht ecurrent cul
The format.
A that represents this instance.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a that represents this instance.
A that represents this instance.
Returns the satellites in the specified in the list which are marked as fixed.
The satellites.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Compares the current object with another object of the same type.
An object to compare with this object.
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings:
Value
Meaning
Less than zero
This object is less than the parameter.
Zero
This object is equal to .
Greater than zero
This object is greater than .
Returns the unique identifier of the satellite.
Returns the horizontal direction towards the satellite from the current location.
The azimuth.
Returns the vertical direction towards the satellite from the current
location.
The elevation.
Returns the strength of the satellite's radio signal as it is being
received.
The signal to noise ratio.
Returns the date and time that the satellite's signal was detected.
The last signal received.
Returns whether the satellite's signal is being used to calculate the current
location.
true if this instance is fixed; otherwise, false.
Returns whether the satellite's signal is currently being detected.
Returns the amount of time elapsed since the signal was last received.
Returns whether the satellite's signal has recently been received.
Indicates whether the satellite is providing additional corrective
signals to increase precision.
This property will return a value of True
if the GPS satellite has been identified as a WAAS, EGNOS or MSAS satellite.
These satellites are geostationary (unlike typical NAVSTAR GPS satellites)
and re-broadcast correction signals from ground stations. When this property
is true, the GPS device has improved precision.
Returns the government project responsible for launching the satellite.
Returns the atomic clock currently in service.
Returns the launch block of the satellite.
Returns the date the satellite was placed into orbit.
Returns the date the satellite was placed into service.
Returns the date the satellite was removed from service.
Returns the friendly name of the satellite.
Represents information about a satellite when a satellite-related event is raised.
This example demonstrates how to use this class when raising an event.
' Start a new receiver
Dim MyReceiver As New Receiver()
' Declare a new event
Dim MySatelliteEvent As EventHandler
' Get a handle on the first satellite in the receiver's collection
Dim MySatellite As Satellite = MyReceiver.Satellites(0)
Sub Main()
' Raise our custom event
RaiseEvent MySatelliteEvent(Me, New SatelliteEventArgs(MySatellite))
End Sub
// Start a new receiver
Receiver MyReceiver = new Receiver();
// Declare a new event
EventHandler MySatelliteEvent;
// Create an Satellite of 90°
Satellite MySatellite = new Satellite(90);
void Main()
{
// Raise our custom event
MySatelliteEvent(this, New SatelliteEventArgs(MySatellite));
}
SatelliteCollection Class
Azimuth Property (Satellite Class)
Elevation Property (Satellite Class)
SignalToNoiseRatio Property (Satellite Class)
This object is used primarily by the Satellite
class to provide notification when information such as azimuth,
elevation, or radio signal strength
has changed.
Creates a new instance.
The satellite.
Indicates which satellite is the target of the event.
A Satellite object containing modified information.
The event args for a list of satellites
Creates a new instance.
The satellites.
Indicates which satellites are the target of the event.
A list of Satellite objects.
Indicates the government project responsible for a GPS satellite.
The satellite could not be identified.
The satellite is part of the NAVSTAR project.
The satellite is part of the Wide Area Augmentation System (WAAS).
The satellite is part of the European Geostationary Navigation Overlay Service
(EGNOS).
The satellite is pard of Japan's MTSAT Satellite Augmentation System
(MSAS).
Indicates the launch block of a group of NAVSTAR GPS satellites.
The block is unknown.
Represents Block I.
Represents Block II.
Represents Block IIA
Represents Block IIR.
Indicates the main atomic clock in service aboard a GPS satellite.
The clock type is unknown.
The satellite's Cesium clock is currently in service.
The satellite's Rubidium clock is currently in service.
Initializes a new instance of the class.
When overridden in a derived class, executes the code required to free the handle.
true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. In this case, it generates a releaseHandleFailed MDA Managed Debugging Assistant.
Bluetoothes the find radio close.
The h find.
Represents a serial (RS-232) device.
This class is used to connect to any device using the RS-232 protocol. Desktop computers will typically
have at least one serial port, and in some cases a "virtual" serial port is created to make a device emulate RS-232. For
example, since there is no USB standard for GPS devices, USB GPS device manufacturers typically provide a special "USB-to-serial"
driver to make the device available for third-party applications.
Each serial port on a computer has a unique name, typically beginning with "COM" followed by a number, then a colon
(e.g. COM5:). In some special circumstances, such as the GPS Intermediate Driver on Windows Mobile devices, a different prefix
is used. Each serial port includes other configuration settings, most importantly the baud rate, which controls the speed of
communications. GPS device manufacturers must support 4800 baud in order to comply with the NMEA-0183 standard, but many newer devices
use faster speeds. The baud rate of a connection must be specified precisely, otherwise all data from the device will be
unrecognizable.
Other settings for serial ports are the data bits, stop bits, and parity. In the context of GPS, a vast majority of GPS
devices use eight data bits, one stop bit, and no parity. these settings are used if no settings are explicitly provided.
Creates a new instance.
Creates a new instance using the specified port.
Name of the port.
Creates a new instance using the specified port name and baud rate.
Name of the port.
The baud rate.
Forces a device to a closed state without disposing the underlying stream.
Creates a new Stream object for the device.
The access.
The sharing.
A Stream object.
Occurs when an open connection is about to be closed.
Performs a test on the device to confirm that it transmits GPS data.
A Boolean value, True if the device is confirmed.
Stops any GPS protocol detection in progress.
Disposes of any unmanaged (or optionally, managed) resources used by the device.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Records information about this device to the registry.
Removes previously cached information for this device from the registry.
Reads information about this device from the registry.
Clears the cache.
Returns a list of known Bluetooth devices.
To maximize performance, GPS.NET will record information about each device it encounters for the purposes of organizing
and speeding up the GPS device detection process. This property returns a list of all known serial devices.
Since this list is managed automatically, it should not be modified.
Sets the name.
The name.
Loads the serial devices that have been cached by GPS.Net. This list contains previously-detected GPS devices,
along with devices which were tested but found to NOT be GPS devices. By keeping these statistics,
the detection system can become faster over time by first testing devices which have a better success rate.
The list to which the cached devices are added.
Loads any virtual serial devices that exist for other types of physical devices.
This list includes non-GPS devices.
The list to which the cached devices are added.
Loads the serial devices that have already been detected by Windows. This list includes non-GPS devices.
The list to which the devices are added.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Returns the name of the port used to open a connection.
The port.
Returns the numeric portion of the port name.
Controls the speed of communications for this device.
The baud rate.
This property controls the speed of read and write operations for the device. The baud rate specified must precisely
match a rate supported by the device, otherwise data will be unrecognizable. GPS devices are required to support a minimum baud rate of 4800
in order to comply with the NMEA-0183 standard (though not all devices do this). A higher rate is preferable.
Returns a natural language name for the device.
Controls whether the device can be queried for GPS data.
true if [allow connections]; otherwise, false.
Controls the baud rates tested during GPS protocol detection.
A GPS device may support any number of baud rates. As a result, the GPS.NET device detection system
needs to test multiple baud rates in order to find a match. This collection controls the list of baud rates
tested during detection.
Advanced GPS developers can improve performance by trimming this list down to baud rates which will actually
be used.
Controls the maximum allowed detection failures before a device is excluded from detection.
The maximum allowed failures.
Some devices involved with device detection are not GPS devices. For example, a serial device search
could return a bar code scanner, an infrared port, or the neighbor's computer. This property controls how many times a device will be
tested before it is no longer included for searches. If a device's failure count goes beyond this number, attempts
will no longer be made to connect to the device.
Wraps the .Net class and implements workarounds for some
known bugs and limitations.
Initializes a new instance of the class.
Initializes a new instance of the class.
Name of the port.
The baud rate.
Initializes a new instance of the class using the specified port name, baud rate, parity bit, data bits, and stop bit.
The port to use (for example, COM1).
The baud rate.
One of the values.
The data bits value.
One of the values.
The specified port could not be found or opened.
Opens a new serial port connection.
The specified port is open.
One or more of the properties for this instance are invalid. For example, the , , or properties are not valid values; the is less than or equal to zero; the or property is less than zero and is not .
The port name does not begin with "COM". - or -The file type of the port is not supported.
The port is in an invalid state. - or - An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
Access is denied to the port.
Reads up to the value in the input buffer.
The contents of the input buffer up to the first occurrence of a value.
The specified port is not open.
The operation did not complete before the time-out period ended.- or -No bytes were read.
Releases the unmanaged resources used by the and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
The port is in an invalid state. - or -An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid.
Represents a measurement of the strength of a received radio signal.
Signal-to-Noise Ratios (or SNR for short) measure the clarity of
a received signal versus the level at which the signal is being obscured. For
example, if a GPS device is operating in open sky on a clear day, no signals are
obscured and the SNR will be high. Conversely, if a device is activated in a room
with no view of the sky, signals may be obscured, resulting in a low SNR.
This class is used frequently by the Satellite
class to report on the quality of GPS satellite signals. When three or more
satellite SNR's are strong, the device is able to obtain a fix on the current location.
Represents a value signifying a signal which is completely obscured.
Represents a value of zero.
Represents a value signifying a signal which is partially obscured.
Represents a value signifying a signal which is not being obscured.
Creates a new instance.
The value.
Creates a new instance by parsing the specified string.
The value.
Creates a new instance by parsing the specified string using a specific culture.
The value.
The culture.
Returns a that represents this instance.
The format.
A that represents this instance.
Outputs the current instance as a formatted string.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Returns a unique code for the current instance used in hash tables.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a that represents this instance.
A that represents this instance.
Returns a SignalToNoiseRatio object containing a random
value.
Parses the specified value.
The value.
Parses the specified value.
The value.
The culture.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Equalses the specified value.
The value.
Outputs the current instance as a string using the specified format and
culture.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Compares the current object with another object of the same type.
An object to compare with this object.
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings:
Value
Meaning
Less than zero
This object is less than the parameter.
Zero
This object is equal to .
Greater than zero
This object is greater than .
Returns the numeric value of the signal strength.
An Integer value between 0 and 50, where 0 represents no signal and fifty represents a signal at full strength.
This property indicates the strength of a received satellite signal. GPS
satellites always transmit signals at the same strength, but the signal is often
obscured by the atmosphere, buildings and other obstacles such as trees. A value
must be at about 30 or greater for a satellite to be able to maintain a fix for long.
In the Satellite class, this property is updated automatically as new information is
received from the GPS device.
Indicates if the value is zero.
Returns a subjective rating of the signal strength.
A value from the SignalToNoiseRatioRating enumeration.
SignalToNoiseRatioRating Enumeration
This property is frequently used to present an SNR reading in a readable format to the user.
This property is updated automatically as new information is received from the GPS device.
Indicates an in-English description of the a satellite's radio signal strength
This enumeration is used by the Rating property of the
SignalToNoiseRatio class to give an in-English interpretation
of satellite radio signal strength.
Represents a value of 0. The radio signal is completely obscured.
Represents a value between 1 and 15. The radio signal is mostly obscured, such as by a building or tree, but might briefly be part of a fix.
Represents a value between 16 and 30. The radio signal is partially obscured, but could be part of a sustained fix.
Represents a value between 31 and 40. The radio signal is being received with little interferance and could maintain a reliable fix.
Represents a value of 41 or above. The satellite is in direct line of sight from the receiver and can sustain a fix.
Signal to noise ratio event args
Creates a new instance of the event args
The signal to noise ratio.
The signal to noise ratio
Represents a three-dimensional double-precision matrix.
Creates a matrix as an identity matrix
Creates a matrix with the indicated elements
The M11.
The M12.
The M13.
The M21.
The M22.
The M23.
The M31.
The M32.
The M33.
Elementaries this instance.
Ctreates an exact copy of this matrix.
A cloned matrix.
Multiplies this matrix with the supplied matrix, using a prepended matrix order
The matrix to multiply with this matrix.
Multiplies this matrix with the supplied matrix.
The matrix to multiply with this matrix.
The order in which to carry out the operation.
Transforms the vector
The vector.
Transform the array of vectors
The vectors.
Inverts this matrix if it is invertable.
If the matrix is not invertable, this method throws an exception.
Calculates the determinat of this matrix.
The signed area of the parallelagram described by this matrix.
The determinant is a scalar value typically used to invert a matrix. As a signed area, it can also be used to
identify "flipped" orientations, like mirroring. A negative determinant indicates that a matrix is "flipped".
Resests the matrix to the identity matrix.
Returns a that represents this instance.
A that represents this instance.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Determines whether the specified is equal to this instance.
The to compare with the current .
true if the specified is equal to this instance; otherwise, false.
Creates the transpose matrix of a matrix
A.
Square Matrix 3D Invert
A.
Defaults the specified default value.
The default value.
Implements the operator *.
A.
The v.
The result of the operator.
Implements the operator *.
A.
The b.
The result of the operator.
Implements the operator +.
A.
The b.
The result of the operator.
Implements the operator -.
A.
The b.
The result of the operator.
Multiplies the specified a.
A.
The b.
Adds the specified a.
A.
The b.
Subtracts the specified a.
A.
The b.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Elements
Indicates whether or not this is an identity matrix
Indicates whether or not this matrix is invertable.
Returns an identity matrix.
Emulator that sources it's data from a text file
Creates a Text File Emulator from the specified file path with a default read interval of 400 seconds
The file path.
Creates a Text File Emulator from the specified file path with the specified read interval
The file path.
The read interval.
OnEmulation event handler
Gets or sets the ReadInterval for the Text File Emulator
The read interval.
Represents a measurement of an object's rate of travel in a particular direction.
Instances of this class are guaranteed to be thread-safe because the class is
immutable (its properties can only be changed via constructors).
Represents a velocity with no speed or direction.
Represents a velocity with an invalid or unspecified speed and direction.
Initializes a new instance of the struct.
The speed.
The bearing.
Initializes a new instance of the struct.
The speed.
The bearing degrees.
Initializes a new instance of the struct.
The speed.
The speed units.
The bearing.
Initializes a new instance of the struct.
The speed.
The speed units.
The bearing degrees.
Creates a new instance by parsing speed and bearing from the specified strings.
The speed.
The bearing.
Creates a new instance by converting the specified strings using the specific culture.
The speed.
The bearing.
The culture.
Initializes a new instance of the struct.
The reader.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Outputs the current instance as a string using the default format.
A String representing the current instance.
Compares the current instance to the specified velocity.
A Velocity object to compare with.
A Boolean, True if the values are identical.
Compares the current instance to the specified velocity using the specified numeric precision.
A Velocity object to compare with.
An Integer specifying the number of fractional digits to compare.
A Boolean, True if the values are identical.
Outputs the current instance as a string using the specified format and culture information.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Clones this instance.
Gets the objects rate of travel.
Gets the objects direction of travel.
Indicates whether the speed and bearing are both zero.
Indicates whether the speed or bearing is invalid or unspecified.
Represents a rectangular shape on Earth's surface.
This class is used to represent a square (or close to a square) shape on
Earth's surface. This class is typically used during mapping applications to zoom
into a particular area on Earth. This class looks nearly identical to the Rectangle
class in the .NET framework, except that it's bounding points are defined as
Position objects instead of Point objects.
Instances of this class are guaranteed to be thread-safe because the class is
immutable (it's properties can only be set via constructors).
Represents a GeographicRectangle having no size.
Represents a rectangle that encompasses all of Earth's surface.
Creates a new instance using the specified location and size.
The location.
The size.
A GeographicRectangle set to the specified location and
size.
This example creates a new GeographicRectangle starting at 39°N
105°W which is 2° wide and 5° tall.
Dim NorthwestCorner As New Position("39N 105W")
Dim RectangleSize As New GeographicSize(2, 5)
Dim Rectangle As New GeographicRectangle(NorthwestCorner, RectangleSize)
Position NorthwestCorner = new Position("39N, 105W");
GeographicSize RectangleSize = new GeographicSize(2, 5);
GeographicRectangle Rectangle = new GeographicRectangle(NorthwestCorner, RectangleSize);
This constructor defines a rectangle which expands east and south of the
specified location.
Creates a new instance using the specified location, width, and height.
The location.
The width.
The height.
This example creates a new GeographicRectangle starting at 39°N
105°W which is 2° wide and 5° tall.
Dim NorthwestCorner As New Position("39N 105W")
Dim RectangleWidth As Distance = Distance.FromKilometers(1)
Dim RectangleHeight As Distance = Distance.FromKilometers(1)
Dim Rectangle As New GeographicRectangle(NorthwestCorner, RectangleWidth, RectangleHeight)
Position NorthwestCorner = new Position("39N 105W");
Distance RectangleWidth = Distance.FromKilometers(1);
Distance RectangleHeight = Distance.FromKilometers(1);
GeographicRectangle Rectangle = new GeographicRectangle(NorthwestCorner, RectangleWidth, RectangleHeight);
A GeographicRectangle set to the specified location and
size.
This constructor defines a rectangle which expands east and south of the
specified location.
Creates a new instance using the specified northwest and southeast
coordinates.
The northwest.
The southeast.
A GeographicRectangle defined by the two endpoints.
This example creates a new GeographicRectangle starting at 39°N
105°W and ending at 37°N 100°W (2° wide and 5° tall).
Dim NorthwestCorner As New Position("39N 105W")
Dim SoutheastCorner As New Position("37N 100W")
Dim Rectangle As New GeographicRectangle(NorthwestCorner, SoutheastCorner)
Position NorthwestCorner = new Position("39N 105W");
Position SoutheastCorner = new Position("37N 100W");
GeographicRectangle Rectangle = new GeographicRectangle(NorthwestCorner, SoutheastCorner);
This constructor takes the specified parameters and calculates the width and
height of the rectangle. If the two points are backwards (meaning that the right-most
point is west of the left-most point), they are automatically swapped before creating
the rectangle.
Creates a new instance by converting the specified string.
The value.
A GeographicRectangle matching the specified string
value.
This example creates a new rectangle at 39°N, 105° extending two degrees south and
five degrees east to 37°N, 100°W.
Dim Rectangle As New GeographicRectangle("39N, 105W, 37N, 100W")
GeographicRectangle Rectangle = new GeographicRectangle("39N, 105W, 37N, 100W");
This constructor attempts to parse the specified string into a rectangle. The
current culture is used to interpret the string -- use the list separator of the
current culture (which may not necessarily be a comma). This constructor can accept any
output created via the ToString method.
Creates a new instance by converting the specified string in the given
culture.
The value.
The culture.
This constructor attempts to parse the specified string into a rectangle. The
specified culture is used to interpret the string. This constructor can accept any
output created via the ToString method.
This example creates a new rectangle at 39°N, 105° extending two degrees south and
five degrees east to 37°N, 100°W.
Dim Rectangle As New GeographicRectangle("39N, 105W, 37N, 100W", CultureInfo.CurrentCulture)
GeographicRectangle Rectangle = new GeographicRectangle("39N, 105W, 37N, 100W", CultureInfo.CurrentCulture);
Creates a new instance using the specified latitudes and longitudes.
The left.
The top.
The right.
The bottom.
This example creates a new GeographicRectangle by specifying each
side individually.
Dim Left As New Longitude(-105)
Dim Top As New Latitude(39)
Dim Right As New Longitude(-100)
Dim Top As New Latitude(37)
Dim Rectangle As New GeographicRectangle(Left, Top, Right, Bottom)
Longitude Left = new Longitude(-105);
Latitude Top = new Latitude(39);
Longitude Right = new Longitude(-100);
Latitude Top = new Latitude(37);
GeographicRectangle Rectangle = new GeographicRectangle(Left, Top, Right, Bottom);
A GeographicRectangle bound by the specified values.
If the left and right, or top and bottom values are backwards, they are
automatically swapped before creating the rectangle.
Creates a new instance using the specified latitudes and longitudes.
The top.
The left.
The bottom.
The right.
A GeographicRectangle bound by the specified values.
Dim Left As New Longitude(-105)
Dim Top As New Latitude(39)
Dim Right As New Longitude(-100)
Dim Top As New Latitude(37)
Dim Rectangle As New GeographicRectangle(Left, Top, Right, Bottom)
Latitude Top = new Latitude(39);
Longitude Left = new Longitude(-105);
Latitude Bottom = new Latitude(37);
Longitude Right = new Longitude(-100);
GeographicRectangle Rectangle = new GeographicRectangle(Top, Left, Bottom, Right);
If the left and right, or top and bottom values are backwards, they are
automatically swapped before creating the rectangle.
Initializes a new instance of the struct.
The left.
The top.
The right.
The bottom.
Creates a new instance from a block of Geography Markup Language (GML).
The reader.
Moves the rectangle in the specified direction by the specified distance.
The direction.
The distance.
A new GeographicRectangle translated by the specified direction
and distance.
This example defines a rectangle then shifts it Northeast by fifty kilometers.
Dim Rectangle As New GeographicRectangle("30N, 105W, 1°, 5°")
Rectangle = Rectangle.Translate(Azimuth.Northeast, New Distance(50, DistanceUnit.Kilometers))
GeographicRectangle Rectangle = new GeographicRectangle("30N, 105W, 1°, 5°");
Rectangle = Rectangle.Translate(Azimuth.Northeast, New Distance(50, DistanceUnit.Kilometers));
This method is used to shift a rectangle to a new location while preserving its
size.
Moves the rectangle in the specified direction by the specified distance.
The direction.
The distance.
A new GeographicRectangle translated by the specified direction
and distance.
This example defines a rectangle then shifts it Northeast by fifty kilometers.
Dim Rectangle As New GeographicRectangle("30N, 105W, 1°, 5°")
Rectangle = Rectangle.Translate(new Angle(45), New Distance(50, DistanceUnit.Kilometers))
GeographicRectangle Rectangle = new GeographicRectangle("30N, 105W, 1°, 5°");
Rectangle = Rectangle.Translate(new Angle(45), New Distance(50, DistanceUnit.Kilometers));
This method is used to shift a rectangle to a new location while preserving its
size.
Moves the rectangle in the specified direction by the specified distance.
The direction.
The distance.
A new GeographicRectangle translated by the specified direction
and distance.
This example defines a rectangle then shifts it Northeast by fifty kilometers.
Dim Rectangle As New GeographicRectangle("30N, 105W, 1°, 5°")
Rectangle = Rectangle.Translate(45, New Distance(50, DistanceUnit.Kilometers))
GeographicRectangle Rectangle = new GeographicRectangle("30N, 105W, 1°, 5°");
Rectangle = Rectangle.Translate(45, New Distance(50, DistanceUnit.Kilometers));
This method is used to shift a rectangle to a new location while preserving its
size.
Returns the points which form the rectangle.
Indicates if the rectangle does not intersect the specified rectangle.
The rectangle.
true if [is disjointed from] [the specified rectangle]; otherwise, false.
Indicates if the specified GeographicRectangle is entirely within the current GeographicRectangle.
The rectangle.
true if the specified rectangle is enclosing; otherwise, false.
Determines whether the specified position is enclosing.
The position.
true if the specified position is enclosing; otherwise, false.
Moves the GeographicRectangle so that the specified position is at its center.
The position.
Creates a new rectangle of the specified size, centered on the specified position.
The position.
The size.
Expands the edges of the GeographicRectangle to contain the specified position.
A Position object to surround.
A GeographicRectangle which contains the specified position.
If the specified position is already enclosed, the current instance will be returned.
Increases the size of the rectangle while maintaining its center point.
The size.
Increases the width and height of the rectangle by the specified amount.
The width.
The height.
Increases the width and height of the rectangle by the specified amount.
The latitudinal height.
The longitudinal width.
A geographic size rectangle for the height and width specified.
Calculates the rectangle created by the intersection of this and another rectangle.
The rectangle.
Indicates if the rectangle's border crosses or shares the border of the specified rectangle.
The rectangle.
true if [is intersecting with] [the specified rectangle]; otherwise, false.
Indicates if the specified GeographicRectangle shares any of the same 2D space as the current instance.
The rectangle.
true if the specified rectangle is overlapping; otherwise, false.
Indicates if the specified Position is within the current instance.
A Position to test against the current instance.
A Boolean, True if the position is inside of the current rectangle.
Returns the combination of the current instance with the specified rectangle.
A GeographicRectangle to merge with the current instance.
A GeographicRectangle enclosing both rectangles.
This method returns the smallest possible rectangle which encloses the current instance as well as the specified rectangle.
Returns a that represents this instance.
The format.
A that represents this instance.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Returns a unique code of the rectangle for hash tables.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a that represents this instance.
A that represents this instance.
Returns a rectangle which encloses the two specified rectangles.
A GeographicRectangle to merge with the second rectangle.
A GeographicRectangle to merge with the first rectangle.
A GeographicRectangle as a result of merging the two
rectangles.
This method is typically used to combine two individual shapes into a single
shape.
Returns the GeographicRectangle formed by the intersection of the two specified GeographicRectangles.
The first.
The second.
Returns a rectangle which encloses the specified points.
An array of PointD objects to enclose.
A RectangleD object enclosing the specified points.
This method is typically used to calculate a rectangle surrounding
points which have been rotated. For example, if a rectangle is rotated by 45°, the
total width it occupies is greater than it's own width.
Parses a string into a GeographicRectangle object.
A String specifying geographic coordinates defining a rectangle.
A GeographicRectangle object using the specified coordinates.
This powerful method will convert points defining a rectangle in the form of a string into
a GeographicRectangle object. The string can be
Parses the specified value.
The value.
The culture.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Returns the southern-most side of the rectangle.
A object marking the southern-most latitude.
Returns the southern-most latitude of the rectangle.
A object marking the southern-most latitude.
Returns the western-most side of the rectangle.
A Longitude indicating the left side of the rectangle.
Returns the eastern-most side of the rectangle.
A Longitude indicating the right side of the rectangle.
Returns the geographic center of the rectangle.
Returns the aspect ratio of the rectangle.
This property returns the ratio of the GeographicRectangles width to its height (width / height). This
property gives an indication of the GeographicRectangle's shape. An aspect ratio of one indicates
a square, whereas an aspect ratio of two indicates a GeographicRectangle which is twice as wide as
it is high.
Indicates if the rectangle has any value.
A Boolean, True if a metor the size of Rhode
Island is about to crash into the Pacific Ocean just off the coast of Nicaragua but
there will be no casualties because everyone was warned plenty of time in
advance.
Returns the rectangle's hypotenuse.
The hypotenuse of a rectangle is a line connecting its northwest corner with its southeast corner.
Returns the distance from the left to the right at the rectangle's middle latitude.
Returns the distance from the top to the bottom at the rectangle's middle longitude.
Gets the height degrees.
Gets the width degrees.
Returns the width and height of the rectangle.
Returns the northwestern corner of the rectangle.
Returns a point on the northern side, centered horizontally.
Returns a point on the southern side, centered horizontally.
Returns a point on the western side, centered vertically.
Returns a point on the eastern side, centered vertically.
Returns the northeastern corner of the rectangle.
Returns the southwestern corner of the rectangle.
Returns the southeastern corner of the rectangle.
Represents a highly-precise pixel coordinate.
This class behaves similar to the PointF structure in the
System.Drawing namespace, except that it supports double-precision
values and can be converted into a geographic coordinate. This structure is also
supported on the Compact Framework version of the DotSpatial.Positioning,
whereas PointF is not.
Instances of this class are guaranteed to be thread-safe because the class is
immutable (its properties can only be changed via constructors).
Returns a point with no value.
Represents an invalid coordinate.
Creates a new instance for the specified coordinates.
The x.
The y.
Initializes a new instance of the struct.
The value.
Initializes a new instance of the struct.
The value.
The culture.
Initializes a new instance of the struct.
The reader.
Calculates the distance to another pixel.
The value.
Indicates if the current instance is closer to the top of the monitor than the
specified value.
The value.
true if the specified value is above; otherwise, false.
Indicates if the current instance is closer to the bottom of the monitor than the
specified value.
The value.
true if the specified value is below; otherwise, false.
Indicates if the current instance is closer to the left of the monitor than the
specified value.
The value.
true if [is left of] [the specified value]; otherwise, false.
Indicates if the current instance is closer to the right of the monitor than the
specified value.
The value.
true if [is right of] [the specified value]; otherwise, false.
Returns the current instance with its signs switched.
This method returns a new point where the signs of X and Y are flipped. For example, if
a point, represents (20, 40), this function will return (-20, -40).
Returns a that represents this instance.
The format.
A that represents this instance.
Returns the current instance rotated about (0, 0).
The angle.
Returns the current instance rotated about (0, 0).
The angle.
Returns the current instance rotated about the specified point.
The angle.
The center.
Rotates at.
The angle.
The center.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Returns a unique code used for hash tables.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a that represents this instance.
A that represents this instance.
Parses the specified value.
The value.
Parses the specified value.
The value.
The culture.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Returns the sum of two points by adding X and Y values together.
The offset.
This method adds the X and Y coordinates and returns a new point at that location.
Returns the sum of two points by adding X and Y values together.
The offset X.
The offset Y.
This method adds the X and Y coordinates and returns a new point at that location.
Returns the difference of two points by subtracting the specified X and Y values.
The offset.
This method subtracts the X and Y coordinates and returns a new point at that location.
Returns the difference of two points by subtracting the specified X and Y values.
The offset X.
The offset Y.
This method subtracts the X and Y coordinates and returns a new point at that location.
Returns the product of two points by multiplying X and Y values together.
The offset.
This method multiplies the X and Y coordinates together and returns a new point at that location. This
is typically used to scale a point from one coordinate system to another.
Multiplies the specified offset X.
The offset X.
The offset Y.
Divides the specified offset.
The offset.
Divides the specified offset X.
The offset X.
The offset Y.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Equalses the specified value.
The value.
Equalses the specified value.
The value.
The precision.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Gets or sets the x-coordinate of this PointD.
The X.
For projected coordinates, this is the factor Lamda or the longitude parameter.
For readability only, the value is X.
The lam.
Gets or sets the x-coordinate of this PointD.
The Y.
For projected coordinates, this is the factor Phi or the latitude parameter.
For readability only, the value is Y.
The phi.
Returns whether the current instance has no value.
Returns whether the current instance has an invalid value.
A strongly-typed resource class, for looking up localized strings, etc.
Returns the cached ResourceManager instance used by this class.
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
Looks up a localized string similar to Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed..
Looks up a localized string similar to The specified format could not be fully recognized as an angular measurement..
Looks up a localized string similar to The interval must be a value greater than zero, between 0 and 60..
Looks up a localized string similar to Invalid format for Angle.ToString() method..
Looks up a localized string similar to Only the right-most number of a sexagesimal measurement can be a fractional value..
Looks up a localized string similar to An Angle can only be compared with Angle, Double, or String values..
Looks up a localized string similar to The specified format could not be fully recognized as an area measurement..
Looks up a localized string similar to The numeric portion of the area measurement could not be recognized..
Looks up a localized string similar to The unit portion of the area measurement could not be recognized..
Looks up a localized string similar to The azimuth cannot be converted to a because no conversion has been implemented internally. Please contact info@DotSpatial.Positioning.com with the source and destination unit types..
Looks up a localized string similar to An Azimuth can only be compared with another Azimuth, or a Double..
Looks up a localized string similar to Empty.
Looks up a localized string similar to Infinity.
Looks up a localized string similar to The distance cannot be converted because no conversion has been implemented internally. Please contact info@DotSpatial.Positioning.com with the source and destination unit types..
Looks up a localized string similar to Distance objects can only be compared with other Distance objects..
Looks up a localized string similar to The specified format could not be fully recognized as a distance measurement..
Looks up a localized string similar to The numeric portion of the distance measurement could not be recognized..
Looks up a localized string similar to The unit portion of the distance measurement could not be recognized..
Looks up a localized string similar to The specified license key is invalid. Please contact DotSpatial.Positioning to look up license keys you have purchased: http://dotspatial.codeplex.com/Secured/LicenseKeys.aspx..
Looks up a localized string similar to Would you like to go online now to activate your trial? An email address will not be required unless you're behind a proxy server..
Looks up a localized string similar to {0} Stopped Execution.
Looks up a localized string similar to Execution of the current application has been stopped by an exception, but this message will go away once trial license keys have been provided, or the reference the assembly has been removed..
Looks up a localized string similar to Execution of the current application has been stopped by an exception, but this message will go away once trial license keys have been provided. Please visit http://dotspatial.codeplex.com/FreeTrialLicenseKeys.aspx to obtain free license keys for any of our products..
Looks up a localized string similar to Do you want to go online to activate free trial license keys?.
Looks up a localized string similar to An invalid license key was encountered while attempting to grant a license to a DotSpatial.Positioning object. The invalid key is "{0}".
Looks up a localized string similar to The license key for {0} is valid for a different major version of the software. Please visit http://dotspatial.codeplex.com/Shop for pricing on products for this version. Updates to DotSpatial.Positioning software are always free for each minor version change (e.g. versions 2.0 through 2.999).
Looks up a localized string similar to The license key for {0} is not valid for the current .NET platform. Please contact support@DotSpatial.Positioning.com for assistance or visit http://dotspatial.codeplex.com/Shop for pricing on products for this platform..
Looks up a localized string similar to A DotSpatial.Positioning License Key Is Required.
Looks up a localized string similar to A license key is required for this DotSpatial.Positioning assembly to function. You can activate a free thirty-day trial online at http://dotspatial.codeplex.com..
Looks up a localized string similar to A valid owner license has been granted for {0}.
Looks up a localized string similar to A trial license has been granted for {0} until {1}.
Looks up a localized string similar to The specified value could not be parsed into a GeographicSize object because two delimited values are required (Width, Height)..
Looks up a localized string similar to The Parse method requires a decimal or sexagesimal measurement..
Looks up a localized string similar to A Latitude can only be compared with another Latitude, Double or String..
Looks up a localized string similar to The specified format could not be fully recognized as a latitude..
Looks up a localized string similar to The hemisphere specified for the ToHemisphere method cannot be 'None'. A value of 'North' or 'South' is required..
Looks up a localized string similar to The hemisphere specified indicates a longitude but a latitude is expected..
Looks up a localized string similar to Only the right-most number can be a floating-point value..
Looks up a localized string similar to The Parse method requires a decimal or sexagesimal measurement..
Looks up a localized string similar to A Longitude can only be compared with another Longitude, Double or String..
Looks up a localized string similar to The specified format could not be fully recognized as a longitude..
Looks up a localized string similar to The hemisphere specified for the ToHemisphere method cannot be 'None'. A value of 'East' or 'West' is required..
Looks up a localized string similar to The hemisphere specified indicates a latitude but a longitude is expected..
Looks up a localized string similar to Only the right-most number can be a floating-point value..
Looks up a localized string similar to The Position.DistanceTo method requires a non-null ellipsoid parameter..
Looks up a localized string similar to Duplicate UTM zone information was found when trying to parse a UTM coordinate..
Looks up a localized string similar to The specified format could not be fully recognized as a spherical or UTM coordinate..
Looks up a localized string similar to The specified string could not be recognized as a valid UTM coordinate..
Looks up a localized string similar to A UTM zone letter can only be one character long. Multiple characters were encountered..
Looks up a localized string similar to A UTM zone number can only be one or two characters long. Multiple characters were encountered..
Looks up a localized string similar to No UTM zone letter could be located within the specified string..
Looks up a localized string similar to No UTM zone number could be located within the specified string..
Looks up a localized string similar to The total area could not be calculated..
Looks up a localized string similar to The total distance could not be calculated..
Looks up a localized string similar to The range must be a distance greater than or equal to zero..
Looks up a localized string similar to Height must be a number greater than zero..
Looks up a localized string similar to The specified value could not be parsed into a RectangleD object because four delimited values are required (Top, Left, Bottom, Right)..
Looks up a localized string similar to Width must be a number greater than zero..
Looks up a localized string similar to Two values must be supplied to create a SizeD object from a string. Verify that the CultureInfo passed matches the delimiter used to separate the values..
Looks up a localized string similar to The specified format could not be fully recognized as a speed measurement..
Looks up a localized string similar to The numeric portion of the speed measurement could not be recognized..
Looks up a localized string similar to The unit portion of the speed measurement could not be recognized..
Looks up a localized string similar to Trial License Expires {0} ({1} days remaining).
Looks up a localized string similar to Would you like to go online to try and extend your free trial now?.
Looks up a localized string similar to Purchased license keys cannot be used as trial license keys. Please use another key or contact DotSpatial.Positioning for further assistance..
Looks up a localized string similar to Sorry, the trial key for the following DotSpatial.Positioning assembly expired on {0}. You can go online to try and extend your trial another month, or you can purchase a license key online.\r\n\r\n{1}.
Looks up a localized string similar to DotSpatial.Positioning Trial Has Expired.
Represents a number as a fraction of one hundred.
These examples create Percent objects using different
constructors.
// Create a percentage of 25%
Percent twentyFivePercent = new Percent(0.25f);
' Create a percentage of 25%
Dim TwentyFivePercent As New Percent(0.25)
// Create a percentage of 25%
Percent twentyFivePercent = New Percent("25.4%", CultureInfo.InvariantCulture);
' Create a percentage of 25%
Dim TwentyFivePercent As New Percent("25.5%", CultureInfo.InvariantCulture)
This class is used to express one quantity relative to another quantity.
Percentage values are presented in string form using the percent symbol of the
local culture (usually the percent symbol "%"). When percentage values are
expressed in decimal form the value is divided by one hundred. In other words, the
value "25%" is equivalent to 0.25.
This class is culture-sensitive, meaning that both the percent symbol and the
numeric format is interpreted and presented differently depending on the local
culture. As a result, the CultureInfo object should be used any
time a value is parsed from a String or output as a String using
the ToString method.
Represents a percentage value of zero.
A Percentage value, representing 0% and
0.0.
Represents a value of one hundred percent.
A Percentage value, meaning 100% or
1.0.
Represents a percentage of fifty percent.
A Percentage value, representing 50% or
0.5.
Represents a value of twenty-five percent.
A Percentage value, representing 25% or
0.25.
Creates a new instance using the specified value.
The value.
Initializes a new instance of the struct.
The value.
Initializes a new instance of the struct.
The value.
The culture.
Returns the percentage of the specified value.
The value.
Returns the percentage of the specified value.
The value.
Returns the percentage of the specified value.
The value.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns the percentage formatted as a String.
A that represents this instance.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Returns the percentage of the specified value.
The left.
The right.
The result of the operator.
Returns the percentage of the specified value.
The left.
The right.
The result of the operator.
Returns the percentage of the specified value.
The left.
The right.
The result of the operator.
Returns the percentage of the specified value.
The value.
Returns the percentage of the specified value.
The value.
Returns the percentage of the specified value.
The value.
Converts the specified value to a Percent object.
The value.
The result of the conversion.
Converts the specified value to a Percent object.
The value.
The result of the conversion.
Converts the specified value to a Percent object.
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Returns the percentage formatted as a String.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Compares the current object with another object of the same type.
An object to compare with this object.
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings:
Value
Meaning
Less than zero
This object is less than the parameter.
Zero
This object is equal to .
Greater than zero
This object is greater than .
Returns the decimal value of the percentage.
The value of a Percent object is 1/100th of the
percentage. In other words, if the percentage is "15%" then the Value
property will return 0.15, and a percentage of "100%" means a
Value of 1.0.
Returns whether the value equals zero.
Represents a coordinate system based on interpretations of the Earth's shape and size.
Ellipsoid Class
Over the course of history, advances in technology have given people the
ability to more accurately measure the shape and size of the Earth. Since countries
have built significant infrastructure based upon older coordinate systems, they
cannot immediately abandon them in favor of new ones. As a result, there are now
over fifty interpretations of Earth's shape and size in use all over the
world.
Some datums, such as World Geodetic System 1984 (or WGS84 for short) are
becoming more widely used throughout the world, and this datum is used by nearly
all GPS devices. However, while the world is slowly standardizing its datums, some
datums will not be abandoned because they remain quite accurate for a specific,
local area.
A datum on its own is nothing more than a more granular interpretation of an
ellipsoid. Typically, more specific coordinate transformation information is
further associated with a datum to produce meaningful information. For example,
Helmert and Molodensky coordinate conversion formulas use several local conversion
parameters for each datum.
Instances of this class are guaranteed to be thread-safe because the class is
immutable (its properties can only be set via constructors).
Not specified (based on the Airy 1830 ellipsoid)
Not specified (based on the Airy Modified 1849 ellipsoid)
Not specified (based on the Australian National Spheroid ellipsoid)
Not specified (based on the Bessel 1841 ellipsoid)
Not specified (based on the Bessel Modified ellipsoid)
Not specified (based on the Bessel Namibia (GLM) ellipsoid)
Not specified (based on the Clarke 1858 ellipsoid)
Not specified (based on the Clarke 1866 ellipsoid)
Not specified (based on the Clarke 1866 Michigan ellipsoid)
Not specified (based on the Clarke 1880 (Benoit) ellipsoid)
Not specified (based on the Clarke 1880 (IGN) ellipsoid)
Not specified (based on the Clarke 1880 (RGS) ellipsoid)
Not specified (based on the Clarke 1880 (Arc) ellipsoid)
Not specified (based on the Clarke 1880 (SGA 1922) ellipsoid)
Not specified (based on the Everest 1830 (1937 Adjustment) ellipsoid)
Not specified (based on the Everest 1830 (1967 Definition) ellipsoid)
Not specified (based on the Everest 1830 Modified ellipsoid)
Not specified (based on the GRS 1980 ellipsoid)
Not specified (based on the Helmert 1906 ellipsoid)
Not specified (based on the Indonesian National Spheroid ellipsoid)
Not specified (based on the International 1924 ellipsoid)
Not specified (based on the Krassowsky 1940 ellipsoid)
Not specified (based on the NWL 9D ellipsoid)
Not specified (based on the Plessis 1817 ellipsoid)
Not specified (based on the Struve 1860 ellipsoid)
Not specified (based on the War Office ellipsoid)
Not specified (based on the WGS 84 ellipsoid)
Not specified (based on the GEM 10C ellipsoid)
Not specified (based on the OSU86F ellipsoid)
Not specified (based on the OSU91A ellipsoid)
Not specified (based on the Clarke 1880 ellipsoid)
Not specified (based on the Sphere ellipsoid)
Not specified (based on the GRS 1967 ellipsoid)
Not specified (based on the Average Terrestrial System 1977 ellipsoid)
Not specified (based on the Everest (1830 Definition) ellipsoid)
Not specified (based on the WGS 72 ellipsoid)
Not specified (based on the Everest 1830 (1962 Definition) ellipsoid)
Not specified (based on the Everest 1830 (1975 Definition) ellipsoid)
Not specified (based on the GRS 1980 Authalic Sphere ellipsoid)
Not specified (based on the Clarke 1866 Authalic Sphere ellipsoid)
Not specified (based on the International 1924 Authalic Sphere ellipsoid)
Not specified (based on the Hughes 1980 ellipsoid)
Greek
Greek Geodetic Reference System 1987
Average Terrestrial System 1977
Kartastokoordinaattijarjestelma (1966)
Rikets koordinatsystem 1990
Samboja
Lithuania 1994 (ETRS89)
Tete
Madzansua
Observatario
Moznet (ITRF94)
Indian 1960
Represents the Indian datum.
Final Datum 1958
Estonia 1992
PDO Survey Datum 1993
Old Hawaiian
St. Lawrence Island
St. Paul Island
St. George Island
Puerto Rico
NAD83 Canadian Spatial Reference System
Israel
Locodjo 1965
Abidjan 1987
Kalianpur 1937
Kalianpur 1962
Kalianpur 1975
Hanoi 1972
Hartebeesthoek94
CH1903
CH1903+
Swiss Terrestrial Reference Frame 1995
NAD83 (High Accuracy Regional Network)
Rassadiran
European Datum 1950(1977)
Dabola 1981
Jednotne Trigonometricke Site Katastralni
Mount Dillon
Naparima 1955
European Libyan Datum 1979
Chos Malal 1914
Pampa del Castillo
Korean Datum 1985
Yemen National Geodetic Network 1996
South Yemen
Bissau
Korean Datum 1995
New Zealand Geodetic Datum 2000
Accra
American Samoa 1962
Sistema de Referencia Geocentrico para America del Sur 1995
Reseau Geodesique Francais 1993
Posiciones Geodesicas Argentinas
IRENET95
Sierra Leone Colony 1924
Sierra Leone 1968
Australian Antarctic Datum 1998
Pulkovo 1942/83
Pulkovo 1942/58
Estonia 1997
Luxembourg 1930
Azores Occidental Islands 1939
Represents the Observatorio Meteorologico datum of 1939.
Azores Central Islands 1948
Represents the Graciosa Base SW datum of 1948.
Azores Oriental Islands 1940
Madeira 1936
OSNI 1952
Red Geodesica Venezolana
Posiciones Geodesicas Argentinas 1998
Albanian 1987
Douala 1948
Manoca 1962
Qornoq 1927
Scoresbysund 1952
Ammassalik 1958
Garoua
Kousseri
Egypt 1930
Pulkovo 1995
Adindan
Australian Geodetic Datum 1966
Australian Geodetic Datum 1984
Ain el Abd 1970
Afgooye
Agadez
Lisbon 1937
Aratu
Arc 1950
Arc 1960
Batavia
Barbados 1938
Beduaram
Beijing 1954
Reseau National Belge 1950
Bermuda 1957
Bogota 1975
Bukit Rimpah
Camacupa
Campo Inchauspe
Cape
Carthage
Chua
Corrego Alegre
Cote d'Ivoire
Deir ez Zor
Douala
Egypt 1907
European Datum 1950
European Datum 1987
Fahud
Gandajika 1970
Garoua
Guyane Francaise
Hu Tzu Shan
Hungarian Datum 1972
Indonesian Datum 1974
Indian 1954
Indian 1975
Jamaica 1875
Jamaica 1969
Kalianpur 1880
Kandawala
Kertau 1968
Kuwait Oil Company
La Canoa
Provisional South American Datum 1956
Lake
Leigon
Liberia 1964
Lome
Luzon 1911
Hito XVIII 1963
Represents the Provisional South Chilean datum of 1963.
Herat North
Mahe 1971
Makassar
European Terrestrial Reference System 1989
Malongo 1987
Manoca
Merchich
Massawa
Minna
Mhast
Monte Mario
M'poraloko
North American Datum 1927
NAD Michigan
North American Datum 1983
Nahrwan 1967
Naparima 1972
New Zealand Geodetic Datum 1949
Represents the Geodetic Datum of 1949.
NGO 1948
Datum 73
Nouvelle Triangulation Francaise
NSWC 9Z-2
OSGB 1936
Represents the Ordnance Survey of Great Britain datum of 1936.
OSGB 1970 (SN)
OS (SN) 1980
Padang 1884
Palestine 1923
Congo 1960 Pointe Noire
Geocentric Datum of Australia 1994
Pulkovo 1942
Qatar 1974
Qatar 1948
Qornoq
Loma Quintana
Amersfoort
South American Datum 1969
Sapper Hill 1943
Schwarzeck
Segora
Serindung
Sudan
Tananarive 1925
Timbalai 1948
TM65
Represents the Ireland datum of 1965.
Geodetic Datum of 1965
Tokyo
Trinidad 1903
Trucial Coast 1948
Voirol 1875
Bern 1938
Nord Sahara 1959
Stockholm 1938
Yacare
Yoff
Zanderij
Militar-Geographische Institut
Represents the Hermannskogel datum.
Reseau National Belge 1972
Deutsches Hauptdreiecksnetz
Conakry 1905
Dealul Piscului 1933
Dealul Piscului 1970
National Geodetic Network
Kuwait Utility
World Geodetic System 1972
WGS 72 Transit Broadcast Ephemeris
World Geodetic System 1984
Anguilla 1957
Antigua 1943
Dominica 1945
Grenada 1953
Montserrat 1958
St. Kitts 1955
Represents the Fort Thomas datum of 1955.
St. Lucia 1955
St. Vincent 1945
North American Datum 1927 (1976)
North American Datum 1927 (CGQ77)
Xian 1980
Hong Kong 1980
Japanese Geodetic Datum 2000
Gunung Segara
Qatar National Datum 1995
Porto Santo 1936
Selvagem Grande
South American Datum 1969
SWEREF99
Point 58
Fort Marigot
Guadeloupe 1948
Centre Spatial Guyanais 1967
Reseau Geodesique Francais Guyane 1995
Martinique 1938
Reunion 1947
Reseau Geodesique de la Reunion 1992
Tahiti 52
Tahaa 54
IGN72 Nuku Hiva
K0 1949
Combani 1950
IGN56 Lifou
IGN72 Grande Terre
ST87 Ouvea
Petrels 1972
Pointe Geologie Perroud 1950
Saint Pierre et Miquelon 1950
MOP78
Reseau de Reference des Antilles Francaises 1991
IGN53 Mare
ST84 Ile des Pins
ST71 Belep
NEA74 Noumea
Reseau Geodesique Nouvelle Caledonie 1991
Grand Comoros
International Terrestrial Reference Frame 1988
International Terrestrial Reference Frame 1989
International Terrestrial Reference Frame 1990
International Terrestrial Reference Frame 1991
International Terrestrial Reference Frame 1992
International Terrestrial Reference Frame 1993
International Terrestrial Reference Frame 1994
International Terrestrial Reference Frame 1996
International Terrestrial Reference Frame 1997
International Terrestrial Reference Frame 2000
Reykjavik 1900
Hjorsey 1955
Islands Network 1993
Helle 1954
Latvia 1992
Porto Santo 1995
Azores Oriental Islands 1995
Azores Central Islands 1995
Lisbon 1890
Iraq-Kuwait Boundary Datum 1992
European Datum 1979
Istituto Geografico Militaire 1995
Voirol 1879
Chatham Islands Datum 1971
Chatham Islands Datum 1979
Sistema de Referencia Geocentrico para America del Sur 2000
Guam 1963
Vientiane 1982
Lao 1993
Lao National Datum 1997
Jouik 1961
Nouakchott 1965
Mauritania 1999
Gulshan 303
Philippine Reference System 1992
Gan 1970
Gandajika
Marco Geocentrico Nacional de Referencia
Reseau Geodesique de la Polynesie Francaise
Fatu Iva 72
IGN63 Hiva Oa
Tahiti 79
Moorea 87
Maupiti 83
Nakhl-e Ghanem
Posiciones Geodesicas Argentinas 1994
Katanga 1955
Kasai 1953
IGC 1962 Arc of the 6th Parallel South
IGN 1962 Kerguelen
Le Pouce 1934
IGN Astro 1960
Institut Geographique du Congo Belge 1955
Mauritania 1999
Missao Hidrografico Angola y Sao Tome 1951
Mhast (onshore)
Mhast (offshore)
Egypt Gulf of Suez S-650 TL
Tern Island 1961
Cocos Islands 1965
Represents the Anna 1 Astro datum of 1965.
Iwo Jima 1945
Represents the Astro Beacon "E" datum of 1945.
St. Helena 1971
Represents the Astro DOS 71/4 datum.
Marcus Island 1952
Represents the Astronomical Station datum of 1952.
Ascension Island 1958
Ayabelle Lighthouse
Bellevue
Camp Area Astro
Phoenix Islands 1966
Represents the Canton Astro datum of 1966.
Cape Canaveral
Solomon 1968
Represents the DOS datum of 1968.
Represents the GUX 1 Astro datum.
Easter Island 1967
Fiji Geodetic Datum 1986
Fiji 1956
South Georgia 1968
Represents the ISTS 061 Astro datum of 1968.
Grand Cayman 1959
Diego Garcia 1969
Represents the ISTS 073 Astro datum of 1969.
Johnston Island 1961
Little Cayman 1961
Represents the L. C. 5 Astro datum of 1961.
Midway 1961
Pico de la Nieves
Pitcairn 1967
Santo 1965
Viti Levu 1916
Marshall Islands 1960
Wake Island 1952
Tristan 1968
Kusaie 1951
Deception Island
Geocentric datum of Korea
Hong Kong 1963
Hong Kong 1963(67)
Parametrop Zemp 1990
Faroe Datum 1954
Geodetic Datum of Malaysia 2000
Karbala 1979 (Polservice)
Nahrwan 1934
Rauenberg Datum/83
Potsdam Datum/83
Greenland 1996
Vanua Levu 1915
Reseau Geodesique de Nouvelle Caledonie 91-93
ST87 Ouvea
Kertau (RSO)
Represents the Kertau datum of 1948.
Viti Levu 1912
fk89
Libyan Geodetic Datum 2006
Datum Geodesi Nasional 1995
Vietnam 2000
SVY21
Jamaica 2001
CH1903 (Bern)
Bogota 1975 (Bogota)
Lisbon 1937 (Lisbon)
Makassar (Jakarta)
Militar-Geographische Institut (Ferro)
Monte Mario (Rome)
Nouvelle Triangulation Francaise (Paris)
Padang 1884 (Jakarta)
Reseau National Belge 1950 (Brussels)
Tananarive 1925 (Paris)
Voirol 1875 (Paris)
Batavia (Jakarta)
Stockholm 1938 (Stockholm)
Greek (Athens)
Carthage (Paris)
NGO 1948 (Oslo)
S-JTSK (Ferro)
Nord Sahara 1959 (Paris)
Gunung Segara (Jakarta)
Voirol 1879 (Paris)
International Terrestrial Reference Frame 2005
Ancienne Triangulation Francaise (Paris)
Nord de Guerre (Paris)
Madrid 1870 (Madrid)
Lisbon 1890 (Lisbon)
Represents the Estonia Coordinate System datum of 1937.
Represents the Old Egyptian datum of 1907.
Represents the Oman datum.
Represents the Pointe Noire datum.
Represents the Rome datum of 1940.
Represents the Sao Braz datum.
Represents the South Asia datum.
Represents the Voirol datum of 1960.
Represents the Wake Eniwetok datum of 1960.
Represents the default datum used by the DotSpatial.Positioning, WGS1984.
Creates a new instance using the specified name and reference ellipsoid.
The name.
The ellipsoid.
Internal constructor for static list generation
The epsg number.
The ellipsoid.
The name.
Internal constructor for static list generation
The epsg number.
The ellipsoid.
The meridian.
The name.
Validates the datum. Called in the constructor.
Returns a that represents this instance.
A that represents this instance.
Determines whether the specified is equal to this instance.
The to compare with the current .
true if the specified is equal to this instance; otherwise, false.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a Datum object matching the specified name.
A String describing the name of an existing datum.
A Datum object matching the specified string, or null if no datum was found.
Returns the datum corresponding to the EPSG code
The epsg number.
Compares the current instance to the specified datum object.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Returns the name of the datum.
European Petroleum Survey Group number for this datum. The ESPG standards are now maintained by OGP
(International Association of Oil and Gas Producers).
Returns the interpretation of Earth's shape associated with a datum.
Read only. An
Ellipsoid
object.
This example gets information on the ellipsoid associated with the WGS84 datum.
' Get information about the NAD1983 datum
Dim MyDatum As Datum = Geodesy.GetDatum(DatumType.NorthAmerican1983)
' Get the ellipsoid associated with this datum
Dim MyEllipsoid As Ellipsoid = MyDatum.Ellipsoid
' Write the semi-major axis of the ellipsoid
Debug.WriteLine(MyEllipsoid.SemiMajorAxis.ToString())
// Get information about the NAD1983 datum
Datum MyDatum = Geodesy.GetDatum(DatumType.NorthAmerican1983);
// Get the ellipsoid associated with this datum
Ellipsoid MyEllipsoid = MyDatum.Ellipsoid;
// Write the semi-major axis of the ellipsoid
Debug.WriteLine(MyEllipsoid.SemiMajorAxis.ToString());
Ellipsoid Class
Each datum is associated with an ellipsoid, which is an interpretation of Earth's shape and
size.
Returns the prime meridian assocated with this Datum.
Most datums use Greenwich as the prime meridian. However, several systems offset coordinates
using a local meridian. This value reflects that usage.
Represents the measurement of a straight line between between two points on
Earth's surface.
Returns the distance from the center of the Earth to the equator according to the
WGS1984 ellipsoid.
EarthsPolarRadiusWgs1984
Field
EarthsAverageRadius Field
Represents an infinite distance.
Returns the distance from the center of the Earth to a pole according to the
WGS1984 ellipsoid.
EarthsEquatorialRadiusWgs1984 Field
EarthsAverageRadius Field
Returns the average radius of the Earth.
EarthsEquatorialRadiusWgs1984 Field
EarthsPolarRadiusWgs1984 Field
Represents an invalid or unspecified value.
Creates a new instance using the specified value and unit type.
The value.
The units.
This example uses a constructor to create a new distance of 50km.
Dim MyDistance As New Distance(50, DistanceUnit.Kilometers)
Distance MyDistance = new Distance(50, DistanceUnit.Kilometers);
Creates a new instance from the the specified string.
The value.
Parse method requires a valid distance measurement.
1. The numeric portion of the distance measurement was not recognized.
2. The distance unit type was not recognized or not specified.
This example demonstrates how the to use this constructor.
Dim MyDistance As Distance
' Create a distance of 50 kilometers
MyDistance = New Distance("50 km")
' Create a distance of 14, 387 miles, then convert it into inches
MyDistance = New Distance("14, 387 statute miles").ToInches
' Parse an untrimmed measurement into 50 feet
MyDistance = New Distance(" 50 ' ")
Distance MyDistance;
// Create a distance of 50 kilometers
MyDistance = new Distance("50 km");
// Create a distance of 14, 387 miles, then convert it into inches
MyDistance = new Distance("14, 387 statute miles").ToInches;
// Parse an untrimmed measurement into 50 feet
MyDistance = new Distance(" 50 ' ");
This powerful constructor is typically used to initialize an instance with a
string-based distance measurement, such as one entered by a user or read from a file.
This constructor can accept any output created via the
ToString method.
Initializes a new instance of the struct.
The value.
The culture.
Creates a new instance from the specified XML.
The reader.
Returns the time required to travel the entire distance at the specified speed.
A Speed object representing a travel speed.
A TimeSpan object representing the total time required to travel the entire distance.
Returns the speed required to travel the entire distance in the specified time.
A TimeSpan object representing the time to travel the entire distance.
A Speed object representing the speed required to travel the distance in exactly the time specified.
Converts the current measurement into feet.
A new Distance object containing the converted
value.
ToInches Method
ToKilometers Method
ToMeters Method
ToNauticalMiles Method
ToStatuteMiles Method
This example converts various distances into feet. notice that the ToFeet method converts distances
from any source type.
' Create distances of different unit types
Dim Distance1 As New Distance(10, DistanceUnit.Inches)
Dim Distance2 As New Distance(20, DistanceUnit.StatuteMiles)
Dim Distance3 As New Distance(50, DistanceUnit.Kilometers)
' Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToFeet.ToString)
Debug.WriteLine(Distance2.ToFeet.ToString)
Debug.WriteLine(Distance3.ToFeet.ToString)
// Create distances of different unit types
Distance Distance1 = new Distance(10, DistanceUnit.Inches);
Distance Distance2 = new Distance(20, DistanceUnit.StatuteMiles);
Distance Distance3 = new Distance(50, DistanceUnit.Kilometers);
// Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToFeet().ToString());
Debug.WriteLine(Distance2.ToFeet().ToString());
Debug.WriteLine(Distance3.ToFeet().ToString());
This method will perform a conversion into feet regardless of the current unit
type. You may convert from any unit type to any unit type.
Converts the current measurement into inches.
A new Distance object containing the converted
value.
This example converts various distances into inches. notice that the ToInches method converts distances
from any source type.
' Create distances of different unit types
Dim Distance1 As New Distance(10, DistanceUnit.Feet)
Dim Distance2 As New Distance(20, DistanceUnit.StatuteMiles)
Dim Distance3 As New Distance(50, DistanceUnit.Kilometers)
' Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToInches.ToString)
Debug.WriteLine(Distance2.ToInches.ToString)
Debug.WriteLine(Distance3.ToInches.ToString)
// Create distances of different unit types
Distance Distance1 = new Distance(10, DistanceUnit.Feet);
Distance Distance2 = new Distance(20, DistanceUnit.StatuteMiles);
Distance Distance3 = new Distance(50, DistanceUnit.Kilometers);
// Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToInches().ToString());
Debug.WriteLine(Distance2.ToInches().ToString());
Debug.WriteLine(Distance3.ToInches().ToString());
ToFeet Method
ToKilometers Method
ToMeters Method
ToNauticalMiles Method
ToStatuteMiles Method
This method will perform a conversion into feet regardless of the current unit
type. You may convert from any unit type to any unit type.
Converts the current measurement into kilometers.
A new Distance object containing the converted
value.
This example converts various distances into kilometers. notice that the ToKilometers method converts
distances from any source type.
' Create distances of different unit types
Dim Distance1 As New Distance(10, DistanceUnit.Feet)
Dim Distance2 As New Distance(20, DistanceUnit.StatuteMiles)
Dim Distance3 As New Distance(50, DistanceUnit.Inches)
' Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToKilometers.ToString)
Debug.WriteLine(Distance2.ToKilometers.ToString)
Debug.WriteLine(Distance3.ToKilometers.ToString)
// Create distances of different unit types
Distance Distance1 = new Distance(10, DistanceUnit.Feet);
Distance Distance2 = new Distance(20, DistanceUnit.StatuteMiles);
Distance Distance3 = new Distance(50, DistanceUnit.Inches);
// Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToKilometers().ToString());
Debug.WriteLine(Distance2.ToKilometers().ToString());
Debug.WriteLine(Distance3.ToKilometers().ToString());
ToFeet Method
ToInches Method
ToMeters Method
ToNauticalMiles Method
ToStatuteMiles Method
This method will perform a conversion into feet regardless of the current unit
type. You may convert from any unit type to any unit type.
Converts the current measurement into meters.
A new Distance object containing the converted
value.
This example converts various distances into meters. notice that the ToMeters method converts distances
from any source type.
' Create distances of different unit types
Dim Distance1 As New Distance(10, DistanceUnit.Feet)
Dim Distance2 As New Distance(20, DistanceUnit.StatuteMiles)
Dim Distance3 As New Distance(50, DistanceUnit.Inches)
' Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToMeters().ToString)
Debug.WriteLine(Distance2.ToMeters().ToString)
Debug.WriteLine(Distance3.ToMeters().ToString)
// Create distances of different unit types
Distance Distance1 = new Distance(10, DistanceUnit.Feet);
Distance Distance2 = new Distance(20, DistanceUnit.StatuteMiles);
Distance Distance3 = new Distance(50, DistanceUnit.Inches);
// Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToMeters().ToString());
Debug.WriteLine(Distance2.ToMeters().ToString());
Debug.WriteLine(Distance3.ToMeters().ToString());
ToFeet Method
ToInches Method
ToKilometers Method
ToNauticalMiles Method
ToStatuteMiles Method
This method will perform a conversion into feet regardless of the current unit
type. You may convert from any unit type to any unit type.
Converts the current measurement into meters.
A new Distance object containing the converted
value.
This example converts various distances into meters. notice that the ToMeters method converts distances
from any source type.
' Create distances of different unit types
Dim Distance1 As New Distance(10, DistanceUnit.Feet)
Dim Distance2 As New Distance(20, DistanceUnit.StatuteMiles)
Dim Distance3 As New Distance(50, DistanceUnit.Inches)
' Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToMeters().ToString)
Debug.WriteLine(Distance2.ToMeters().ToString)
Debug.WriteLine(Distance3.ToMeters().ToString)
// Create distances of different unit types
Distance Distance1 = new Distance(10, DistanceUnit.Feet);
Distance Distance2 = new Distance(20, DistanceUnit.StatuteMiles);
Distance Distance3 = new Distance(50, DistanceUnit.Inches);
// Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToMeters().ToString());
Debug.WriteLine(Distance2.ToMeters().ToString());
Debug.WriteLine(Distance3.ToMeters().ToString());
ToFeet Method
ToInches Method
ToKilometers Method
ToNauticalMiles Method
ToStatuteMiles Method
This method will perform a conversion into feet regardless of the current unit
type. You may convert from any unit type to any unit type.
Converts the current measurement into nautical miles.
A new Distance object containing the converted
value.
This example converts various distances into nautical miles. notice that the ToNauticalMiles method
converts distances from any source type.
' Create distances of different unit types
Dim Distance1 As New Distance(10, DistanceUnit.Feet)
Dim Distance2 As New Distance(20, DistanceUnit.StatuteMiles)
Dim Distance3 As New Distance(50, DistanceUnit.Inches)
' Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToNauticalMiles.ToString)
Debug.WriteLine(Distance2.ToNauticalMiles.ToString)
Debug.WriteLine(Distance3.ToNauticalMiles.ToString)
// Create distances of different unit types
Distance Distance1 = new Distance(10, DistanceUnit.Feet);
Distance Distance2 = new Distance(20, DistanceUnit.StatuteMiles);
Distance Distance3 = new Distance(50, DistanceUnit.Inches);
// Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToNauticalMiles().ToString());
Debug.WriteLine(Distance2.ToNauticalMiles().ToString());
Debug.WriteLine(Distance3.ToNauticalMiles().ToString());
ToFeet Method
ToInches Method
ToKilometers Method
ToMeters Method
ToStatuteMiles Method
This method will perform a conversion into feet regardless of the current unit
type. You may convert from any unit type to any unit type.
Converts the current measurement into miles.
A new Distance object containing the converted
value.
This example converts various distances into statute miles. notice that the ToStatuteMiles method
converts distances from any source type.
' Create distances of different unit types
Dim Distance1 As New Distance(10, DistanceUnit.Feet)
Dim Distance2 As New Distance(20, DistanceUnit.StatuteMiles)
Dim Distance3 As New Distance(50, DistanceUnit.Inches)
' Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToStatuteMiles.ToString)
Debug.WriteLine(Distance2.ToStatuteMiles.ToString)
Debug.WriteLine(Distance3.ToStatuteMiles.ToString)
// Create distances of different unit types
Distance Distance1 = new Distance(10, DistanceUnit.Feet);
Distance Distance2 = new Distance(20, DistanceUnit.StatuteMiles);
Distance Distance3 = new Distance(50, DistanceUnit.Inches);
// Convert the distance measurements to feet and output the result
Debug.WriteLine(Distance1.ToStatuteMiles().ToString());
Debug.WriteLine(Distance2.ToStatuteMiles().ToString());
Debug.WriteLine(Distance3.ToStatuteMiles().ToString());
ToFeet Method
ToInches Method
ToKilometers Method
ToMeters Method
ToNauticalMiles Method
This method will perform a conversion into feet regardless of the current unit
type. You may convert from any unit type to any unit type.
Toes the type of the unit.
The new units.
Attempts to adjust the unit type to keep the value above 1 and uses the local region measurement system.
A Distance converted to the chosen unit type.
When a distance becomes smaller, it may make more sense to the
user to be expressed in a smaller unit type. For example, a distance of
0.001 kilometers might be better expressed as 1 meter. This method will
determine the smallest Imperial unit type.
Attempts to adjust the unit type to keep the value above 1 and uses the local region measurement system.
A Distance converted to the chosen unit type.
When a distance becomes smaller, it may make more sense to the
user to be expressed in a smaller unit type. For example, a distance of
0.001 kilometers might be better expressed as 1 meter. This method will
determine the smallest metric unit type.
Attempts to adjust the unit type to keep the value above 1 and uses the local region measurement system.
A Distance converted to the chosen unit type.
When a distance becomes smaller, it may make more sense to the
user to be expressed in a smaller unit type. For example, a distance of
0.001 kilometers might be better expressed as 1 meter. This method will
find the smallest unit type and convert the unit to the user's local
numeric system (Imperial or Metric).
Returns the distance traveled at the current speed for the specified time.
A length of time to travel.
A Distance representing the distance travelled at
the current speed for the specified length of time.
Returns a new instance rounded to the specified number of digits.
An Integer specifying the number of digits to round off to.
Outputs the current instance as a string using the specified format.
A combination of symbols, spaces, and any of the following case-insensitive
letters: # or 0 for the value property, and U for
distance units. Here are some examples:
| ##0.## uu |
## uuuu |
# u |
### |
A String containing the distance in the specified format.
This example uses the ToString method to populate a TextBox with a distance measurement using a custom format.
' Declare a distance of 75 miles
Dim MyDistance As New Distance(75, DistanceUnit.StatuteMiles)
' Set the text box to the distance, formatted as a string
MyTextBox.Text = MyDistance.ToString("## uuu")
// Declare a distance of 75 miles
Distance MyDistance = new Distance(75, DistanceUnit.StatuteMiles);
// Set the text box to the distance, formatted as a string
MyTextBox.Text = MyDistance.ToString("## uuu");
This method allows a custom format to be applied to the ToString method. Numeric formats
will be adjusted to the machine's local UI culture.
Adds the specified value.
The value.
Adds the specified value.
The value.
Subtracts the specified value.
The value.
Subtracts the specified value.
The value.
Multiplies the specified value.
The value.
Multiplies the specified value.
The value.
Divides the specified value.
The value.
Divides the specified value.
The value.
Increments this instance.
Decrements this instance.
Determines whether [is less than] [the specified value].
The value.
true if [is less than] [the specified value]; otherwise, false.
Determines whether [is less than or equal to] [the specified value].
The value.
true if [is less than or equal to] [the specified value]; otherwise, false.
Determines whether [is greater than] [the specified value].
The value.
true if [is greater than] [the specified value]; otherwise, false.
Determines whether [is greater than or equal to] [the specified value].
The value.
true if [is greater than or equal to] [the specified value]; otherwise, false.
Compares the current instance to the specified object.
An Object to compare with.
A Boolean, True if the values are equivalent.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Outputs the current instance as a string using the default format.
A String containing the current distance in the default format.
This example uses the ToString method to populate a TextBox with a distance measurement.
' Declare a distance of 75 miles
Dim MyDistance As New Distance(75, DistanceUnit.StatuteMiles)
' Set the text box to the distance, formatted as a string
MyTextBox.Text = MyDistance.ToString
// Declare a distance of 75 miles
Distance MyDistance = new Distance(75, DistanceUnit.StatuteMiles);
// Set the text box to the distance, formatted as a string
MyTextBox.Text = MyDistance.ToString();
The default format used is "##0.## uu" where uu is the distance unit type.
The numeric format may vary depending on the machine's local culture.
Returns a random distance between 0 and 1, 000 meters.
A Distance containing a random value, converted to local units.
Returns a random distance between 0 and 1, 000 meters.
The generator.
A Distance containing a random value, converted to local units.
Returns a random distance between zero and the specified maximum.
The maximum.
Froms the centimeters.
The value.
Froms the feet.
The value.
Froms the inches.
The value.
Froms the kilometers.
The value.
Froms the meters.
The value.
Froms the nautical miles.
The value.
Froms the statute miles.
The value.
Froms the centimeters.
The value.
Froms the feet.
The value.
Froms the inches.
The value.
Froms the kilometers.
The value.
Froms the meters.
The value.
Froms the nautical miles.
The value.
Froms the statute miles.
The value.
Parses the distance unit.
The value.
Converts a string-based distance measurement into a Distance object.
A String describing a case-insensitive distance measurement,
in any of the following formats, where N represents a numeric
value:
- N m
- N meters
- N meter
- N metre
- N metres
- N km
- N kilometers
- N kilometer
- N kilometre
- N kilometres
- N ft
- N'
- N foot
- N feet
- N in
- N"
- N inch
- N inches
- N mi
- N mile
- N miles
- N nm
- N nautical mile
- N nautical miles
A new Distance object containing the parsed value and
unit type.
Parse method requires a valid distance measurement.
1. The numeric portion of the distance measurement was not recognized.
2. The distance unit type was not recognized or not specified.
This example demonstrates how the Parse method can convert several string formats into a Distance object.
Dim NewDistance As Distance
' Create a distance of 50 kilometers
NewDistance = Distance.Parse("50 km")
' Create a distance of 14, 387 miles, then convert it into inches
NewDistance = Distance.Parse("14, 387 statute miles").ToInches
' Parse an untrimmed measurement into 50 feet
NewDistance = Distance.Parse(" 50 ' ")
Distance NewDistance;
// Create a distance of 50 kilometers
NewDistance = Distance.Parse("50 km");
// Create a distance of 14, 387 miles, then convert it into inches
NewDistance = Distance.Parse("14, 387 statute miles").ToInches;
// Parse an untrimmed measurement into 50 feet
NewDistance = Distance.Parse(" 50 ' ");
This powerful constructor is typically used to convert a string-based distance
measurement, such as one entered by a user or read from a file, into a
Distance object. This method will accept any output created via the
ToString method.
Parses the specified value.
The value.
The culture.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Compares the current instance to the specified distance object.
A Distance object to compare with.
A Boolean, True if the values are equivalent.
This method compares the current instance to the specified object up to four digits of precision.
Compares the current instance to the specified value, distance units, and precision.
A Distance object to compare with.
An Integer specifying the number of digits to compare with.
A Boolean, True if the values are equivalent.
This method compares the current instance to the specified object at up to the specified number of digits of precision.
Outputs the current instance as a string using the specified format and local culture.
A combination of symbols, spaces, and any of the following case-insensitive
letters: # or 0 for the value property, and U for
distance units. Here are some examples:
| ##0.## uu |
## uuuu |
# u |
### |
Information about the culture to apply to the numeric format.
A String containing the distance in the specified format.
This example uses the ToString method to populate a TextBox with a distance measurement using a custom format and culture information.
' Declare a distance of 75 miles
Dim MyDistance As New Distance(75, DistanceUnit.StatuteMiles)
' Set the text box to the distance, formatted as a string
MyTextBox.Text = MyDistance.ToString("## uuu", CultureInfo.CurrentUICulture)
// Declare a distance of 75 miles
Distance MyDistance = new Distance(75, DistanceUnit.StatuteMiles);
// Set the text box to the distance, formatted as a string
MyTextBox.Text = MyDistance.ToString("## uuu", CultureInfo.CurrentUICulture);
This method allows a custom format to be applied to the ToString method. Numeric formats
will be adjusted to the machine's local UI culture.
Compares the current object with another object of the same type.
An object to compare with this object.
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings:
Value
Meaning
Less than zero
This object is less than the parameter.
Zero
This object is equal to .
Greater than zero
This object is greater than .
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Returns the numeric portion of a distance measurement.
A Double value.
This example demonstrates how to use the Value property to modify a distance object. The object
is then converted to kilometers.
' Declare a distance of 0 mi.
Dim MyDistance As New Distance(0, DistanceUnit.StatuteMiles)
' Change the distance to 100 mi.
MyDistance.Value = 100
' Change the distance to 12.3456 mi.
MyDistance.Value = 12.3456
' Convert the measurement into kilometers
MyDistance = MyDistance.ToKilometers
// Declare a distance of 0 mi.
Distance MyDistance = new Distance(0, DistanceUnit.StatuteMiles);
// Change the distance to 100 mi.
MyDistance.Value = 100;
// Change the distance to 12.3456 mi.
MyDistance.Value = 12.3456;
// Convert the measurement into kilometers
MyDistance = MyDistance.ToKilometers;
Units Property
This property is paired with the Units property to form a complete distance
measurement.
Describes the unit portion of a distance measurement.
A value from the DistanceUnit enumeration. Default
is DistanceUnit.Meters.
Value Property
Each distance measurement is comprised of a numeric value
and a unit type. This property describes the numeric value so that it may be
explicitly identified. An instance of the Distance class may have a value
of zero, but it is impossible to have an unspecified unit type.
Use conversion methods instead of setting the
Units property
When the Units property is changed, no conversion is performed on the
Value property. This could lead to mathematical errors which are difficult to debug. Use
conversion methods such as ToFeet or ToMeters instead.
This example demonstrates poor programming when trying to add 100 feet to 100 meters
by changing the Units property of the Distance2 object.
' Declare two distances
Dim Distance1 As New Distance(50, DistanceUnit.Meters)
Dim Distance2 As New Distance(100, DistanceUnit.Feet)
' Store their sum in another variable
Dim Distance3 As New Distance(0, DistanceUnit.Meters)
' INCORRECT: Changing Units property does not convert Distance2!
Distance2.Units = DistanceUnit.Meters
Distance3.Value = Distance1.Value + Distance2.Value
// Declare two distances
Distance Distance1 = new Distance(50, DistanceUnit.Meters);
Distance Distance2 = new Distance(100, DistanceUnit.Feet);
// Store their sum in another variable
Distance Distance3 = new Distance(0, DistanceUnit.Meters);
// INCORRECT: Changing Units property does not convert Distance2!
Distance2.Units = DistanceUnit.Meters;
Distance3.Value = Distance1.Value + Distance2.Value;
The correct technique is to use a conversion method to change the unit type instead
of modifying the Units property.
' Declare two distances
Dim Distance1 As New Distance(50, DistanceUnit.Meters)
Dim Distance2 As New Distance(100, DistanceUnit.Feet)
' Store their sum in another variable
Dim Distance3 As New Distance(0, DistanceUnit.Meters)
' CORRECT: The ToMeters method is used to standardize unit types
Distance3.Value = Distance1.ToMeters().Value + Distance2.ToMeters().Value
// Declare two distances
Distance Distance1 = new Distance(50, DistanceUnit.Meters);
Distance Distance2 = new Distance(100, DistanceUnit.Feet);
// Store their sum in another variable
Distance Distance3 = new Distance(0, DistanceUnit.Meters);
// CORRECT: The ToMeters method is used to standardize unit types
Distance3.Value = Distance1.ToMeters().Value + Distance2.ToMeters().Value;
Returns whether the value is invalid or unspecified.
Returns whether the value is zero.
Returns whether the unit of measurement is metric.
Returns whether the value is infinite.
Indicates the unit of measure for distance measurements.
Value Property (Distance Class)
Units Property (Distance Class)
This enumeration is most frequently used by the
Units property of the
Distance
class in conjunction with the Value
property to describe a straight-line distance.
Metric System. Kilometers (thousands of meters).
Metric System. 1/1000th of a kilometer.
Metric System. 1/100th of a meter.
Nautical miles, also known as "sea miles".
Imperial System. A statute mile, most often referred to just as "mile."
Imperial System. Feet.
Imperial System. Inches.
Represents a vertical angular measurement between -90° and 90°.
These examples create new instances of Elevation objects.
Angle Class
Azimuth Class
Latitude Class
Longitude Class
These examples create new instances of Elevation objects.
Dim MyElevation As New Elevation(90)
Elevation MyElevation = new Elevation(90);
Elevation MyElevation = new Elevation(90);
Dim MyElevation1 As New Elevation(105, 30, 21.4)
Elevation MyElevation = new Elevation(105, 30, 21.4);
Elevation MyElevation = new Elevation(105, 30, 21.4);
This class is used to indicate a vertical angle where 90° represents a point
directly overhead, 0° represents the horizon (striaght ahead), and -90° represents a
point straight down. This class is typically combined with an Elevation
object (which measures a horizontal angle) to form a three-dimensional direction to an
object in space, such as a GPS satellite.
Represents the minimum value of an angle in one turn of a circle.
This example creates an angle representing the minimum allowed value.
Dim MyElevation As Elevation = Elevation.Minimum
Elevation MyElevation = Elevation.Minimum;
Elevation MyElevation = Elevation.Minimum;
An Elevation with a value of -359.999999°.
Represents an angle with no value.
An Elevation containing a value of zero (0°).
IsEmpty Property
Represents an angle with infinite value.
Represents an invalid or unspecified value.
Represents the maximum value of an angle in one turn of a circle.
This example creates an angle representing the maximum allowed value of 359.9999°.
Dim MyElevation As Elevation = Elevation.Maximum
Elevation MyElevation = Elevation.Maximum;
Represents the point directly overhead.
An Elevation object.
Represents a vertical direction halfway up from the horizon.
An Elevation object.
Represents a vertical direction halfway below the horizon.
An Elevation object.
An Elevation object.
Represents the point directly below one's feet.
An Elevation object.
Creates a new instance with the specified decimal degrees.
The decimal degrees.
This example demonstrates how to create an angle with a measurement of 90°.
Dim MyElevation As New Elevation(90)
Elevation MyElevation = new Elevation(90);
An Elevation containing the specified value.
Creates a new instance with the specified degrees.
The hours.
An Elevation containing the specified value.
Creates a new instance with the specified hours and decimal minutes.
The hours.
The decimal minutes.
This example demonstrates how an angle can be created when only the hours and
minutes (in decimal form) are known. This creates a value of 12°42.345'.
Dim MyElevation As New Elevation(12, 42.345)
Elevation MyElevation = new Elevation(12, 42.345);
An Elevation containing the specified value.
Creates a new instance with the specified hours, minutes and
seconds.
The hours.
The minutes.
The seconds.
This example demonstrates how to create an angular measurement of 34°12'29.2 in
hours, minutes and seconds.
Dim MyElevation As New Elevation(34, 12, 29.2)
Elevation MyElevation = new Elevation(34, 12, 29.2);
An Elevation containing the specified value.
Creates a new instance by converting the specified string.
The value.
Parse Method
This example creates a new instance by parsing a string. (notice The double-quote is
doubled up to represent a single double-quote in the string.)
Dim MyElevation As New Elevation("123°45'67.8""")
Elevation MyElevation = new Elevation("123°45'67.8\"");
An Elevation containing the specified value.
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
This constructor parses the specified string into an Elevation
object using the current culture. This constructor can parse any strings created via
the ToString method.
Creates a new instance by converting the specified string using the specified
culture.
The value.
The culture.
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
This constructor parses the specified string into an Elevation
object using a specific culture. This constructor can parse any strings created via the
ToString method.
Creates a new instance by deserializing the specified XML.
The reader.
Normalizes this instance.
Converts a measurement to its equivalent value between -90 and
90 degrees.
Returns the smallest integer greater than the specified value.
Returns the largest integer which is smaller than the specified value.
Returns a new instance whose value is rounded the specified number of decimals.
An Integer specifying the number of decimals to round off to.
Returns a new instance whose Seconds property is evenly divisible by 15.
An Elevation containing the rounded value.
This method is used to align or "snap" an angle to a regular interval. For
example, a grid might be easier to read if it were drawn at 30-second intervals instead
of 24.198-second intervals.
Returns a new angle whose Seconds property is evenly divisible by the specified amount.
A Double between 0 and 60 indicating the interval to round
to.
An Elevation containing the rounded value.
This method is used to align or "snap" an angle to a regular interval. For
example, a grid might be easier to read if it were drawn at 30-second intervals instead
of 24.198-second intervals.
Returns the object with the smallest value.
An Elevation object to compare to the current instance.
The Elevation containing the smallest value.
Returns the object with the largest value.
An Elevation object to compare to the current instance.
An Elevation containing the largest value.
Returns an angle opposite of the current instance.
An Elevation representing the mirrored value.
This example creates a new Elevation of 45° then calculates its mirror
of 225°. (45 + 180)
Dim Elevation1 As New Elevation(45)
Dim Elevation2 As Elevation = Elevation1.Mirror()
Debug.WriteLine(Elevation2.ToString())
' Output: 225
Elevation Elevation1 = new Elevation(45);
Elevation Elevation2 = Elevation1.Mirror();
Console.WriteLine(Elevation2.ToString());
// Output: 225
This method returns the "opposite" of the current instance. The opposite is
defined as the point on the other side of an imaginary circle. For example, if an angle
is 0°, at the top of a circle, this method returns 180°, at the bottom of the
circle.
Converts the current instance into radians.
A Radian object.
Radian Class
Converts an angular measurement into radians before further processing.
This example converts a measurement of 90° into radians.
Dim MyElevation As New Elevation(90)
Dim MyRadians As Radian = MyElevation.ToRadians()
Elevation MyElevation = new Elevation(90);
Radian MyRadians = MyElevation.ToRadians();
This function is typically used to convert an angular measurement into
radians before performing a trigonometric function.
Outputs the angle as a string using the specified format.
The format.
A String in the specified format.
ToString Method
Parse Method
This example uses the ToString method to output an angle in a
custom format. The " h° " code represents hours along with a
degree symbol (Alt+0176 on the keypad), and " m.mm " represents
the minutes out to two decimals. Mmm.
Dim MyElevation As New Elevation(45, 16.772)
Debug.WriteLine(MyElevation.ToString("h°m.mm"))
' Output: 45°16.78
Dim MyElevation As New Elevation(45, 16.772);
Debug.WriteLine(MyElevation.ToString("h°m.mm"));
// Output: 45°16.78
This method returns the current instance output in a specific format. If no
value for the format is specified, a default format of "d.dddd°" is used. Any
string output by this method can be converted back into an Elevation object using the
Parse method or Elevation(string) constructor.
Compares the current value to another Elevation object's value.
An Elevation, Double, or Integer
to compare with.
A Boolean, True if the object's DecimalDegrees
properties match.
This
Returns a unique code for this instance.
An Integer representing a unique code for the current
instance.
Since the Elevation class is immutable, this property may be used
safely with hash tables.
Outputs the angle as a string using the default format.
A String created using the default format.
Parse Method
This example outputs a value of 90 degrees in the default format of ###.#°.
Dim MyElevation As New Elevation(90)
Debug.WriteLine(MyElevation.ToString)
' Output: "90°"
Elevation MyElevation = new Elevation(90);
Debug.WriteLine(MyElevation.ToString());
// Output: "90°"
This method formats the current instance using the default format of
"d.dddd°." Any string output by this method can be converted back into an Elevation
object using the Parse method or Elevation(string)
constructor.
Normalizes the specified decimal degrees.
The decimal degrees.
Converts a measurement to its equivalent value between -90 and
90 degrees.
Converts arbitrary hour, minute and seconds into decimal degrees.
The hours.
The minutes.
The seconds.
A Double containing the decimal degree version of the specified
values.
DecimalDegrees Property
Normalize Method
This example converts a value of 10°30'0" into decimal degrees (10.5).
Dim MyValue As Double = Latitude.ToDecimalDegrees(10, 30, 0)
double MyValue = Latitude.ToDecimalDegrees(10, 30, 0);
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Converts arbitrary hour and decimal minutes into decimal degrees.
The hours.
The decimal minutes.
A Double containing the decimal degree version of the specified
values.
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Converts an hour value into decimal degrees.
The hours.
A Double containing the decimal degree version of the specified
values.
The specified value will be converted to a double value.
Returns a random angle between 0° and 360°.
An Elevation containing a random value.
Returns a random Elevation between 0° and 360° using the specified random number
seed.
A Random object used to ogenerate random values.
An Elevation containing a random value.
Returns the object with the smallest value.
A Elevation object to compare to value2.
A Elevation object to compare to value1.
The Elevation containing the smallest value.
Returns the object with the largest value.
A Elevation object to compare to value2.
A Elevation object to compare to value1.
A Elevation containing the largest value.
Converts an angular measurement into radians.
The value.
A Radian object.
This example shows a quick way to convert an angle of 90° into radians.
Dim MyRadian As Radian = Elevation.ToRadians(90)
Radian MyRadian = Elevation.ToRadians(90);
This function is typically used to convert an angular measurement into
radians before performing a trigonometric function.
Converts a value in radians into an angular measurement.
The radians.
ToRadians
Radian Class
This example uses the FromRadians method to convert a value of one
radian into an Elevation of 57°.
' Create a new angle equal to one radian
Dim MyRadians As New Radian(1)
Dim MyElevation As Elevation = Elevation.FromRadians(MyRadians)
Debug.WriteLine(MyElevation.ToString())
' Output: 57°
// Create a new angle equal to one radian
Radian MyRadians = new Radian(1);
Elevation MyElevation = Elevation.FromRadians(MyRadians);
Console.WriteLine(MyElevation.ToString());
// Output: 57°
This function is typically used in conjunction with the
ToRadians
method after a trigonometric function has completed. The converted value is stored in
the DecimalDegrees property.
Froms the radians.
The radians.
Converts the specified string into an Elevation object.
The value.
A new Elevation object populated with the specified
values.
ToString Method
This example creates a new angular measurement using the Parse
method.
Dim NewElevation As Elevation = Elevation.Parse("123.45°")
Elevation NewElevation = Elevation.Parse("123.45°");
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
This method parses the specified string into an Elevation object
using the current culture. This constructor can parse any strings created via the
ToString method.
Converts the specified string into an Elevation object using the
specified culture.
A String describing an angle in the form of decimal degrees or a
sexagesimal.
A CultureInfo object describing the numeric format to use during
conversion.
A new Elevation object equivalent to the specified string.
This powerful method is typically used to process data from a data store or a
value input by the user in any culture. This function can accept any format which
can be output by the ToString method.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Returns the current instance increased by one.
An Elevation object.
This example uses the Increment method to increase an Elevation's
value. It also demonstrates the subtle error which can be caused if
Increment is called while ignoring the return value.
' Correct use of Increment
Dim Elevation1 As New Elevation(89)
Elevation1 = Elevation1.Increment()
' Incorrect use of Increment
Dim Elevation1 = New Elevation(89)
Elevation1.Increment()
'notice Elevation1 will still be 89°!
// Correct use of Increment
Elevation Elevation1 = new Elevation(89);
Elevation1 = Elevation1.Increment();
// Incorrect use of Increment
Elevation Elevation1 = new Elevation(89);
Elevation1.Increment();
//notice Elevation1 will still be 89°!
This method increases the DecimalDegrees property by 1.0,
returned as a new instance.
Since the Elevation class is immutable, this
method cannot be used to modify an existing instance.
Increases the current instance by the specified value.
A Double to add to the current instance.
A new Elevation containing the summed values.
This example adds 45° to the current instance of 45°, returning 90°.
Dim Elevation1 As New Elevation(45)
Elevation1 = Elevation1.Add(45)
Elevation Elevation1 = new Elevation(45);
Elevation1 = Elevation1.Add(45);
Adds the specified value.
The value.
Returns the current instance decreased by one.
An Elevation object.
This example uses the Decrement method to decrease an Elevation's
value. It also demonstrates the subtle error which can be caused if
Decrement is called while ignoring the return value.
' Correct use of Decrement
Dim Elevation1 As New Elevation(91)
Elevation1 = Elevation1.Decrement()
' Incorrect use of Decrement
Dim Elevation1 = New Elevation(91)
Elevation1.Increment()
' notice Elevation1 will still be 91°!
// Correct use of Decrement
Elevation Elevation1 = new Elevation(91);
Elevation1 = Elevation1.Decrement();
// Incorrect use of Decrement
Elevation Elevation1 = new Elevation(91);
Elevation1.Decrement();
// notice Elevation1 will still be 91°!
This method decreases the DecimalDegrees property by 1.0,
returned as a new instance.
Since the Elevation class is immutable, this
method cannot be used to modify an existing instance.
Decreases the current instance by the specified value.
A Double to subtract from the current instance.
A new Elevation containing the new value.
This example subtracts 30° from the current instance of 90°, returning 60°.
Dim Elevation1 As New Elevation(90)
Elevation1 = Elevation1.Subtract(30)
Elevation Elevation1 = new Elevation(90);
Elevation1 = Elevation1.Subtract(30);
Subtracts the specified value.
The value.
Multiplies the current instance by the specified value.
A Double to multiply with the current instance.
A new Elevation containing the product of the two numbers.
This example multiplies 30° with three, returning 90°.
Dim Elevation1 As New Elevation(30)
Elevation1 = Elevation1.Multiply(3)
Elevation Elevation1 = new Elevation(30);
Elevation1 = Elevation1.Multiply(3);
Multiplies the specified value.
The value.
Divides the current instance by the specified value.
A Double representing a denominator to divide by.
An Elevation containing the new value.
This example divides 90° by three, returning 30°.
Dim Elevation1 As New Elevation(90)
Elevation1 = Elevation1.Divide(3)
Elevation Elevation1 = new Elevation(90);
Elevation1 = Elevation1.Divide(3);
Divides the specified value.
The value.
Indicates if the current instance is smaller than the specified value.
An Elevation to compare with the current instance.
A Boolean, True if the current instance is
smaller than the specified value.
Determines whether [is less than] [the specified value].
The value.
true if [is less than] [the specified value]; otherwise, false.
Indicates if the current instance is smaller than or equal to the specified
value.
An Elevation to compare with the current instance.
A Boolean, True if the current instance is
smaller than or equal to the specified value.
This method compares the DecimalDegrees property with the
specified value. This method is the same as the "<=" operator.
Determines whether [is less than or equal to] [the specified value].
The value.
true if [is less than or equal to] [the specified value]; otherwise, false.
Indicates if the current instance is larger than the specified value.
An Elevation to compare with the current instance.
A Boolean, True if the current instance is
greater than the specified value.
Determines whether [is greater than] [the specified value].
The value.
true if [is greater than] [the specified value]; otherwise, false.
Indicates if the current instance is larger than or equal to the specified
value.
An Elevation to compare with the current instance.
A Boolean, True if the current instance is
greater than or equal to the specified value.
Determines whether [is greater than or equal to] [the specified value].
The value.
true if [is greater than or equal to] [the specified value]; otherwise, false.
Converts a measurement in Radians into an Elevation.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Elevation.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Elevation.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Elevation.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Elevation.
The value.
The result of the conversion.
Converts a measurement in degrees as an Integer into an Elevation.
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Converts a measurement in the form of a formatted String into an Elevation.
The value.
The result of the conversion.
Converts an Elevation into a String.
The value.
The result of the conversion.
This operator calls the ToString() method using the current culture.
Creates a copy of the current instance.
An Elevation of the same value as the current instance.
Outputs the angle as a string using the specified format.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A String in the specified format.
ToString Method
Parse Method
This example uses the ToString method to output an angle in a
custom format. The " h° " code represents hours along with a
degree symbol (Alt+0176 on the keypad), and " m.mm " represents
the minutes out to two decimals. Mmm.
Dim MyElevation As New Elevation(45, 16.772)
Debug.WriteLine(MyElevation.ToString("h°m.mm", CultureInfo.CurrentCulture))
' Output: 45°16.78
Dim MyElevation As New Elevation(45, 16.772);
Debug.WriteLine(MyElevation.ToString("h°m.mm", CultureInfo.CurrentCulture));
// Output: 45°16.78
This method returns the current instance output in a specific format. If no
value for the format is specified, a default format of "d.dddd" is used. Any string
output by this method can be converted back into an Elevation object using the
Parse method or Elevation(string) constructor.
Compares the current instance to another instance using the specified
precision.
The value.
The decimals.
A Boolean, True if the
DecimalDegrees property of the current instance matches the
specified instance's DecimalDegrees property.
Equals Method
These examples compare two fractional values using specific numbers of digits for
comparison.
' Equals will return False
Dim Elevation1 As New Elevation(90.15);
Dim Elevation2 As New Elevation(90.12);
If Elevation1.Equals(Elevation2, 2) Then
Debug.WriteLine("The values are the same to two digits of precision.");
' Equals will return True
Dim Elevation1 As New Elevation(90.15);
Dim Elevation2 As New Elevation(90.12);
If Elevation1.Equals(Elevation2, 1) Then
Debug.WriteLine("The values are the same to one digit of precision.");
// Equals will return False
Elevation Elevation1 = new Elevation(90.15);
Elevation Elevation2 = new Elevation(90.12);
if (Elevation1.Equals(Elevation2, 2))
Console.WriteLine("The values are the same to two digits of precision.");
// Equals will return True
Elevation Elevation1 = new Elevation(90.15);
Elevation Elevation2 = new Elevation(90.12);
if (Elevation1.Equals(Elevation2, 1))
Console.WriteLine("The values are the same to one digits of precision.");
This is typically used in cases where precision is only significant for a few
digits and exact comparison is not necessary.
notice This method compares objects by value, not by
reference.
Equalses the specified value.
The value.
Whether the two elevations are equivalent.
Returns a value indicating the relative order of two objects.
An Elevation object to compare with.
A value of -1, 0, or 1 as documented by the IComparable interface.
This method allows collections of Azimuth objects to be sorted.
The DecimalDegrees property of each instance is compared.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Returns the value of the angle as decimal degrees.
A Double value.
Hours Property
Minutes Property
Seconds Property
This example demonstrates how the
DecimalDegrees property is
calculated automatically when creating an angle using hours, minutes and seconds.
' Create an angle of 20°30'
Dim MyElevation As New Elevation(20, 30)
' Setting the DecimalMinutes recalculated other properties
Debug.WriteLine(MyElevation.DecimalDegrees)
' Output: "20.5" the same as 20°30'
// Create an angle of 20°30'
Elevation MyElevation = New Elevation(20, 30);
// Setting the DecimalMinutes recalculated other properties
Console.WriteLine(MyElevation.DecimalDegrees)
// Output: "20.5" the same as 20°30'
This property returns the value of the angle as a single number.
Returns the minutes and seconds as a single numeric value.
A Double value.
Minutes Property
DecimalDegrees Property
This example demonstrates how the DecimalMinutes property is
automatically calculated when creating a new angle.
' Create an angle of 20°10'30"
Dim MyElevation As New Elevation(20, 10, 30)
' The DecimalMinutes property is automatically calculated
Debug.WriteLine(MyElevation.DecimalMinutes)
' Output: "10.5"
// Create an angle of 20°10'30"
Elevation MyElevation = new Elevation(20, 10, 30);
// The DecimalMinutes property is automatically calculated
Console.WriteLine(MyElevation.DecimalMinutes)
// Output: "10.5"
This property is used when minutes and seconds are represented as a single
decimal value.
Returns the integer hours (degrees) portion of an angular
measurement.
An Integer value.
Minutes Property
Seconds Property
This example creates an angle of 60.5° then outputs the value of the
Hours property, 60.
Dim MyElevation As New Elevation(60.5)
Debug.WriteLine(MyElevation.Hours)
' Output: 60
Elevation MyElevation = new Elevation(60.5);
Console.WriteLine(MyElevation.Hours);
// Output: 60
This property is used in conjunction with the Minutes
and Seconds properties to create a full angular measurement.
This property is the same as DecimalDegrees without any fractional
value.
Returns the integer minutes portion of an angular measurement.
An Integer.
Hours Property
Seconds Property
This example creates an angle of 45.5° then outputs the value of the
Minutes property, 30.
Dim MyElevation As New Elevation(45.5)
Debug.WriteLine(MyElevation.Minutes)
' Output: 30
Elevation MyElevation = new Elevation(45.5);
Console.WriteLine(MyElevation.Minutes);
// Output: 30
This property is used in conjunction with the Hours and
Seconds properties to create a sexagesimal
measurement.
Returns the seconds minutes portion of an angular measurement.
A Double value.
Hours Property
Minutes Property
This example creates an angle of 45°10.5' then outputs the value of the
Seconds property, 30.
Dim MyElevation As New Elevation(45, 10.5)
Debug.WriteLine(MyElevation.Seconds)
' Output: 30
Dim MyElevation As New Elevation(45, 10.5);
Console.WriteLine(MyElevation.Seconds);
// Output: 30
This property is used in conjunction with the Hours and
Minutes properties to create a sexagesimal
measurement.
Indicates if the current instance has a non-zero value.
A Boolean, True if the
DecimalDegrees property is zero.
Empty Field
Indicates if the current instance represents an infinite value.
Indicates if the current instance is invalid or unspecified.
Indicates whether the current instance has been normalized and is within the
allowed bounds of -90° and 90°.
Represents a flattened sphere which approximates Earth's size and shape.
Mathematics involving points on Earth's surface are difficult to perform with
precision because the Earth's surface is rugged. In order to maximize precision,
scientists developed "ellipsoids," smooth ellipsoidal shapes (known as "oblate
spheriods" or flattened spheres) which attempt to approximate Earth's exact shape.
Like datums, ellipsoids have been subject to frequent revisions thanks to advances
in technology, yet countries cannot quickly abandon outdated ellipsoids because so
much infrastructure is built upon them. As a result, multiple ellipsoids are
tracked and utilized when converting coordinates from one locale to another. Today,
there are approximately thirty known ellipsoids upon which an estimated 120
individual coordinate systems are built.
This class is typically used during coordinate conversion to convert from one
interpretation of Earth's shape to another. All known worldwide ellipsoids such as
WGS84 and Clarke 1880 are provided as static (Shared in Visual Basic) fields. Most
developers will not have to use this class until coordinates must be plotted on a
map. For most purposes, using the default ellipsoid of WGS84 is sufficient.
Instances of this class are guaranteed to be thread-safe because the class is
immutable (its properties can only be set via constructors).
Represents the Airy ellipsoid of 1830.
Represents the Modified Airy ellipsoid.
Represents the Australian National ellipsoid of 1965.
Represents the Bessel ellipsoid of 1841.
Represents the Bessel Modified ellipsoid of 1841.
Represents the Bessel (Namibia) ellipsoid of 1841.
Represents the Clarke ellipsoid of 1858.
Represents the Clarke ellipsoid of 1866.
Represents the Clarke (Michigan) ellipsoid of 1866.
Represents the Clarke (Benoit) ellipsoid of 1880.
Represents the Clarke (IGN) ellipsoid of 1880.
Represents the Clarke (RGS) ellipsoid of 1880.
Represents the Clarke (Arc) ellipsoid of 1880.
Represents the Clarke (SGA 1822) ellipsoid of 1880.
Represents the Everest (1937 Adjustment) ellipsoid of 1830.
Represents the Everest (1967 Definition) ellipsoid of 1830.
Represents the Everest (Modified 1948) ellipsoid of 1880.
Represents the Geodetic Reference System ellipsoid of 1980.
Represents the Helmert ellipsoid of 1906.
Represents the Indonesian ellipsoid of 1974.
Represents the International ellipsoid of 1909 (1924 alias).
Represents the International ellipsoid of 1924.
Represents the Krassovsky ellipsoid of 1940.
Represents the Naval Weapons Lab ellipsoid of 1965.
Represents the Plessis ellipsoid of 1817.
Represents the Struve ellipsoid of 1860.
Represents the War Office ellipsoid.
Represents the World Geodetic System ellipsoid of 1984.
Represents the GEM 10C Gravity Potential Model ellipsoid.
Represents the OSU86 gravity potential (geoidal) model ellipsoid.
Represents the OSU91 gravity potential (geoidal) model ellipsoid.
Represents the Clarke ellipsoid of 1880.
Represents the Authalic Sphere (r=6371000).
Represents the Geodetic Reference System ellipsoid of 1967.
Represents the Average Terrestrial System ellipsoid of 1977.
Represents the Everest (1830 Definition) ellipsoid.
Represents the World Geodetic System ellipsoid of 1972.
Represents the Everest (1962 Definition) ellipsoid of 1830.
Represents the Everest (1975 Definition) ellipsoid of 1830.
Represents the Bessel (Japan) ellipsoid of 1841.
Represents the GRS 1980 Authalic Sphere (r=6371007).
Represents the Xian ellipsoid of 1980.
Represents the IAU ellipsoid of 1976.
Represents the Geodetic Reference System (SAD69) ellipsoid of 1967.
Represents the Danish ellipsoid of 1876.
Represents the Andrae (Danish 1876 alternate) ellipsoid of 1876.
Represents the Common Sphere (Clarke 1866 Authalic Sphere alias).
Represents the Clarke 1866 Authalic Sphere (r=6370997).
Represents the Hough ellipsoid of 1960.
Represents the PZ90 ellipsoid.
Represents the Clarke (international foot) ellipsoid of 1880.
Represents the Everest (RSO 1969) ellipsoid of 1880.
Represents the International 1924 Authalic Sphere.
Represents the Hughes ellipsoid of 1980.
Represents the Applied Physics ellipsoid of 1965.
Represents the Comm. des Poids et Mesures ellipsoid of 1799.
Represents the Delambre (Belgium) ellipsoid of 1810.
Represents the Engelis ellipsoid of 1985.
Represents the Fisher ellipsoid of 1960.
Represents the Modified Fisher ellipsoid of 1960.
Represents the Fisher ellipsoid of 1968.
Represents the New International ellipsoid of 1967.
Represents the Kaula ellipsoid of 1961.
Represents the Lerch ellipsoid of 1979.
Represents the MERIT ellipsoid of 1983.
Represents the Maupertius ellipsoid of 1738.
Represents the Southeast Asia (Modified Fisher ellipsoid of 1960) ellipsoid.
Represents the SGS ellipsoid of 1985.
Represents the South American ellipsoid of 1969.
Represents the Walbeck ellipsoid.
Represents the World Geodetic System ellipsoid of 1960.
Represents the World Geodetic System ellipsoid of 1966.
Represents the default ellipsoid, WGS1984.
Creates a new instance with the specified type, name, equatorial raduis and polar radius.
The name.
The equatorial radius.
The polar radius.
This constructor allows user-defined ellipsoids to be created for specialized applications.
Internal contructor for static list generation
The name.
The equatorial radius.
The inverse flattening.
Internal contructor for static list generation
The epsg number.
A.
The invf.
The b.
The name.
Creates a new instance from the specified XML.
The reader.
Validates the ellipsoid. Called in the constructor.
Calculates the common ellipsoid properties. Called from the constructor
Determines whether the specified is equal to this instance.
The to compare with the current .
true if the specified is equal to this instance; otherwise, false.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a that represents this instance.
A that represents this instance.
Returns a Ellipsoid object matching the specified name.
A String describing the name of an existing Ellipsoid.
A Ellipsoid object matching the specified string, or null if no Ellipsoid was found.
Returns the datum corresponding to the EPSG code
The epsg number.
Returns whether the current ellipsoid has the same value as the specified ellipsoid.
An Ellipsoid object to compare against.
A Boolean, True if the equatorial radius and polar radius
of both ellipsoids are equal. When both radii are equal, all other calculated properties will also
be equal. The name of the ellipsoid is not compared.
Returns whether the current ellipsoid has the same value as the specified ellipsoid.
An Ellipsoid object to compare against.
An integer specifies the precision for the comparison.
A Boolean, True if the equatorial radius and polar radius
of both ellipsoids are equal. When both radii are equal, all other calculated properties will also
be equal. The name of the ellipsoid is not compared.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Called when [read XML].
The reader.
European Petroleum Survey Group number for this ellipsoid. The ESPG standards are now maintained by OGP
(International Association of Oil and Gas Producers).
Indicates the descriptive name of the ellipsoid.
A String containing the name of the ellipsoid.
This property is typically used to display ellipsoid information on a user interface.
Represents the distance from Earth's center to the equator.
A Distance object.
PolarRadius Property
This property defines the radius of the Earth from its center to the equator.
This property is used in conjunction with the PolarRadius property
to define an ellipsoidal shape. This property returns the same value as the
SemiMajorAxis property.
Represents the distance from Earth's center to the North or South pole.
A Distance object.
EquatorialRadius Property
This property defines the radius of the Earth from its center to the equator.
This property is used in conjunction with the EquatorialRadius
property to define an ellipsoidal shape. This property returns the same value as
the SemiMinorAxis property.
Represents the distance from Earth's center to the equator.
A Distance containing Earth's equatorial radius.
EquatorialRadius Property
This property defines the radius of the Earth from its center to the equator.
This property is used in conjunction with the SemiMinorAxis
property to define an ellipsoidal shape. This property returns the same value as
the EquatorialRadius property.
Represents the distance from Earth's center to the North or South pole.
A Distance containing Earth's polar radius.
EquatorialRadius Property
This property defines the radius of the Earth from its center to the equator.
This property is used in conjunction with the SemiMajorAxis
property to define an ellipsoidal shape. This property returns the same value as
the PolarRadius property.
Indicates if the ellipsoid is describing a perfect sphere.
Mathematical formulas such as map projection and coordinate conversion can be
optimized if the ellipsoid they are working with is spherical. For more precise
results, however, spherical ellipsoids should not be used. This property, when used
correctly, can improve performance for mathematics when coordinate precision is less of
a concern, such as viewing a map from a high altitude.
Indicates the inverse of the shape of an ellipsoid relative to a sphere.
A Double containing the ellipsoid's flattening.
EquatorialRadius Property
This property is used frequently in equations. Inverse flattening is defined as
one divided by the Flattening property.:
Indicates the shape of the ellipsoid relative to a sphere.
A Double containing the ellipsoid's flattening.
EquatorialRadius Property
This property compares the equatorial radius with the polar radius to measure the
amount that the ellipsoid is "squished" vertically.
Returns the rate of flattening of the ellipsoid.
A Double measuring how elongated the ellipsoid is.
The eccentricity is a positive number less than 1, or 0 in the case of a circle.
The greater the eccentricity is, the larger the ratio of the equatorial radius to the
polar radius is, and therefore the more elongated the ellipse is.
Returns the square of the eccentricity.
This property returns the value of the Eccentricity property,
squared. It is used frequently during coordinate conversion formulas.
Gets the polar radius meters.
Gets the equatorial radius meters.
Gets the semi major axis meters.
Gets the semi minor meters.
Represents information about an angle when an angle-related event is raised.
This example demonstrates how to use AngleEventArgs when raising
an event.
' Declare a new event
Dim MyAngleEvent As AngleEventHandler
Sub Main()
' Create an angle of 90°
Dim MyAngle As New Angle(90);
' Raise our custom Event
RaiseEvent MyAngleEvent(Me, New AngleEventArgs(MyAngle));
End Sub
// Declare a new event
AngleEventHandler MyAngleEvent;
void Main()
{
// Create an angle of 90°
Angle MyAngle = new Angle(90);
// Raise our custom event
if (MyAngleEvent != null)
MyAngleEvent(this, new AngleEventArgs(MyAngle));
}
Angle Class
This class is used for events which use an Angle as a
parameter.
Creates a new instance containing the specified Angle object.
The angle.
Represents information about an angular measurement when an angle-related event is raised.
An Angle object containing a property which has changed.
Angle Class
This class is used by the Angle class to provide notification when hours, minutes, or seconds properties have changed.
Represents information about a area when an area-related event is raised.
This example demonstrates how to use the AreaEventArgs class when
raising an event.
' Declare a new event
Dim MyAreaEvent As AreaEventHandler
Sub Main()
' Create a Area of 125 kilometers
Dim MyArea As New Area(125, AreaUnit.SquareKilometers)
' Raise our custom event
RaiseEvent MyAreaEvent(Me, New AreaEventArgs(MyArea))
End Sub
// Declare a new event
AreaEventHandler MyAreaEvent;
void Main()
{
// Create a Area of 125 kilometers
Area MyArea = new Area(125, AreaUnit.SquareKilometers);
// Raise our custom event
if (MyAreaEvent != null)
MyAreaEvent(this, New AreaEventArgs(MyArea));
}
Area Class
Creates a new instance containing the specified Area object.
The value.
Represents information about a Area measurement when an Area-related event is raised.
A Area object containing a property which has changed.
Area Class
This class is used by the Area class to provide notification
when hours, minutes, or seconds properties have changed.
Represents information about an angle when an angle-related event is raised.
This example demonstrates how to use AzimuthEventArgs when raising
an event.
' Declare a new event
Dim MyAzimuthEvent As AzimuthEventHandler
Sub Main()
' Create an angle of 90°
Dim MyAzimuth As New Azimuth(90);
' Raise our custom Event
RaiseEvent MyAzimuthEvent(Me, New AzimuthEventArgs(MyAzimuth));
End Sub
// Declare a new event
AzimuthEventHandler MyAzimuthEvent;
void Main()
{
// Create an angle of 90°
Azimuth MyAzimuth = new Azimuth(90);
// Raise our custom event
if (MyAzimuthEvent != null)
MyAzimuthEvent(this, new AzimuthEventArgs(MyAzimuth));
}
Azimuth Class
This class is used for events which use an Azimuth as a
parameter.
Creates a new instance containing the specified Azimuth object.
The angle.
Represents information about an angular measurement when an angle-related event is raised.
An Azimuth object containing a property which has changed.
Azimuth Class
This class is used by the Azimuth class to provide notification when hours, minutes, or seconds properties have changed.
Initializes a new instance of the class.
if set to true [is canceled].
Controls whether an operation is to be aborted.
true if canceled; otherwise, false.
This property, when set to True will signal that a pending operation should not execute. For example,
an event which is raised immediately before connecting would check this property to determine whether to
continue connecting, or exit.
Represents information about a distance when an distance-related event is raised.
This example demonstrates how to use this class when raising an event.
' Declare a new event
Dim MyDistanceEvent As DistanceEventHandler
' Create a distance of 125 kilometers
Dim MyDistance As New Distance(125, DistanceUnit.Kilometers)
Sub Main()
' Raise our custom event
RaiseEvent MyDistanceEvent(Me, New DistanceEventArgs(MyDistance))
End Sub
// Declare a new event
DistanceEventHandler MyDistanceEvent;
// Create a distance of 125 kilometers
Distance MyDistance = new Distance(125, DistanceUnit.Kilometers);
void Main()
{
// Raise our custom event
MyDistanceEvent(this, New DistanceEventArgs(MyDistance));
}
Distance Class
This class is typically used for events in the Distance class to
provide notification when hours, minutes, decimal minutes or seconds properties have changed.
Creates a new instance containing the specified Distance object.
The value.
Represents information about a distance measurement when an distance-related event is raised.
A Distance object containing a property which has changed.
Distance Class
This class is used by the Distance class to provide notification
when hours, minutes, or seconds properties have changed.
Represents information about an angle when an angle-related event is raised.
This example demonstrates how to use ElevationEventArgs when raising
an event.
' Declare a new event
Dim MyElevationEvent As ElevationEventHandler
Sub Main()
' Create an angle of 90°
Dim MyElevation As New Elevation(90);
' Raise our custom Event
RaiseEvent MyElevationEvent(Me, New ElevationEventArgs(MyElevation));
End Sub
// Declare a new event
ElevationEventHandler MyElevationEvent;
void Main()
{
// Create an angle of 90°
Elevation MyElevation = new Elevation(90);
// Raise our custom event
if (MyElevationEvent != null)
MyElevationEvent(this, new ElevationEventArgs(MyElevation));
}
Elevation Class
This class is used for events which use an Elevation as a
parameter.
Creates a new instance containing the specified Elevation object.
The angle.
Represents information about an angular measurement when an angle-related event is raised.
An Elevation object containing a property which has changed.
Elevation Class
This class is used by the Elevation class to provide notification when hours, minutes, or seconds properties have changed.
Represents information about an angle when an angle-related event is raised.
This example demonstrates how to use LatitudeEventArgs when raising
an event.
' Declare a new event
Dim MyLatitudeEvent As LatitudeEventHandler
Sub Main()
' Create an angle of 90°
Dim MyLatitude As New Latitude(90);
' Raise our custom Event
RaiseEvent MyLatitudeEvent(Me, New LatitudeEventArgs(MyLatitude));
End Sub
// Declare a new event
LatitudeEventHandler MyLatitudeEvent;
void Main()
{
// Create an angle of 90°
Latitude MyLatitude = new Latitude(90);
// Raise our custom event
if (MyLatitudeEvent != null)
MyLatitudeEvent(this, new LatitudeEventArgs(MyLatitude));
}
Latitude Class
This class is used for events which use an Latitude as a
parameter.
Creates a new instance containing the specified Latitude object.
The angle.
Represents information about an angular measurement when an angle-related event is raised.
An Latitude object containing a property which has changed.
Latitude Class
This class is used by the Latitude class to provide notification when hours, minutes, or seconds properties have changed.
Represents information about an angle when an angle-related event is raised.
This example demonstrates how to use LongitudeEventArgs when raising
an event.
' Declare a new event
Dim MyLongitudeEvent As LongitudeEventHandler
Sub Main()
' Create an angle of 90°
Dim MyLongitude As New Longitude(90);
' Raise our custom Event
RaiseEvent MyLongitudeEvent(Me, New LongitudeEventArgs(MyLongitude));
End Sub
// Declare a new event
LongitudeEventHandler MyLongitudeEvent;
void Main()
{
// Create an angle of 90°
Longitude MyLongitude = new Longitude(90);
// Raise our custom event
if (MyLongitudeEvent != null)
MyLongitudeEvent(this, new LongitudeEventArgs(MyLongitude));
}
Longitude Class
This class is used for events which use an Longitude as a
parameter.
Creates a new instance containing the specified Longitude object.
The longitude.
Represents information about an angular measurement when an angle-related event is raised.
An Longitude object containing a property which has changed.
Longitude Class
This class is used by the Longitude class to provide notification when hours, minutes, or seconds properties have changed.
Initializes a new instance of the class.
The position.
Gets the position.
Initializes a new instance of the class.
The radian.
Gets the radians.
Initializes a new instance of the class.
The speed.
Gets the speed.
Creates a new instance containing the specified TimeSpan object.
The time span.
TimeSpan Property
TimeSpan Structure
Indicates a length of time which is the target of the event.
A TimeSpan object describing a length of time.
TimeSpan Structure
Represents information about the date and time reported by the GPS device.
Creates a new instance.
The date time.
Creates a new instance.
The date time.
if set to true [system clock updated].
A date and time value in UTC time (not adjusted for the local time zone).
A DateTime object containing a date and time reported by the GPS device.
DateTime Class
ToLocalTime Method (DateTime Class)
This date and time value is not adjusted to the local time zone. Use the
ToLocalTime method to adjust to local time.
Indicates whether the system clock updated to match the .
True if the system clock was updated; otherwise, .
The default is .
Represents information about an exception when an error-related event is raised.
This example demonstrates how to use this class when raising an event.
' Create a new exception
Dim MyException As New ApplicationException("The error was successfully created.")
' Declare a new event
Dim MyErrorEvent As ExceptionEventHandler
Sub Main()
' Raise our custom event
RaiseEvent MyErrorEvent(Me, New ExceptionEventArgs(MyException))
End Sub
// Create a new exception
ApplicationException MyException = new ApplicationException("The error was successfully created.")
// Declare a new event
ExceptionEventHandler MyErrorEvent;
void Main()
{
// Raise our custom event
MySatelliteEvent(this, New ExceptionEventArgs(MyException));
}
This object is used throughout the GPS.NET framework to provide notification when
either of two situations occur:
- An exception is thrown which cannot be trapped via a Try..Catch block (such as from a separate thread)
- An exception is thrown which can be recovered from and should not halt the current operation.
Most frequently, this class is used when a parsing exception occurs via the Parse method or during automatic
data collection.
Creates a new instance containing the specified exception object.
The exception.
Indicates information about the error and its location within a module.
An ApplicationException object or derivitive describing the error.
Initializes a new instance of the class.
The total.
Initializes a new instance of the class.
The current.
The total.
Gets the total.
Gets the current.
Represents a two-dimensional rectangular area.
Instances of this class are guaranteed to be thread-safe because the class is
immutable (it's properties can only be set via constructors).
Represents a size with no value.
Represents a size with no value.
Represents the largest possible size on Earth's surface.
Represents an invalid geographic size.
Creates a new instance.
The width.
The height.
Creates a new instance from the specified string.
The value.
Creates a new instance from the specified string in the specified culture.
The value.
The culture.
This method will attempt to split the specified string into two values, then parse each value
as an Distance object. The string must contain two numbers separated by a comma (or other character depending
on the culture).
Toes the aspect ratio.
The width.
The height.
Toes the aspect ratio.
The aspect ratio.
Adds the specified size to the current instance.
The size.
Subtracts the specified size from the current instance.
The size.
Multiplies the width and height by the specified size.
A GeographicSize specifying how to much to multiply the width and height.
A GeographicSize representing the product of the current instance with the specified size.
Divides the width and height by the specified size.
The size.
Returns a that represents this instance.
The format.
A that represents this instance.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Returns a unique code based on the object's value.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a that represents this instance.
A that represents this instance.
Returns a GeographicSize whose value matches the specified string.
A String describing a width, followed by a height.
A GeographicSize whose Width and Height properties match the specified string.
Returns a GeographicSize whose value matches the specified string.
A String describing a width, followed by a height.
A CultureInfo object describing how to parse the specified string.
A GeographicSize whose Width and Height properties match the specified string.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Compares the value of the current instance to the specified GeographicSize.
A GeographicSize object to compare against.
A Boolean, True if the values of both objects are precisely the same.
Compares the value of the current instance to the specified GeographicSize, to the specified number of decimals.
A GeographicSize object to compare against.
An Integer describing how many decimals the values are rounded to before comparison.
A Boolean, True if the values of both objects are the same out to the number of decimals specified.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Returns the ratio of the size's width to its height.
Returns the left-to-right size.
Returns the top-to-bottom size.
Indicates if the size has zero values.
Returns whether the current instance has invalid values.
Represents a collection of interpolated values using realistic acceleration and deceleration.
This enumeration is used by several DotSpatial.Positioning controls to smoothly transition from
one value to another. For example, the GPS SatelliteViewer uses acceleration to smoothly
transition from one bearing to another, giving the appearance of a realistic compass. This
enumeration, when combined with the class lets you add smooth
transitions to your own controls as well.
The transition occurs at a steady rate.
The transition is immediate; no interpolation takes place.
The transition starts at zero and accelerates to the end using a quadratic formula.
The transition starts at high speed and decelerates to zero.
The transition accelerates to the halfway point, then decelerates to zero.
Calculates intermediate values between two bounding values.
This powerful class provides the ability to interpolate values based on varying
interpolation techniques. This class is used primarily to simulate realistic motion by
accelerating and decelerating. This class is also used to calculate intermediate values
for features such as image georeferencing and estimating precision errors.
Initializes a new instance of the class.
Initializes a new instance of the class.
The count.
The mode.
Initializes a new instance of the class.
The minimum.
The maximum.
The count.
Initializes a new instance of the class.
The minimum.
The maximum.
The count.
The mode.
Reverses the interpolated sequence.
Recalculates this instance.
Calculates the value.
The index.
Controls the smallest number in the sequence.
The minimum.
Controls the largest number in the sequence.
The maximum.
Controls the acceleration and/or deceleration technique used.
The interpolation method.
Controls the number of interpolated values.
The count.
Returns a number from the interpolated sequence.
Represents a collection of interpolated coordinates using realistic acceleration and deceleration.
This class is used by several controls in the DotSpatial.Positioning namespace to give
them a more realistic behavior. This class will interpolate coordinates between a
given start and end point according to an interpolation technique, and return them
as an array. Then, controls and other elements can be moved smoothly by applying
the calculated values.
Instances of this class are likely to be thread safe because the class uses
thread synchronization when recalculating interpolated values.
Creates a new instance.
Creates a new instance using the specified start and end points.
The minimum.
The maximum.
The count.
This constructor provides a way to define the bounds of the interpolator,
as well as its number of points. A higher level of points yield a smoother
result but take longer to iterate through.
Initializes a new instance of the class.
The count.
The mode.
Creates a new instance using the specified end points, count, and interpolation technique.
The minimum.
The maximum.
The count.
The mode.
Recalculates this instance.
Swaps this instance.
Returns the starting point of the series.
The minimum.
Interpolated values are calculated between this point and the end point
stored in the property. Changing this property causes
the series to be recalculated.
Returns the ending point of the series.
The maximum.
Interpolated values are calculated between this point and the start point
stored in the property. Changing this property causes
the series to be recalculated.
Returns a Position object from the interpolated series.
Returns the number of calculated positions in the series.
The count.
Indicates the interpolation technique used to calculate intermediate points.
The interpolation method.
This property controls the acceleration and deceleration techniques
used when calculating intermediate points. Changing this property causes the
series to be recalculated.
Represents a line of constant distance north or south of the equator.
Longitude Class
Position Class
Azimuth Class
Elevation Class
Angle Class
These examples create new instances of Latitude objects.
Dim MyLatitude As New Latitude(90)
Latitude MyLatitude = new Latitude(90);
Latitude MyLatitude = new Latitude(90);
Dim MyLatitude1 As New Latitude(105, 30, 21.4)
Latitude MyLatitude = new Latitude(105, 30, 21.4);
Latitude MyLatitude = new Latitude(105, 30, 21.4);
Latitudes measure a distance North or South away from the equator. Latitudes
can range from -90° (at the South pole) to 90° (the North pole), with 0°
representing the equator. Latitudes are commonly paired with Longitudes to mark a
specific location on Earth's surface.
Latitudes are expressed in either of two major formats. The first format uses
only positive numbers and the letter "N" or "S" to indicate the hemisphere (i.e.
"45°N" or "60°S"). The second format allows negative numbers an omits the single
character (i.e. 45 or -60).
Instances of this class are guaranteed to be thread-safe because the class is
immutable (its properties can only be changed via constructors).
Represents a latitude of 0°.
Represents a latitude of 0°.
Represents a latitude of 23.5°S.
Represents a latitude of 23.5°N.
Represents a latitude of 90°N.
Represents a latitude of 90°S.
Represents the minimum possible latitude -90°.
Represents the maximum possible latitude of 90°.
Represents an invalid or unspecified value.
Creates a new instance with the specified decimal degrees.
The decimal degrees.
This example demonstrates how to create an angle with a measurement of 90°.
Dim MyLatitude As New Latitude(90)
Latitude MyLatitude = new Latitude(90);
An Latitude containing the specified value.
Creates a new instance with the specified decimal degrees and hemisphere.
The decimal degrees.
The hemisphere.
This example creates a new latitude of 39°30' north.
Dim MyLatitude As New Latitude(39.5, LatitudeHemisphere.North)
Latitude MyLatitude = new Latitude(39.5, LatitudeHemisphere.North);
This example creates a new latitude of 39°30 south.
Dim MyLatitude As New Latitude(39.5, LatitudeHemisphere.South)
Latitude MyLatitude = new Latitude(39.5, LatitudeHemisphere.South);
Creates a new instance with the specified degrees.
The hours.
An Latitude containing the specified value.
Creates a new instance with the specified hours, minutes and
seconds.
The hours.
The minutes.
The seconds.
This example demonstrates how to create an angular measurement of 34°12'29.2 in
hours, minutes and seconds.
Dim MyLatitude As New Latitude(34, 12, 29.2)
Latitude MyLatitude = new Latitude(34, 12, 29.2);
An Latitude containing the specified value.
Creates a new longitude with the specified hours, minutes, seconds, and hemisphere.
The hours.
The minutes.
The seconds.
The hemisphere.
This example creates a new latitude of 39°12'10" north.
Dim MyLatitude As New Latitude(39, 12, 10, LatitudeHemisphere.North)
Latitude MyLatitude = new Latitude(39, 12, 10, LatitudeHemisphere.North);
This example creates a new latitude of 39°12'10" south.
Dim MyLatitude As New Latitude(39, 12, 10, LatitudeHemisphere.South)
Latitude MyLatitude = new Latitude(39, 12, 10, LatitudeHemisphere.South);
Creates a new instance with the specified hours and decimal minutes.
The hours.
The decimal minutes.
This example demonstrates how an angle can be created when only the hours and
minutes (in decimal form) are known. This creates a value of 12°42.345'.
Dim MyLatitude As New Latitude(12, 42.345)
Latitude MyLatitude = new Latitude(12, 42.345);
An Latitude containing the specified value.
Creates a new instance with the specified hours, decimal minutes, and hemisphere.
The hours.
The decimal minutes.
The hemisphere.
This example creates a new latitude of 39°12.34' north.
Dim MyLatitude As New Latitude(39, 12.34, LatitudeHemisphere.North)
Latitude MyLatitude = new Latitude(39, 12.34, LatitudeHemisphere.North);
This example creates a new latitude of 39°12.34 south.
Dim MyLatitude As New Latitude(39, 12.34, LatitudeHemisphere.South)
Latitude MyLatitude = new Latitude(39, 12.34, LatitudeHemisphere.South);
Creates a new instance by parsing the specified string value.
The value.
This example creates a new instance by parsing a string. (notice The double-quote is
doubled up to represent a single double-quote in the string.)
Dim MyLatitude As New Latitude("23°45'67.8""N")
Latitude MyLatitude = new Latitude("23°45'67.8\"N");
An Latitude containing the specified value.
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
Creates a new instance by parsing the specified string value.
The value.
The culture.
A String in any of the following formats (or variation
depending on the local culture):
Parse
This example creates a new instance by parsing a string. (notice: The double-quote is
doubled up to represent a single double-quote in the string.)
Dim MyLatitude As New Latitude("23°45'67.8""N")
Latitude MyLatitude = new Latitude("23°45'67.8\"N");
An Latitude containing the specified value.
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
Creates a new instance by deserializing the specified XML.
The reader.
Returns the object with the smallest value.
A Latitude object to compare to the current instance.
The Latitude containing the smallest value.
Returns the object with the largest value.
A Latitude object to compare to the current instance.
A Latitude containing the largest value.
Returns a new instance whose value is rounded the specified number of decimals.
An Integer specifying the number of decimals to round off to.
Returns an angle opposite of the current instance.
An Latitude representing the mirrored value.
This example creates a new Latitude of 45° then calculates its mirror
of 225°. (45 + 180)
Dim Latitude1 As New Latitude(45)
Dim Latitude2 As Latitude = Latitude1.Mirror()
Debug.WriteLine(Latitude2.ToString())
' Output: 225
Latitude Latitude1 = new Latitude(45);
Latitude Latitude2 = Latitude1.Mirror();
Console.WriteLine(Latitude2.ToString());
// Output: 225
This method returns the "opposite" of the current instance. The opposite is
defined as the point on the other side of an imaginary circle. For example, if an angle
is 0°, at the top of a circle, this method returns 180°, at the bottom of the
circle.
Converts the current instance into radians.
A Radian object.
Radian Class
Converts an angular measurement into radians before further processing.
This example converts a measurement of 90° into radians.
Dim MyLatitude As New Latitude(90)
Dim MyRadians As Radian = MyLatitude.ToRadians()
Latitude MyLatitude = new Latitude(90);
Radian MyRadians = MyLatitude.ToRadians();
This function is typically used to convert an angular measurement into
radians before performing a trigonometric function.
Causes the value to be adjusted to between -90 and +90.
Indicates if the current instance is North of the specified latitude.
A Latitude object to examine.
A Boolean, True if the current instance is more North than the specified instance.
Indicates if the current instance is South of the specified latitude.
A Latitude object to examine.
A Boolean, True if the current instance is more South than the specified instance.
Converts the current instance to the northern or southern hemisphere.
The hemisphere.
Outputs the angle as a string using the specified format.
The format.
A String in the specified format.
This example uses the ToString method to output an angle in a
custom format. The " h° " code represents hours along with a
degree symbol (Alt+0176 on the keypad), and " m.mm " represents
the minutes out to two decimals. Mmm.
Dim MyLatitude As New Latitude(45, 16.772)
Debug.WriteLine(MyLatitude.ToString("h°m.mm"))
' Output: 45°16.78
Dim MyLatitude As New Latitude(45, 16.772);
Debug.WriteLine(MyLatitude.ToString("h°m.mm"));
// Output: 45°16.78
This method returns the current instance output in a specific format. If no
value for the format is specified, a default format of "d.dddd°" is used. Any
string output by this method can be converted back into an Latitude object using the
Parse method or Latitude(string) constructor.
Returns the smallest integer greater than the specified value.
Returns the largest integer which is smaller than the specified value.
Returns a new instance whose Seconds property is evenly divisible by 15.
An Latitude containing the rounded value.
This method is used to align or "snap" an angle to a regular interval. For
example, a grid might be easier to read if it were drawn at 30-second intervals instead
of 24.198-second intervals.
Returns a new angle whose Seconds property is evenly divisible by the specified amount.
A Double between 0 and 60 indicating the interval to round
to.
An Latitude containing the rounded value.
This method is used to align or "snap" an angle to a regular interval. For
example, a grid might be easier to read if it were drawn at 30-second intervals instead
of 24.198-second intervals.
Compares the current value to another Latitude object's value.
An Latitude, Double, or Integer
to compare with.
A Boolean, True if the object's DecimalDegrees
properties match.
This
Returns a unique code for this instance.
An Integer representing a unique code for the current
instance.
Since the Latitude class is immutable, this property may be used
safely with hash tables.
Outputs the angle as a string using the default format.
A String created using the default format.
This example outputs a value of 90 degrees in the default format of ###.#°.
Dim MyLatitude As New Latitude(90)
Debug.WriteLine(MyLatitude.ToString)
' Output: "90°"
Latitude MyLatitude = new Latitude(90);
Debug.WriteLine(MyLatitude.ToString());
// Output: "90°"
This method formats the current instance using the default format of
"d.dddd°." Any string output by this method can be converted back into an Latitude
object using the Parse method or Latitude(string)
constructor.
Normalizes the specified decimal degrees.
The decimal degrees.
Converts a measurement to its equivalent value between -90 and
90 degrees.
Returns a random latitude.
Returns a random latitude based on the specified seed.
The generator.
Returns a random latitude using the specified northern and southern boundaries.
The northernmost.
The southernmost.
Returns a random latitude between the specified minimum and maximum.
a Random object used to generate random values.
A Latitude specifying the northern-most allowed latitude.
A Latitude specifying the southern-most allowed latitude.
Converts arbitrary hour, minute and seconds into decimal degrees.
The hours.
The minutes.
The seconds.
A Double containing the decimal degree version of the specified
values.
DecimalDegrees Property
This example converts a value of 10°30'0" into decimal degrees (10.5).
Dim MyValue As Double = Latitude.ToDecimalDegrees(10, 30, 0)
double MyValue = Latitude.ToDecimalDegrees(10, 30, 0);
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Converts arbitrary hour and decimal minutes into decimal degrees.
The hours.
The decimal minutes.
A Double containing the decimal degree version of the specified
values.
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Converts an hour value into decimal degrees.
The hours.
A Double containing the decimal degree version of the specified
values.
The specified value will be converted to a double value.
Converts arbitrary hour and decimal minutes into decimal degrees.
The hours.
The decimal minutes.
The hemisphere.
A Double containing the decimal degree version of the specified
values.
The specified value will be converted to decimal degrees, then rounded to thirteen digits, the maximum precision allowed by this type.
Converts arbitrary decrees into well-formed decimal degrees.
The decimal degrees.
The hemisphere.
A Double containing the decimal degree version of the specified
values.
The specified value will be rounded to thirteen digits, the maximum precision allowed by this type.
Converts arbitrary hour, minute and seconds into decimal degrees.
The hours.
The minutes.
The seconds.
The hemisphere.
A Double containing the decimal degree version of the specified
values.
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Returns the object with the smallest value.
The first Latitude object.
The second Latitude object.
The Latitude containing the smallest value.
Returns the object with the largest value.
The first Latitude object.
The second Latitude object.
A Latitude containing the largest value.
Converts an angular measurement into radians.
The value.
A Radian object.
This example shows a quick way to convert an angle of 90° into radians.
Dim MyRadian As Radian = Latitude.ToRadians(90)
Radian MyRadian = Latitude.ToRadians(90);
This function is typically used to convert an angular measurement into
radians before performing a trigonometric function.
Converts a value in radians into an angular measurement.
The radians.
ToRadians
Radian Class
This example uses the FromRadians method to convert a value of one
radian into an Latitude of 57°.
' Create a new angle equal to one radian
Dim MyRadians As New Radian(1)
Dim MyLatitude As Latitude = Latitude.FromRadians(MyRadians)
Debug.WriteLine(MyLatitude.ToString())
' Output: 57°
// Create a new angle equal to one radian
Radian MyRadians = new Radian(1);
Latitude MyLatitude = Latitude.FromRadians(MyRadians);
Console.WriteLine(MyLatitude.ToString());
// Output: 57°
This function is typically used in conjunction with the
ToRadians
method after a trigonometric function has completed. The converted value is stored in
the DecimalDegrees property.
Froms the radians.
The radians.
Converts the specified string into an Latitude object.
The value.
A new Latitude object populated with the specified
values.
This example creates a new angular measurement using the Parse
method.
Dim NewLatitude As Latitude = Latitude.Parse("123.45°")
Latitude NewLatitude = Latitude.Parse("123.45°");
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
This method parses the specified string into an Latitude object
using the current culture. This constructor can parse any strings created via the
ToString method.
Converts the specified string into an Latitude object using the
specified culture.
A String describing an angle in the form of decimal degrees or a
sexagesimal.
A CultureInfo object describing the numeric format to use during
conversion.
A new Latitude object equivalent to the specified string.
This powerful method is typically used to process data from a data store or a
value input by the user in any culture. This function can accept any format which
can be output by the ToString method.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Returns the current instance increased by one.
An Latitude object.
This example uses the Increment method to increase an Latitude's
value. It also demonstrates the subtle error which can be caused if
Increment is called while ignoring the return value.
' Correct use of Increment
Dim Latitude1 As New Latitude(89)
Latitude1 = Latitude1.Increment()
' Incorrect use of Increment
Dim Latitude1 = New Latitude(89)
Latitude1.Increment()
' notice: Latitude1 will still be 89°!
// Correct use of Increment
Latitude Latitude1 = new Latitude(89);
Latitude1 = Latitude1.Increment();
// Incorrect use of Increment
Latitude Latitude1 = new Latitude(89);
Latitude1.Increment();
// notice: Latitude1 will still be 89°!
This method increases the DecimalDegrees property by 1.0,
returned as a new instance.
Since the Latitude class is immutable, this
method cannot be used to modify an existing instance.
Increases the current instance by the specified value.
A Double to add to the current instance.
A new Latitude containing the summed values.
This example adds 45° to the current instance of 45°, returning 90°.
Dim Latitude1 As New Latitude(45)
Latitude1 = Latitude1.Add(45)
Latitude Latitude1 = new Latitude(45);
Latitude1 = Latitude1.Add(45);
Adds the specified value.
The value.
Returns the current instance decreased by one.
An Latitude object.
This example uses the Decrement method to decrease an Latitude's
value. It also demonstrates the subtle error which can be caused if
Decrement is called while ignoring the return value.
' Correct use of Decrement
Dim Latitude1 As New Latitude(91)
Latitude1 = Latitude1.Decrement()
' Incorrect use of Decrement
Dim Latitude1 = New Latitude(91)
Latitude1.Increment()
' notice Latitude1 will still be 91°!
// Correct use of Decrement
Latitude Latitude1 = new Latitude(91);
Latitude1 = Latitude1.Decrement();
// Incorrect use of Decrement
Latitude Latitude1 = new Latitude(91);
Latitude1.Decrement();
// notice Latitude1 will still be 91°!
This method decreases the DecimalDegrees property by 1.0,
returned as a new instance.
Since the Latitude class is immutable, this
method cannot be used to modify an existing instance.
Decreases the current instance by the specified value.
A Double to subtract from the current instance.
A new Latitude containing the new value.
This example subtracts 30° from the current instance of 90°, returning 60°.
Dim Latitude1 As New Latitude(90)
Latitude1 = Latitude1.Subtract(30)
Latitude Latitude1 = new Latitude(90);
Latitude1 = Latitude1.Subtract(30);
Subtracts the specified value.
The value.
Multiplies the current instance by the specified value.
A Double to multiply with the current instance.
A new Latitude containing the product of the two numbers.
This example multiplies 30° with three, returning 90°.
Dim Latitude1 As New Latitude(30)
Latitude1 = Latitude1.Multiply(3)
Latitude Latitude1 = new Latitude(30);
Latitude1 = Latitude1.Multiply(3);
Multiplies the specified value.
The value.
Divides the current instance by the specified value.
A Double representing a denominator to divide by.
An Latitude containing the new value.
This example divides 90° by three, returning 30°.
Dim Latitude1 As New Latitude(90)
Latitude1 = Latitude1.Divide(3)
Latitude Latitude1 = new Latitude(90);
Latitude1 = Latitude1.Divide(3);
Divides the specified value.
The value.
Indicates if the current instance is smaller than the specified value.
An Latitude to compare with the current instance.
A Boolean, True if the current instance is
smaller than the specified value.
Determines whether [is less than] [the specified value].
The value.
true if [is less than] [the specified value]; otherwise, false.
Indicates if the current instance is smaller than or equal to the specified
value.
An Latitude to compare with the current instance.
A Boolean, True if the current instance is
smaller than or equal to the specified value.
This method compares the DecimalDegrees property with the
specified value. This method is the same as the "<=" operator.
Determines whether [is less than or equal to] [the specified value].
The value.
true if [is less than or equal to] [the specified value]; otherwise, false.
Indicates if the current instance is larger than the specified value.
An Latitude to compare with the current instance.
A Boolean, True if the current instance is
greater than the specified value.
Determines whether [is greater than] [the specified value].
The value.
true if [is greater than] [the specified value]; otherwise, false.
Indicates if the current instance is larger than or equal to the specified
value.
An Latitude to compare with the current instance.
A Boolean, True if the current instance is
greater than or equal to the specified value.
Determines whether [is greater than or equal to] [the specified value].
The value.
true if [is greater than or equal to] [the specified value]; otherwise, false.
Converts a measurement in Radians into an Latitude.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Latitude.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Latitude.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Latitude.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Latitude.
The value.
The result of the conversion.
Converts a measurement in degrees as an Integer into an Latitude.
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Converts a measurement in the form of a formatted String into an Latitude.
The value.
The result of the conversion.
Converts an Latitude into a String.
The value.
The result of the conversion.
This operator calls the ToString() method using the current culture.
Creates a copy of the current instance.
An Latitude of the same value as the current instance.
Compares the current instance to another instance using the specified
precision.
The value.
The decimals.
A Boolean, True if the
DecimalDegrees property of the current instance matches the
specified instance's DecimalDegrees property.
These examples compare two fractional values using specific numbers of digits for
comparison.
' Equals will return False
Dim Latitude1 As New Latitude(90.15);
Dim Latitude2 As New Latitude(90.12);
If Latitude1.Equals(Latitude2, 2) Then
Debug.WriteLine("The values are the same to two digits of precision.");
' Equals will return True
Dim Latitude1 As New Latitude(90.15);
Dim Latitude2 As New Latitude(90.12);
If Latitude1.Equals(Latitude2, 1) Then
Debug.WriteLine("The values are the same to one digit of precision.");
// Equals will return False
Latitude Latitude1 = new Latitude(90.15);
Latitude Latitude2 = new Latitude(90.12);
if (Latitude1.Equals(Latitude2, 2))
Console.WriteLine("The values are the same to two digits of precision.");
// Equals will return True
Latitude Latitude1 = new Latitude(90.15);
Latitude Latitude2 = new Latitude(90.12);
if (Latitude1.Equals(Latitude2, 1))
Console.WriteLine("The values are the same to one digits of precision.");
This is typically used in cases where precision is only significant for a few
digits and exact comparison is not necessary.
notice This method compares objects by value, not by
reference.
Equalses the specified value.
The value.
Compares to.
The obj.
Outputs the angle as a string using the specified format.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A String in the specified format.
This example uses the ToString method to output an angle in a
custom format. The " h° " code represents hours along with a
degree symbol (Alt+0176 on the keypad), and " m.mm " represents
the minutes out to two decimals. Mmm.
Dim MyLatitude As New Latitude(45, 16.772)
Debug.WriteLine(MyLatitude.ToString("h°m.mm", CultureInfo.CurrentCulture))
' Output: 45°16.78
Dim MyLatitude As New Latitude(45, 16.772);
Debug.WriteLine(MyLatitude.ToString("h°m.mm", CultureInfo.CurrentCulture));
// Output: 45°16.78
This method returns the current instance output in a specific format. If no
value for the format is specified, a default format of "d.dddd" is used. Any string
output by this method can be converted back into an Latitude object using the
Parse method or Latitude(string) constructor.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Returns the value of the angle as decimal degrees.
A Double value.
Hours Property
Minutes Property
Seconds Property
This example demonstrates how the
DecimalDegrees property is
calculated automatically when creating an angle using hours, minutes and seconds.
' Create an angle of 20°30'
Dim MyLatitude As New Latitude(20, 30)
' Setting the DecimalMinutes recalculated other properties
Debug.WriteLine(MyLatitude.DecimalDegrees)
' Output: "20.5" the same as 20°30'
// Create an angle of 20°30'
Latitude MyLatitude = New Latitude(20, 30);
// Setting the DecimalMinutes recalculated other properties
Console.WriteLine(MyLatitude.DecimalDegrees)
// Output: "20.5" the same as 20°30'
This property returns the value of the angle as a single number.
Returns the minutes and seconds as a single numeric value.
A Double value.
Minutes Property
DecimalDegrees Property
This example demonstrates how the DecimalMinutes property is
automatically calculated when creating a new angle.
' Create an angle of 20°10'30"
Dim MyLatitude As New Latitude(20, 10, 30)
' The DecimalMinutes property is automatically calculated
Debug.WriteLine(MyLatitude.DecimalMinutes)
' Output: "10.5"
// Create an angle of 20°10'30"
Latitude MyLatitude = new Latitude(20, 10, 30);
// The DecimalMinutes property is automatically calculated
Console.WriteLine(MyLatitude.DecimalMinutes)
// Output: "10.5"
This property is used when minutes and seconds are represented as a single
decimal value.
Returns the integer hours (degrees) portion of an angular
measurement.
An Integer value.
Minutes Property
Seconds Property
This example creates an angle of 60.5° then outputs the value of the
Hours property, 60.
Dim MyLatitude As New Latitude(60.5)
Debug.WriteLine(MyLatitude.Hours)
' Output: 60
Latitude MyLatitude = new Latitude(60.5);
Console.WriteLine(MyLatitude.Hours);
// Output: 60
This property is used in conjunction with the Minutes
and Seconds properties to create a full angular measurement.
This property is the same as DecimalDegrees without any fractional
value.
Returns the integer minutes portion of an angular measurement.
An Integer.
Hours Property
Seconds Property
This example creates an angle of 45.5° then outputs the value of the
Minutes property, 30.
Dim MyLatitude As New Latitude(45.5)
Debug.WriteLine(MyLatitude.Minutes)
' Output: 30
Latitude MyLatitude = new Latitude(45.5);
Console.WriteLine(MyLatitude.Minutes);
// Output: 30
This property is used in conjunction with the Hours and
Seconds properties to create a sexagesimal
measurement.
Returns the seconds minutes portion of an angular measurement.
A Double value.
Hours Property
Minutes Property
This example creates an angle of 45°10.5' then outputs the value of the
Seconds property, 30.
Dim MyLatitude As New Latitude(45, 10.5)
Debug.WriteLine(MyLatitude.Seconds)
' Output: 30
Dim MyLatitude As New Latitude(45, 10.5);
Console.WriteLine(MyLatitude.Seconds);
// Output: 30
This property is used in conjunction with the Hours and
Minutes properties to create a sexagesimal
measurement.
Indicates if the latitude is north or south of the equator.
Indicates if the current instance has a non-zero value.
A Boolean, True if the
DecimalDegrees property is zero.
Empty Field
Indicates if the current instance represents an infinite value.
Indicates whether the value is invalid or unspecified.
Indicates whether the value has been normalized and is within the
allowed bounds of -90° and 90°.
Indicates the position of a latitude measurement relative to the equator.
Hemisphere Property (Longitude Class)
LongitudeHemisphere Enumeration
This enumeration is used by the Hemisphere
property of the Latitude class. If a latitude is south of the
equator, it's value is displayed as a negative number, or with a single letter (but not
both). For example, 39 degrees south of the equator can be expressed in either of these
ways:
- 39°S
- -39°
Missing latitude information.
The latitude is north of the equator.
The latitude is south of the equator.
Represents a line of constant distance east or west from the Prime Meridian.
Azimuth Class
Elevation Class
Latitude Class
Longitude Class
These examples create new instances of Longitude objects.
Dim MyLongitude As New Longitude(90)
Longitude MyLongitude = new Longitude(90);
Longitude MyLongitude = new Longitude(90);
Dim MyLongitude1 As New Longitude(105, 30, 21.4)
Longitude MyLongitude = new Longitude(105, 30, 21.4);
Longitude MyLongitude = new Longitude(105, 30, 21.4);
Longitudes measure a distance either East or West from the Prime Meridian, an
imaginary line which passes from the North Pole, through the
Royal Observatory in Greenwich, England, and on
to the South Pole. Longitudes can range from -180 to 180°, with the Prime
Meridian at 0°. Latitudes are commonly paired with Longitudes to mark a specific
location on Earth's surface.
Latitudes are expressed in either of two major formats. The first format uses
only positive numbers and the letter "E" or "W" to indicate the hemisphere (i.e.
"94°E" or "32°W"). The second format allows negative numbers an omits the single
character (i.e. 94 or -32).
Instances of this class are guaranteed to be thread-safe because the class is
immutable (its properties can only be changed via constructors).
Represents a longitude of 0°.
Represents a longitude 180°.
Represents a longitude of 0°.
Represents the minimum possible longitude of -180°.
Represents the maximum possible longitude of 180°.
Represents an invalid or unspecified value.
Creates a new instance with the specified decimal degrees.
The decimal degrees.
This example demonstrates how to create an angle with a measurement of 90°.
Dim MyLongitude As New Longitude(90)
Longitude MyLongitude = new Longitude(90);
An Longitude containing the specified value.
Creates a new instance with the specified decimal degrees and hemisphere.
The decimal degrees.
The hemisphere.
This example creates a new Longitude of 39°30' north.
Dim MyLongitude As New Longitude(39.5, LongitudeHemisphere.North)
Longitude MyLongitude = new Longitude(39.5, LongitudeHemisphere.North);
This example creates a new Longitude of 39°30 south.
Dim MyLongitude As New Longitude(39.5, LongitudeHemisphere.South)
Longitude MyLongitude = new Longitude(39.5, LongitudeHemisphere.South);
Creates a new instance with the specified degrees.
The hours.
An Longitude containing the specified value.
Creates a new instance with the specified hours, minutes and
seconds.
The hours.
The minutes.
The seconds.
This example demonstrates how to create an angular measurement of 34°12'29.2 in
hours, minutes and seconds.
Dim MyLongitude As New Longitude(34, 12, 29.2)
Longitude MyLongitude = new Longitude(34, 12, 29.2);
An Longitude containing the specified value.
Creates a new instance using the specified decimal degrees and
hemisphere.
The hours.
The minutes.
The seconds.
The hemisphere.
This constructor is typically used to create a longitude when decimal degrees
are always expressed as a positive number. Since the hemisphere property is set
after the DecimalDegrees property is set, the DecimalDegrees is adjusted
automatically to be positive for the eastern hemisphere and negative for the
western hemisphere.
If the parameters conflict with each other, the Hemisphere
parameter takes precedence. Therefore, a value of "-19°E" will become "19°E"
(without the negative sign) with no exception being thrown.
Creates a new instance with the specified hours and decimal minutes.
The hours.
The decimal minutes.
This example demonstrates how an angle can be created when only the hours and
minutes (in decimal form) are known. This creates a value of 12°42.345'.
Dim MyLongitude As New Longitude(12, 42.345)
Longitude MyLongitude = new Longitude(12, 42.345);
An Longitude containing the specified value.
Creates a new instance with the specified hours, decimal minutes, and hemisphere.
The hours.
The decimal minutes.
The hemisphere.
This example creates a new Longitude of 39°12.34' north.
Dim MyLongitude As New Longitude(39, 12.34, LongitudeHemisphere.North)
Longitude MyLongitude = new Longitude(39, 12.34, LongitudeHemisphere.North);
This example creates a new Longitude of 39°12.34 south.
Dim MyLongitude As New Longitude(39, 12.34, LongitudeHemisphere.South)
Longitude MyLongitude = new Longitude(39, 12.34, LongitudeHemisphere.South);
Creates a new instance using the specified string-based measurement.
The value.
Parse Method
This example creates a new instance by parsing a string. notice: The double-quote is
doubled up to represent a single double-quote in the string.)
Dim MyLongitude As New Longitude("123°45'67.8""")
Longitude MyLongitude = new Longitude("123°45'67.8\"");
An Longitude containing the specified value.
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
A String in any of the following formats (or variation
depending on the local culture):
| hh |
hh.h |
hh mm |
hh mm.mm |
| hh mm ss |
hh mm ss.sss |
hhi |
hh.hi |
| hh mmi |
hh mm i |
hh mm.mi |
hh mm.m i |
| hh mm ssi |
hh mm ss i |
hh mm ss.si |
hh mm ss.s i |
| hhhmmssi |
|
|
|
Where h represents hours, m represents
minutes, s represents seconds, and i represents a
one-letter hemisphere indicator of "E" or "W." Any non-numeric character between
numbers is considered a delimiter. Thus, a value of 12°34'56.78"
or even 12A34B56.78C is treated the same as 12 34
56.78.
Creates a new instance using the specified string-based measurement.
The value.
The culture.
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
A String in any of the following formats (or variation
depending on the local culture):
| hh |
hh.h |
hh mm |
hh mm.mm |
| hh mm ss |
hh mm ss.sss |
hhi |
hh.hi |
| hh mmi |
hh mm i |
hh mm.mi |
hh mm.m i |
| hh mm ssi |
hh mm ss i |
hh mm ss.si |
hh mm ss.s i |
| hhhmmssi |
|
|
|
Where h represents hours, m represents
minutes, s represents seconds, and i represents a
one-letter hemisphere indicator of "E" or "W." Any non-numeric character between
numbers is considered a delimiter. Thus, a value of 12°34'56.78"
or even 12A34B56.78C is treated the same as 12 34
56.78.
Creates a new instance by deserializing the specified XML.
The reader.
Returns the object with the smallest value.
An Longitude object to compare to the current instance.
The Longitude containing the smallest value.
Returns the object with the largest value.
An Longitude object to compare to the current instance.
An Longitude containing the largest value.
Returns a value indicating the relative order of two objects.
An Longitude object to compare with.
A value of -1, 0, or 1 as documented by the IComparable interface.
This method allows collections of Longitude objects to be sorted.
The DecimalDegrees property of each instance is compared.
Returns an angle opposite of the current instance.
An Longitude representing the mirrored value.
This example creates a new Longitude of 45° then calculates its mirror
of 225°. (45 + 180)
Dim Longitude1 As New Longitude(45)
Dim Longitude2 As Longitude = Longitude1.Mirror()
Debug.WriteLine(Longitude2.ToString())
' Output: 225
Longitude Longitude1 = new Longitude(45);
Longitude Longitude2 = Longitude1.Mirror();
Console.WriteLine(Longitude2.ToString());
// Output: 225
This method returns the "opposite" of the current instance. The opposite is
defined as the point on the other side of an imaginary circle. For example, if an angle
is 0°, at the top of a circle, this method returns 180°, at the bottom of the
circle.
Converts the current instance into radians.
A Radian object.
Radian Class
Converts an angular measurement into radians before further processing.
This example converts a measurement of 90° into radians.
Dim MyLongitude As New Longitude(90)
Dim MyRadians As Radian = MyLongitude.ToRadians()
Longitude MyLongitude = new Longitude(90);
Radian MyRadians = MyLongitude.ToRadians();
This function is typically used to convert an angular measurement into
radians before performing a trigonometric function.
Indicates if the current instance is East of the specified longitude.
A Longitude object to examine.
A Boolean, True if the current instance is more East than the specified instance.
Indicates if the current instance is West of the specified longitude.
A Longitude object to examine.
A Boolean, True if the current instance is more West than the specified instance.
Outputs the current instance as a string using the specified format.
A combination of symbols, spaces, and any of the following case-insensitive
letters: D or H for hours, M for
minutes, S for seconds, and I to indicate the
hemisphere. Here are some examples:
| HH°MM'SS.SS" |
HHH.H° |
HH MM.MM |
HHHMMSS |
| HH°MM'SS.SS"I |
HHH.H°I |
HH MM.MMI |
HHHMMSSI |
A String matching the specified format.
ToString Method
Parse Method
This example uses the ToString method to output an angle in a
custom format. The " h° " code represents hours along with a
degree symbol (Alt+0176 on the keypad), and " m.mm " represents
the minutes out to two decimals. Mmm.
Dim MyLongitude As New Longitude(45, 16.772)
Debug.WriteLine(MyLongitude.ToString("h°m.mm"))
' Output: 45°16.78
Dim MyLongitude As New Longitude(45, 16.772);
Debug.WriteLine(MyLongitude.ToString("h°m.mm"));
// Output: 45°16.78
This powerful method returns the current angular measurement in a specific
format. If no value for the format is specified, a format of
hhh°mm'SS.SS"I (adjusted to the current culture) will be used. The
resulting String can be converted back into an
Longitude via the
Parse method so long as a delimiter separates each individual
value.
Returns the smallest integer greater than the specified value.
Returns the largest integer which is smaller than the specified value.
Returns a new instance whose value is rounded the specified number of decimals.
An Integer specifying the number of decimals to round off to.
Returns a new instance whose Seconds property is evenly divisible by 15.
An Longitude containing the rounded value.
This method is used to align or "snap" an angle to a regular interval. For
example, a grid might be easier to read if it were drawn at 30-second intervals instead
of 24.198-second intervals.
Returns a new angle whose Seconds property is evenly divisible by the specified amount.
A Double between 0 and 60 indicating the interval to round
to.
An Longitude containing the rounded value.
This method is used to align or "snap" an angle to a regular interval. For
example, a grid might be easier to read if it were drawn at 30-second intervals instead
of 24.198-second intervals.
Normalizes this instance.
A Longitude containing the normalized value.
This function is used to ensure that an angular measurement is within the
allowed bounds of 0° and 180°. If a value of 360° or 720° is passed, a value of 0°
is returned since traveling around the Earth 360° or 720° brings you to the same
place you started.
Compares the current value to another Longitude object's value.
An Longitude, Double, or Integer
to compare with.
A Boolean, True if the object's DecimalDegrees
properties match.
This
Returns a unique code for this instance.
An Integer representing a unique code for the current
instance.
Since the Longitude class is immutable, this property may be used
safely with hash tables.
Outputs the current instance as a string using the specified format.
A String matching the specified format.
Parse Method
This example outputs a value of 90 degrees in the default format of ###.#°.
Dim MyLongitude As New Longitude(90)
Debug.WriteLine(MyLongitude.ToString)
' Output: "90°"
Longitude MyLongitude = new Longitude(90);
Debug.WriteLine(MyLongitude.ToString());
// Output: "90°"
This powerful method returns the current angular measurement in a specific
format. If no value for the format is specified, a format of
hhh°mm'SS.SS"I (adjusted to the current culture) will be used. The
resulting String can be converted back into an
Longitude via the
Parse method so long as a delimiter separates each individual
value.
Normalizes the specified decimal degrees.
The decimal degrees.
This function is used to ensure that an angular measurement is within the
allowed bounds of -180° and 180°. If a value of 360° or 720° is passed, a value of 0°
is returned since traveling around the Earth 360° or 720° brings you to the same
place you started.
Returns the object with the smallest value.
A Longitude object to compare to value2.
A Longitude object to compare to value1.
The Longitude containing the smallest value.
Returns the object with the largest value.
A Longitude object to compare to value2.
A Longitude object to compare to value1.
A Longitude containing the largest value.
Converts an angular measurement into radians.
The value.
A Radian object.
This example shows a quick way to convert an angle of 90° into radians.
Dim MyRadian As Radian = Longitude.ToRadians(90)
Radian MyRadian = Longitude.ToRadians(90);
This function is typically used to convert an angular measurement into
radians before performing a trigonometric function.
Converts a value in radians into an angular measurement.
The radians.
ToRadians
Radian Class
This example uses the FromRadians method to convert a value of one
radian into an Longitude of 57°.
' Create a new angle equal to one radian
Dim MyRadians As New Radian(1)
Dim MyLongitude As Longitude = Longitude.FromRadians(MyRadians)
Debug.WriteLine(MyLongitude.ToString())
' Output: 57°
// Create a new angle equal to one radian
Radian MyRadians = new Radian(1);
Longitude MyLongitude = Longitude.FromRadians(MyRadians);
Console.WriteLine(MyLongitude.ToString());
// Output: 57°
This function is typically used in conjunction with the
ToRadians
method after a trigonometric function has completed. The converted value is stored in
the DecimalDegrees property.
Froms the radians.
The radians.
Returns a random longitude.
Returns a random longitude based on the specified seed.
The generator.
Returns a random longitude using the specified eastern and western boundaries.
A Longitude specifying the eastern-most allowed longitude.
A Longitude specifying the western-most allowed longitude.
Returns a random longitude between the specified minimum and maximum.
A Random object used to generate random values.
A Longitude specifying the eastern-most allowed longitude.
A Longitude specifying the western-most allowed longitude.
Converts arbitrary hour, minute and seconds into decimal degrees.
The hours.
The minutes.
The seconds.
A Double containing the decimal degree version of the specified
values.
DecimalDegrees Property
Normalize Method
This example converts a value of 10°30'0" into decimal degrees (10.5).
Dim MyValue As Double = Latitude.ToDecimalDegrees(10, 30, 0)
double MyValue = Latitude.ToDecimalDegrees(10, 30, 0);
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Converts arbitrary hour and decimal minutes into decimal degrees.
The hours.
The decimal minutes.
A Double containing the decimal degree version of the specified
values.
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Converts an hour value into decimal degrees.
The hours.
A Double containing the decimal degree version of the specified
values.
The specified value will be converted to a double value.
Converts arbitrary hour and decimal minutes into decimal degrees.
The hours.
The decimal minutes.
The hemisphere.
A Double containing the decimal degree version of the specified
values.
The specified value will be converted to decimal degrees, then rounded to thirteen digits, the maximum precision allowed by this type.
Converts arbitrary decrees into well-formed decimal degrees.
The decimal degrees.
The hemisphere.
A Double containing the decimal degree version of the specified
values.
The specified value will be rounded to thirteen digits, the maximum precision allowed by this type.
Converts arbitrary hour, minute and seconds into decimal degrees.
The hours.
The minutes.
The seconds.
The hemisphere.
A Double containing the decimal degree version of the specified
values.
This function is used to convert three-part measurements into a single value. The
result of this method is typically assigned to the
DecimalDegrees property. Values are rounded to thirteen decimal
places, the maximum precision allowed by this type.
Converts the specified string into an Longitude object.
The value.
A new Longitude object populated with the specified
values.
ToString Method
This example creates a new angular measurement using the Parse
method.
Dim NewLongitude As Longitude = Longitude.Parse("123.45°")
Longitude NewLongitude = Longitude.Parse("123.45°");
The Parse method requires a decimal or sexagesimal measurement.
Only the right-most portion of a sexagesimal measurement can be a fractional value.
Extra characters were encountered while parsing an angular measurement. Only hours, minutes, and seconds are allowed.
The specified text was not fully understood as an angular measurement.
This method parses the specified string into an Longitude object
using the current culture. This constructor can parse any strings created via the
ToString method.
Converts the specified string into an Longitude object using the
specified culture.
A String describing an angle in the form of decimal degrees or a
sexagesimal.
A CultureInfo object describing the numeric format to use during
conversion.
A new Longitude object equivalent to the specified string.
This powerful method is typically used to process data from a data store or a
value input by the user in any culture. This function can accept any format which
can be output by the ToString method.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Returns the current instance increased by one.
An Longitude object.
This example uses the Increment method to increase an Longitude's
value. It also demonstrates the subtle error which can be caused if
Increment is called while ignoring the return value.
' Correct use of Increment
Dim Longitude1 As New Longitude(89)
Longitude1 = Longitude1.Increment()
' Incorrect use of Increment
Dim Longitude1 = New Longitude(89)
Longitude1.Increment()
' notice: Longitude1 will still be 89°!
// Correct use of Increment
Longitude Longitude1 = new Longitude(89);
Longitude1 = Longitude1.Increment();
// Incorrect use of Increment
Longitude Longitude1 = new Longitude(89);
Longitude1.Increment();
// notice: Longitude1 will still be 89°!
This method increases the DecimalDegrees property by 1.0,
returned as a new instance.
Since the Longitude class is immutable, this
method cannot be used to modify an existing instance.
Increases the current instance by the specified value.
A Double to add to the current instance.
A new Longitude containing the summed values.
This example adds 45° to the current instance of 45°, returning 90°.
Dim Longitude1 As New Longitude(45)
Longitude1 = Longitude1.Add(45)
Longitude Longitude1 = new Longitude(45);
Longitude1 = Longitude1.Add(45);
Adds the specified value.
The value.
Returns the current instance decreased by one.
An Longitude object.
This example uses the Decrement method to decrease an Longitude's
value. It also demonstrates the subtle error which can be caused if
Decrement is called while ignoring the return value.
' Correct use of Decrement
Dim Longitude1 As New Longitude(91)
Longitude1 = Longitude1.Decrement()
' Incorrect use of Decrement
Dim Longitude1 = New Longitude(91)
Longitude1.Increment()
' notice Longitude1 will still be 91°!
// Correct use of Decrement
Longitude Longitude1 = new Longitude(91);
Longitude1 = Longitude1.Decrement();
// Incorrect use of Decrement
Longitude Longitude1 = new Longitude(91);
Longitude1.Decrement();
// notice: Longitude1 will still be 91°!
This method decreases the DecimalDegrees property by 1.0,
returned as a new instance.
Since the Longitude class is immutable, this
method cannot be used to modify an existing instance.
Decreases the current instance by the specified value.
A Double to subtract from the current instance.
A new Longitude containing the new value.
This example subtracts 30° from the current instance of 90°, returning 60°.
Dim Longitude1 As New Longitude(90)
Longitude1 = Longitude1.Subtract(30)
Longitude Longitude1 = new Longitude(90);
Longitude1 = Longitude1.Subtract(30);
Subtracts the specified value.
The value.
Multiplies the current instance by the specified value.
A Double to multiply with the current instance.
A new Longitude containing the product of the two numbers.
This example multiplies 30° with three, returning 90°.
Dim Longitude1 As New Longitude(30)
Longitude1 = Longitude1.Multiply(3)
Longitude Longitude1 = new Longitude(30);
Longitude1 = Longitude1.Multiply(3);
Multiplies the specified value.
The value.
Divides the current instance by the specified value.
A Double representing a denominator to divide by.
An Longitude containing the new value.
This example divides 90° by three, returning 30°.
Dim Longitude1 As New Longitude(90)
Longitude1 = Longitude1.Divide(3)
Longitude Longitude1 = new Longitude(90);
Longitude1 = Longitude1.Divide(3);
Divides the specified value.
The value.
Indicates if the current instance is smaller than the specified value.
An Longitude to compare with the current instance.
A Boolean, True if the current instance is
smaller than the specified value.
Determines whether [is less than] [the specified value].
The value.
true if [is less than] [the specified value]; otherwise, false.
Indicates if the current instance is smaller than or equal to the specified
value.
An Longitude to compare with the current instance.
A Boolean, True if the current instance is
smaller than or equal to the specified value.
This method compares the DecimalDegrees property with the
specified value. This method is the same as the "<=" operator.
Determines whether [is less than or equal to] [the specified value].
The value.
true if [is less than or equal to] [the specified value]; otherwise, false.
Indicates if the current instance is larger than the specified value.
An Longitude to compare with the current instance.
A Boolean, True if the current instance is
greater than the specified value.
Determines whether [is greater than] [the specified value].
The value.
true if [is greater than] [the specified value]; otherwise, false.
Indicates if the current instance is larger than or equal to the specified
value.
An Longitude to compare with the current instance.
A Boolean, True if the current instance is
greater than or equal to the specified value.
Determines whether [is greater than or equal to] [the specified value].
The value.
true if [is greater than or equal to] [the specified value]; otherwise, false.
Converts a measurement in Radians into an Longitude.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Longitude.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Longitude.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Longitude.
The value.
The result of the conversion.
Converts a decimal degree measurement as a Double into an Longitude.
The value.
The result of the conversion.
Converts a measurement in degrees as an Integer into an Longitude.
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Converts a measurement in the form of a formatted String into an Longitude.
The value.
The result of the conversion.
Converts an Longitude into a String.
The value.
The result of the conversion.
This operator calls the ToString() method using the current culture.
Creates a copy of the current instance.
An Longitude of the same value as the current instance.
Compares the current instance to another instance using the specified
precision.
The other.
The decimals.
A Boolean, True if the
DecimalDegrees property of the current instance matches the
specified instance's DecimalDegrees property.
Equals Method
These examples compare two fractional values using specific numbers of digits for
comparison.
' Equals will return False
Dim Longitude1 As New Longitude(90.15);
Dim Longitude2 As New Longitude(90.12);
If Longitude1.Equals(Longitude2, 2) Then
Debug.WriteLine("The values are the same to two digits of precision.");
' Equals will return True
Dim Longitude1 As New Longitude(90.15);
Dim Longitude2 As New Longitude(90.12);
If Longitude1.Equals(Longitude2, 1) Then
Debug.WriteLine("The values are the same to one digit of precision.");
// Equals will return False
Longitude Longitude1 = new Longitude(90.15);
Longitude Longitude2 = new Longitude(90.12);
if (Longitude1.Equals(Longitude2, 2))
Console.WriteLine("The values are the same to two digits of precision.");
// Equals will return True
Longitude Longitude1 = new Longitude(90.15);
Longitude Longitude2 = new Longitude(90.12);
if (Longitude1.Equals(Longitude2, 1))
Console.WriteLine("The values are the same to one digits of precision.");
This is typically used in cases where precision is only significant for a few
digits and exact comparison is not necessary.
notice: This method compares objects by value, not by
reference.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Compares the current object with another object of the same type.
An object to compare with this object.
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings:
Value
Meaning
Less than zero
This object is less than the parameter.
Zero
This object is equal to .
Greater than zero
This object is greater than .
Outputs the current instance as a string using the specified format.
A combination of symbols, spaces, and any of the following case-insensitive
letters: D or H for hours, M for
minutes, S for seconds, and I to indicate the
hemisphere. Here are some examples:
| HH°MM'SS.SS" |
HHH.H° |
HH MM.MM |
HHHMMSS |
| HH°MM'SS.SS"I |
HHH.H°I |
HH MM.MMI |
HHHMMSSI |
A CultureInfo object used to properly format the string information.
A String matching the specified format.
ToString Method
Parse Method
This example uses the ToString method to output an angle in a
custom format. The " h° " code represents hours along with a
degree symbol (Alt+0176 on the keypad), and " m.mm " represents
the minutes out to two decimals. Mmm.
Dim MyLongitude As New Longitude(45, 16.772)
Debug.WriteLine(MyLongitude.ToString("h°m.mm", CultureInfo.CurrentCulture))
' Output: 45°16.78
Dim MyLongitude As New Longitude(45, 16.772);
Debug.WriteLine(MyLongitude.ToString("h°m.mm", CultureInfo.CurrentCulture));
// Output: 45°16.78
This powerful method returns the current angular measurement in a specific
format. If no value for the format is specified, a format of
hhh°mm'SS.SS"I (adjusted to the current culture) will be used. The
resulting String can be converted back into an
Longitude via the
Parse method so long as a delimiter separates each individual
value.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Returns the value of the angle as decimal degrees.
A Double value.
Hours Property
Minutes Property
Seconds Property
This example demonstrates how the
DecimalDegrees property is
calculated automatically when creating an angle using hours, minutes and seconds.
' Create an angle of 20°30'
Dim MyLongitude As New Longitude(20, 30)
' Setting the DecimalMinutes recalculated other properties
Debug.WriteLine(MyLongitude.DecimalDegrees)
' Output: "20.5" the same as 20°30'
// Create an angle of 20°30'
Longitude MyLongitude = New Longitude(20, 30);
// Setting the DecimalMinutes recalculated other properties
Console.WriteLine(MyLongitude.DecimalDegrees)
// Output: "20.5" the same as 20°30'
This property returns the value of the angle as a single number.
Returns the minutes and seconds as a single numeric value.
A Double value.
Minutes Property
DecimalDegrees Property
This example demonstrates how the DecimalMinutes property is
automatically calculated when creating a new angle.
' Create an angle of 20°10'30"
Dim MyLongitude As New Longitude(20, 10, 30)
' The DecimalMinutes property is automatically calculated
Debug.WriteLine(MyLongitude.DecimalMinutes)
' Output: "10.5"
// Create an angle of 20°10'30"
Longitude MyLongitude = new Longitude(20, 10, 30);
// The DecimalMinutes property is automatically calculated
Console.WriteLine(MyLongitude.DecimalMinutes)
// Output: "10.5"
This property is used when minutes and seconds are represented as a single
decimal value.
Returns the integer hours (degrees) portion of an angular
measurement.
An Integer value.
Minutes Property
Seconds Property
This example creates an angle of 60.5° then outputs the value of the
Hours property, 60.
Dim MyLongitude As New Longitude(60.5)
Debug.WriteLine(MyLongitude.Hours)
' Output: 60
Longitude MyLongitude = new Longitude(60.5);
Console.WriteLine(MyLongitude.Hours);
// Output: 60
This property is used in conjunction with the Minutes
and Seconds properties to create a full angular measurement.
This property is the same as DecimalDegrees without any fractional
value.
Returns the integer minutes portion of an angular measurement.
An Integer.
Hours Property
Seconds Property
This example creates an angle of 45.5° then outputs the value of the
Minutes property, 30.
Dim MyLongitude As New Longitude(45.5)
Debug.WriteLine(MyLongitude.Minutes)
' Output: 30
Longitude MyLongitude = new Longitude(45.5);
Console.WriteLine(MyLongitude.Minutes);
// Output: 30
This property is used in conjunction with the Hours and
Seconds properties to create a sexagesimal
measurement.
Returns the seconds minutes portion of an angular measurement.
A Double value.
Hours Property
Minutes Property
This example creates an angle of 45°10.5' then outputs the value of the
Seconds property, 30.
Dim MyLongitude As New Longitude(45, 10.5)
Debug.WriteLine(MyLongitude.Seconds)
' Output: 30
Dim MyLongitude As New Longitude(45, 10.5);
Console.WriteLine(MyLongitude.Seconds);
// Output: 30
This property is used in conjunction with the Hours and
Minutes properties to create a sexagesimal
measurement.
Returns whether the longitude is east or west of the Prime Meridian.
When this property changes, the DecimalDegrees property is adjusted: if the
hemisphere is West, a negative sign is placed in front of the
DecimalDegrees value, and vice versa.
Returns the Universal Transverse Mercator zone number for this longitude.
Indicates if the current instance has a non-zero value.
A Boolean, True if the
DecimalDegrees property is zero.
Empty Field
Indicates if the current instance represents an infinite value.
Indicates whether the value is invalid or unspecified.
Indicates whether the value has been normalized and is within the
allowed bounds of -180° and 180°.
Indicates the position of a longitude measurement relative to the Prime Meridian.
Hemisphere Property (Latitude Class)
LatitudeHemisphere Enumeration
This enumeration is used by the Hemisphere
property of the Latitude class. If a longitude is west of the
Prime Meridian, it's value is displayed as a negative number, or with a single letter (but not
both). For example, 105 degrees west can be expressed in either of these
ways:
- 105°W
- -105°
Missing longitude information.
The longitude is east of the Prime Meridian.
The longitude is west of the Prime Meridian.
Indicates the current host operating system.
The current platform has not yet been determined.
The current plarform is a desktop computer.
The current platform is Windows CE 4.2
The current platform is PocketPC (Windows Mobile 2003)
The current platform is Smartphone
Indicates the current .NET framework being used.
The .NET framework version has not been determined.
.NET framework version 1.0 (Visual Studio 2002) is being used.
.NET framework version 1.1 (Visual Studio 2003) is being used.
.NET framework version 2.0 (Visual Studio 2005) is being used.
.NET framework version 3.0 (Visual Studio 2008) is being used.
.NET framework version 4.0 (Visual Studio 2010) is being used.
.NET Compact Framework version 1.0 (Visual Studio 2003) is being used.
.NET Compact Framework version 2.0 (Visual Studio 2005) is being used.
Provides features for determining the current host platform.
Initializes a new instance of the class.
Returns the current host platform.
This property is used to determine the current host platform: Windows CE 4.2,
PocketPC / Windows Mobile 2003, Smartphone, or Desktop. This property is typically
used to adjust the performance and behavior of an application to work on a specific platform.
For example, thread priorities are more sensitive on the Smartphone platform than the
PocketPC platform. This can also be used to determine correct locations of system folders
and installed system software such as Bluetooth stacks.
Returns the current version of the .NET Framework currently in use.
Represents a specific location on Earth's surface.
Instances of this class are guaranteed to be thread-safe because the class is
immutable (its properties can only be changed via constructors).
Represents the location at 0°, 0°.
Represents the smallest possible location of 90°S, 180°W.
Represents the largest possible location of 90°N, 180°E.
Represents the single point at the top of Earth: 90°N, 0°E.
Represents the single point at the bottom of Earth: 90°S, 0°E.
Represents an invalid or unspecified value.
Creates a new instance from the specified longitude and latitude.
The longitude.
The latitude.
Creates a new instance from the specified latitude and longitude.
The latitude.
The longitude.
Creates a new instance by parsing latitude and longitude from a single string.
The value.
Creates a new instance by interpreting the specified latitude and longitude.
The latitude.
The longitude.
Latitude and longitude values are parsed using the current local culture. For better support
of international cultures, add a CultureInfo parameter.
Creates a new instance by interpreting the specified latitude and longitude.
The latitude.
The longitude.
The culture.
Latitude and longitude values are parsed using the current local culture. For better support
of international cultures, a CultureInfo parameter should be specified to indicate how numbers should
be parsed.
Creates a new instance by converting the specified string using the specific culture.
The value.
The culture.
Creates a copy of the specified object.
The position.
Creates a new position by deserializing the specified XML content.
The reader.
Outputs the current instance as a string using the specified format.
The format.
A that represents this instance.
Outputs the current instance as a formatted string.
Converts the current instance into an Earth-centered, Earth-fixed (ECEF) Cartesian point.
Toes the cartesian point.
The ellipsoid.
The altitude.
Normalizes this instance.
Calculates the direction of travel to the specified destination.
A Position object to which the bearing is calculated.
An Azimuth object representing the calculated distance.
Calculates the direction of travel to the specified destination using the specified interpretation of Earth's shape.
A Position object to which the bearing is calculated.
An Ellipsoid object used to fine-tune bearing calculations.
An Azimuth object representing the calculated distance.
Returns the minimum speed required to travel from the current location to the
specified destination within the specified period of time.
The destination.
The time.
Indicates if the current instance is North of the specified position.
A Position object to examine.
A Boolean, True if the current instance is more North than the specified instance.
Indicates if the current instance is South of the specified position.
A Position object to examine.
A Boolean, True if the current instance is more South than the specified instance.
Indicates if the current instance is East of the specified position.
A Position object to examine.
A Boolean, True if the current instance is more East than the specified instance.
Indicates if the current instance is West of the specified position.
A Position object to examine.
A Boolean, True if the current instance is more West than the specified instance.
Returns the minimum time required to travel to the given destination at the
specified constant speed.
The destination.
The speed.
The TimeTo method expects a value for Speed greater than zero.
Returns the distance over land from the given starting point to the specified
destination.
The ending point of a segment.
A Distance object containing the calculated distance in
kilometers.
Calculates the great circle distance between any two points on
Earth.
This method uses trigonometry to calculate the Great Circle (over Earth's curved
surface) distance between any two points on Earth. The distance is returned in
kilometers but can be converted to any other unit type using methods in the
Distance
class.
Returns the distance over land from the given starting point to the specified
destination.
The ending point of a segment.
if set to true [is approximated].
A Distance object containing the calculated distance in
kilometers.
Calculates the great circle distance between any two points on
Earth.
This method uses a high-speed formula to determine the Great Circle distance from one
point to another. This method is typically used in situations where hundreds of distance
measurements must be made in a short period of time. The DistanceTo method
produces accuracy to one millimeter, but its formula is about a hundred times slower than this
method.
Distance
class.
Returns the distance over land from the given starting point to the specified
destination.
The ending point of a segment.
The model of the Earth to use for the distance calculation.
if set to true [is approximated].
A Distance object containing the calculated distance in
kilometers.
Calculates the great circle distance between any two points on
Earth.
This method uses a high-speed formula to determine the Great Circle distance from one
point to another. This method is typically used in situations where hundreds of distance
measurements must be made in a short period of time. The DistanceTo method
produces accuracy to one millimeter, but its formula is about a hundred times slower than this
method.
Distance
class.
Returns the distance over land from the given starting point to the specified
destination.
The ending point of a segment.
The model of the Earth to use for the distance calculation.
A Distance object containing the calculated distance in
kilometers.
Calculates the great circle distance between any two points on
Earth using a specific model of Earth's shape.
This method uses trigonometry to calculate the Great Circle (over Earth's curved
surface) distance between any two points on Earth. The distance is returned in
kilometers but can be converted to any other unit type using methods in the
Distance
class.
Returns the remaining travel distance if traveling for a certain speed for a certain period of time.
A Position marking the destination location.
A Speed travelled from the current instance.
A TimeSpan representing the time already elapsed during transit to the destination.
A Distance measuring the remaining distance to travel.
Calculates the intersection of two lines created by the current instance, another point, and a direction of travel from each point.
An Angle specifying a travel direction from the current instance.
A Position specifying the start of the second line of intersection.
An Angle specifying a travel direction from the second position.
A Position representing the point of intersection, if one exists.
This method is typically used to determine the point where two objects in motion would meet.
Intersections the of.
The first bearing.
The second position.
The second bearing.
Intersections the of.
The first bearing.
The second position.
The second bearing.
Calculates a position relative to the current instance based upon the given bearing and distance.
An Angle object specifying a direction to shift.
A Distance object specifying the distance to shift.
Translates to.
The bearing.
The distance.
The ellipsoid.
Calculates a position relative to the current instance based upon the given bearing and distance.
An Azimuth object specifying a direction to shift.
A Distance object specifying the distance to shift.
A Position representing the calculated position.
This function is designed to calculate positions for any location on Earth, with
the exception of coordinates which lie at the poles (e.g. 90°N or 90°S).
Calculates a position relative to the current instance based upon the given bearing and distance.
An Azimuth object specifying a direction to shift.
A Distance object specifying the distance to shift.
The model of the Earth to use for the translation calculation.
A Position representing the calculated position.
This function is designed to calculate positions for any location on Earth, with
the exception of coordinates which lie at the poles (e.g. 90°N or 90°S).
Calculates a position relative to the current instance based upon the given bearing and distance.
A Double specifying a direction to shift.
A Distance object specifying the distance to shift.
A Position representing the calculated position.
This function is designed to calculate positions for any location on Earth, with
the exception of coordinates which lie at the poles (e.g. 90°N or 90°S).
Calculates a position relative to the current instance based upon the given bearing and distance.
A Double specifying a direction to shift.
A Distance object specifying the distance to shift.
The model of the Earth to use for the translation calculation.
A Position representing the calculated position.
This function is designed to calculate positions for any location on Earth, with
the exception of coordinates which lie at the poles (e.g. 90°N or 90°S).
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Outputs the current instance as a string using the default format.
A that represents this instance.
Returns a random location using the specified random number seed.
Returns a random location.
The generator.
Returns a random location within the specified geographic rectangle.
The southernmost.
The westernmost.
The northernmost.
The easternmost.
Returns a random location within the specified geographic rectangle.
A Random object used to generate random values.
A Latitude specifying the southern-most allowed latitude.
A Longitude specifying the western-most allowed longitude.
A Latitude specifying the northern-most allowed latitude.
A Longitude specifying the eastern-most allowed longitude.
The randomly created position.
Bearings to.
The start.
The destination.
Returns the direction of travel from one position to another.
Returns a new instance shifted by the specified direction and
distance.
The start.
The bearing.
The distance.
A new Position object adjusted by the specified
amount.
Returns the position shifted by the specified bearing and distance as new
Position object.
' Create a distance of ten miles
Dim TravelDistance As New Distance(10, DistanceUnit.StatuteMiles)
' Calculate the point
Dim DestinationPoint As Position
DestinationPoint = Position.CurrentPosition.TranslateTo(Azimuth.Northwest,
TravelDistance)
This method is typically used to create an destination point relative to an
existing location. For example, this method could be used to create a point ten
miles northeast of the current location.
notice: The trigonometric formula used for this method is subject to errors
when the distance to translate falls below a quarter mile (approximately 433
meters).
Calculates the point (if any) at which two imaginary lines
intersect.
A Position specifying a position which marks the start of a line.
An Angle specifying a direction from the first Position.
A Position specifying the second position, marking the start of a second line.
An Angle specifying a direction from the second Position.
A Position object specifying the intersection
point.
Calculates a position which marks the intersection of two
vectors.
This method uses trigonometry to calculate the point at which two lines intersect
on Earth's surface. This method is typically used to see where two objects in motion
would meet given their current directions of travel. This method does not take the speed
of each object into account.
Returns the remaining travel distance if traveling for a certain speed for a certain period of time.
A Position marking the starting location from which to calculate.
A Position marking the destination location.
A Speed travelled from the current instance.
A TimeSpan representing the time already elapsed during transit to the destination.
A Distance measuring the remaining distance to travel.
Returns the distance over land from the given starting point to the specified
destination.
A beginning point from which to calculate distance.
The ending point of a segment.
A Distance object containing the calculated distance in
kilometers.
Calculates the great circle distance between any two points on
Earth.
This method uses trigonometry to calculate the Great Circle (over Earth's curved
surface) distance between any two points on Earth. The distance is returned in
kilometers but can be converted to any other unit type using methods in the
Distance
class.
Returns the minimum amount of time required to reach the specified destination at
the specified speed.
The start.
The destination.
The speed.
Calculates the time required to arrive at a destination when traveling at the
specified speed.
Returns the minimum speed required to travel over land from the given starting
point to the specified destination within the specified period of time.
The beginning point from which calculations are based.
The ending point to which speed is calculated.
The amount of time allowed to reach the destination.
A Speed object containing the required minimum travel
speed.
Calculates the minimum speed required to arrive at a destination in the given
time.
This method is typically used to compare the current speed with the minimum
required speed. For example, if the current rate of travel is 30MPH and the minimum
speed is 60MPH, it can be derived that the speed must be doubled to arrive at the
destination on time. Of course, care must be taken when making any suggestion to
increase driving speed.
Converts a string-based positional measurement into a Position
object.
A String containing both latitude and longitude in the form of a string.
This powerful method will analyze a string containing latitude and longitude and
create a Position object matching the specified values. The latitude and longitude
must be separated by a non-space delimiter such as a comma.
Parses the specified value.
The value.
The culture.
Parses as lat long.
The value.
The culture.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Adds the specified latitude and longitude from the current latitude and longitude.
The position.
Subtracts the specified latitude and longitude from the current latitude and longitude.
The position.
Multiplies the specified latitude and longitude from the current latitude and longitude.
The position.
Divides the specified latitude and longitude from the current latitude and longitude.
The position.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Creates a copy of the current instance.
Compares the current instance to the specified position.
A Position object to compare with.
A Boolean, True if the values are identical.
The two objects are compared at up to four digits of precision.
Compares the current instance to the specified position using the specified numeric precision.
A Position object to compare with.
An Integer specifying the number of fractional digits to compare.
A Boolean, True if the values are identical.
This method is typically used when positions do not mark the same location unless they are
extremely close to one another. Conversely, a low or even negative value for Precision
allows positions to be considered equal even when they do not precisely match.
Outputs the current instance as a string using the specified format and culture information.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Represents the vertical North/South portion of the location.
Represents the horizontal East/West portion of the location.
Indicates if the position has no value.
Indicates if the position has an invalid or unspecified value.
Indicates whether the position has been normalized and is within the
allowed bounds of -90° and 90° latitude and -180° and 180° longitude.
Indicates a vertical slice of the Earth used as a starting point for UTM positions.
Represents a position on Earth marked by latitude, longitude, and altitude.
Instances of this class are guaranteed to be thread-safe because the class is
immutable (its properties can only be changed via constructors).
Initializes a new instance of the struct.
The altitude.
The location.
Initializes a new instance of the struct.
The altitude.
The longitude.
The latitude.
Initializes a new instance of the struct.
The altitude.
The latitude.
The longitude.
Creates a new instance.
Initializes a new instance of the struct.
The longitude.
The latitude.
The altitude.
Initializes a new instance of the struct.
The latitude.
The longitude.
The altitude.
Creates a new instance by parsing latitude and longitude from a single string.
The altitude.
The location.
Creates a new instance by interpreting the specified latitude and longitude.
The altitude.
The latitude.
The longitude.
Latitude and longitude values are parsed using the current local culture. For better support
of international cultures, add a CultureInfo parameter.
Creates a new instance by interpreting the specified latitude and longitude.
The altitude.
The latitude.
The longitude.
The culture.
Latitude and longitude values are parsed using the current local culture. For better support
of international cultures, a CultureInfo parameter should be specified to indicate how numbers should
be parsed.
Creates a new instance by converting the specified string using the specific culture.
The altitude.
The location.
The culture.
Upgrades a Position object to a Position3D object.
The position.
Initializes a new instance of the struct.
The reader.
Toes the cartesian point.
Toes the cartesian point.
The ellipsoid.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Adds the specified position.
The position.
Subtracts the specified position.
The position.
Multiplies the specified position.
The position.
Divides the specified position.
The position.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Compares the current instance to the specified position.
A Position object to compare with.
A Boolean, True if the values are identical.
The two objects are compared at up to four digits of precision.
Compares the current instance to the specified position using the specified numeric precision.
A Position object to compare with.
An Integer specifying the number of fractional digits to compare.
A Boolean, True if the values are identical.
This method is typically used when positions do not mark the same location unless they are
extremely close to one another. Conversely, a low or even negative value for Precision
allows positions to be considered equal even when they do not precisely match.
Outputs the current instance as a string using the specified format and culture information.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Returns a coordinate which has been shifted the specified bearing and distance.
The bearing.
The distance.
The ellipsoid.
Clones this instance.
Returns the location's distance above sea level.
Gets the latitude.
Gets the longitude.
Returns whether the latitude, longitude and altitude are zero.
Represents a unit of angular measurement used during trigonometric
equations.
A radian is a unit of measure of an angle formed by an arc whose length is
the same as the circle's radius, making a shape similar to a slice of pizza.
Radians are typically used during trigonometric calculations such as calculating
the distance between two points on Earth's curved surface.
Instances of this class are guaranteed to be thread-safe because the class is
immutable (its properties can only be changed during constructors).
Represents a radian with a value of zero.
Creates a new instance with the specified value.
The value.
this constructor is typically used to initialize an instance when the radian
value is already known.
Initializes a new instance of the struct.
The value.
Initializes a new instance of the struct.
The value.
Initializes a new instance of the struct.
The value.
The culture.
Creates a new instance by deserializing the specified XML.
The reader.
Returns the cosine of the current instance.
Sines this instance.
Tangents this instance.
Squares the root.
Returns the absolute value of the current instance.
Returns the arccosine of the current instance.
Returns the arcsine of the current instance.
Returns the arctangent of the current instance.
Logarithms the specified new base.
The new base.
Logarithms the base10.
Converts the current instance into an Angle object.
An Angle object.
This method is typically used to convert a radian measurement back to latitude or
longitude after a trigonometric formula has completed.
Converts the current instance into an Angle object.
An Angle object.
This method is typically used to convert a radian measurement back to latitude or
longitude after a trigonometric formula has completed.
Converts the current instance to a latitude.
Converts the current instance to a longitude.
Outputs the speed measurement as a formatted string using the specified
format.
The format.
A that represents this instance.
Determines whether the specified is equal to this instance.
Another object to compare to.
true if the specified is equal to this instance; otherwise, false.
Returns the unique code for this instance used in hash tables.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a that represents this instance.
A that represents this instance.
Converts the specified value in degrees into radians.
A Double containing the value to convert.
Converts the specified value in degrees into radians.
An Angle containing the value to convert.
Converts the specified value from radians to degrees.
The radians.
A Double measuring degrees.
This method is typically used to convert a radian measurement back to latitude or
longitude after a trigonometric formula has completed.
Converts a Radian object into decimal degrees.
A Radian object to convert to an Angle.
An Angle object containing the converted value.
This method is typically used for trigonometric functions which work with values expressed as radians. Then the formula has completed, results are converted from radians to decimal degrees to make them easier to use.
Parses the specified value.
The value.
Parses the specified value.
The value.
The culture.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Adds the current instance to the specified value.
The value.
Adds the specified value.
The value.
Subtracts the specified value.
The value.
Subtracts the specified value.
The value.
Multiplies the specified value.
The value.
Multiplies the specified value.
The value.
Returns the current value divided by the specified value.
The value.
Divides the specified value.
The value.
Increments this instance.
Returns the current value decreased by one.
Determines whether [is less than] [the specified value].
The value.
true if [is less than] [the specified value]; otherwise, false.
Determines whether [is less than] [the specified value].
The value.
true if [is less than] [the specified value]; otherwise, false.
Determines whether [is less than or equal to] [the specified value].
The value.
true if [is less than or equal to] [the specified value]; otherwise, false.
Determines whether [is less than or equal to] [the specified value].
The value.
true if [is less than or equal to] [the specified value]; otherwise, false.
Determines whether [is greater than] [the specified value].
The value.
true if [is greater than] [the specified value]; otherwise, false.
Determines whether [is greater than] [the specified value].
The value.
true if [is greater than] [the specified value]; otherwise, false.
Determines whether [is greater than or equal to] [the specified value].
The value.
true if [is greater than or equal to] [the specified value]; otherwise, false.
Determines whether [is greater than or equal to] [the specified value].
The value.
true if [is greater than or equal to] [the specified value]; otherwise, false.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Equalses the specified value.
The value.
Equalses the specified value.
The value.
The decimals.
Compares the current instance with the specified value.
The value.
Outputs the speed measurement as a formatted string using the specified format
and culture information.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Represents the numeric portion of a radian measurement.
A Double value indicating an angular measurement expressed in
radians.
This property stores the numeric radian measurement. A radian can be converted into a degree
measurements via the ToAngle method.
Represents a line connected by two points on Earth's surface.
Creates a new instance using the specified end points.
The start.
The end.
Returns the distance from the segment to the specified position.
The position.
This method analyzes the relative position of the segment to the line to determine the
best mathematical approach.
Returns a that represents this instance.
A that represents this instance.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
Returns the distance from the starting point to the end point.
Returns the bearing from the start to the end of the line.
Returns the starting point of the segment.
Returns the end point of the segment.
Returns the location halfway from the start to the end point.
Represents a highly-precise two-dimensional size.
This structure is a DotSpatial.Positioning "parseable type" whose value can
be freely converted to and from String objects via the
ToString and Parse methods.
Instances of this structure are guaranteed to be thread-safe because it is
immutable (its properties can only be modified via constructors).
Represents a size with no value.
Represents an infinite size.
Represents the smallest possible size.
Represents the largest possible size.
Initializes a new instance of the struct.
The pt.
Initializes a new instance of the struct.
The size.
Creates a new instance.
The width.
The height.
Initializes a new instance of the struct.
The value.
Initializes a new instance of the struct.
The value.
The culture.
Initializes a new instance of the struct.
The reader.
Toes the aspect ratio.
The size.
Toes the aspect ratio.
The aspect ratio.
Returns a copy of the current instance.
Returns a that represents this instance.
The format.
A that represents this instance.
Compares the current instance to the specified object.
An Object to compare with.
A Boolean, True if the values are equivalent.
Returns a hash code for this instance.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Returns a that represents this instance.
A that represents this instance.
Parses the specified value.
The value.
Parses the specified value.
The value.
The culture.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Returns the sum of the current instance with the specified size.
The size.
Returns the current instance decreased by the specified value.
The size.
Returns the product of the current instance with the specified value.
The size.
Returns the current instance divided by the specified value.
The size.
Compares the current instance to the specified object.
A SizeD object to compare with.
A Boolean, True if the values are equivalent.
Returns a that represents this instance.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Returns the horizontal size.
Returns the vertical size.
Returns the ratio width to height.
Indicates if the instance has any value.
Represents a measurement of an object's rate of travel.
This structure is used to measure the rate at which something moves in a
given period of time. This structure supports several different unit types in both
Imperial and Metric measurement systems. A speed is measured in two parts: a
numeric value and a label indicating the units of measurement.
Speed measurements can be converted to their equivalent values in other unit
types through the use of several conversion methods such as ToMetersPerSecond,
ToFeetPerSecond, ToKilometersPerHour, and others.
Three methods, ToImperialUnitType,
ToMetricUnitType and ToLocalUnitType also exist
for converting a speed measurement to the most readable unit type (i.e. 1 meter vs.
0.0001 kilometers) in any local culture.
This structure is a DotSpatial.Positioning "parseable type" whose value can
be freely converted to and from String objects via the
ToString and Parse methods.
Instances of this structure are guaranteed to be thread-safe because it is
immutable (its properties can only be modified via constructors).
Represents a speed of zero.
Represents a speed of zero.
Returns the rate of travel of light in a vacuum.
Represents the largest possible speed.
Represents the smallest possible speed.
Returns the rate of travel of sound waves at sea level.
Represents an infinite speed.
Represents an invalid or unspecified value.
Creates a new instance using the specified value and unit type.
The value.
The units.
This is the most frequently used constructor of the speed class.
Initializes a new instance of the struct.
The value.
This powerful method is designed to simplify the process of parsing values read
from a data store or typed in by the user.
Initializes a new instance of the struct.
The value.
The culture.
Initializes a new instance of the struct.
The reader.
Returns a copy of the current instance.
Returns a new instance rounded to the specified number of digits.
An Integer specifying the number of digits to round off to.
Returns the current instance converted to feet per second.
The measurement is converted regardless of its current unit type.
Converts the current measurement into kilometers per hour.
The measurement is converted regardless of its current unit type.
Converts the current measurement into kilometers per second.
The measurement is converted regardless of its current unit type.
Returns the current instance converted to knots.
The measurement is converted regardless of its current unit type.
Returns the current instance converted to meters per second.
The measurement is converted regardless of its current unit type.
Returns the current instance converted to miles per hours (MPH).
The measurement is converted regardless of its current unit type.
Returns the current instance converted to the specified unit type.
The value.
Returns the current instance converted to the most readable Imperial unit
type.
A Speed converted to the chosen unit type.
When a Speed becomes smaller, it may make more sense to the
user to be expressed in a smaller unit type. For example, a Speed of
0.001 kilometers might be better expressed as 1 meter. This method will
determine the smallest Imperial unit type.
Returns the current instance converted to the most readable Metric unit
type.
A Speed converted to the chosen unit type.
When a Speed becomes smaller, it may make more sense to the
user to be expressed in a smaller unit type. For example, a Speed of
0.001 kilometers per second might be better expressed as 1 meter per second. This method will
determine the smallest metric unit type.
Returns the current instance converted to the most readable Imperial or Metric
unit type depending on the local culture.
A Speed converted to the chosen unit type.
When a Speed becomes smaller, it may make more sense to the
user to be expressed in a smaller unit type. For example, a Speed of
0.001 kilometers might be better expressed as 1 meter. This method will
find the smallest unit type and convert the unit to the user's local
numeric system (Imperial or Metric).
Outputs the speed measurement as a formatted string using the specified
format.
The format.
A that represents this instance.
Returns the total distance traveled at the current speed for the specified
time.
The time.
A Distance representing the distance travelled at
the current speed for the specified length of time.
Compares the current instance to the specified arbitrary value.
An Object representing a value to compare.
A Boolean, True if the values are equivalent.
Returns a unique code for the current instance used in hash tables.
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Outputs the speed measurement as a formatted string.
A that represents this instance.
Creates a speed measurement based on a string value.
A String in any of the following formats (or variation
depending on the local culture):
where vv.v is a decimal value and u is a
unit type made from words in the following list:
| FEET |
FOOT |
METER |
| METERS |
METRE |
METRES |
| KILOMETER |
KILOMETRE |
KILOMETERS |
| KILOMETRES |
KNOT |
KNOTS |
| MILE |
MILES |
STATUTE MILE |
| STATUTE MILES |
F |
FT |
| M |
KM |
K |
| PER |
-PER- |
/ |
| SECOND |
SEC |
S |
| HOUR |
HR |
H |
For example, "12 miles per hour" is acceptable because the words "miles,"
"per," and "hour" are found in the above list. Some combinations are not supported,
such as "feet/hour." The word combination should look similar to a value from the
SpeedUnit enumeration.
A new Speed object with the specified value and
units.
This powerful method simplifies the process of processing values read from a data
store or entered via the user. This method even supports some natural language
processing ability by understanding words (see list above). This method can parse any
value created via the ToString method.
Parses the specified value.
The value.
The culture.
Froms the knots.
The value.
Froms the statute miles per hour.
The value.
Froms the kilometers per hour.
The value.
Froms the kilometers per second.
The value.
Froms the feet per second.
The value.
Froms the meters per second.
The value.
Parses the speed unit.
The value.
Returns a random distance between 0 and 200 kilometers per hour.
A Distance containing a random value, converted to local units.
Returns a random distance between 0 and 200 kilometers per hour.
A Random object used to generate random values.
A Distance containing a random value, converted to local units.
Implements the operator +.
The left.
The right.
The result of the operator.
Implements the operator -.
The left.
The right.
The result of the operator.
Implements the operator *.
The left.
The right.
The result of the operator.
Implements the operator /.
The left.
The right.
The result of the operator.
Implements the operator <.
The left.
The right.
The result of the operator.
Implements the operator <=.
The left.
The right.
The result of the operator.
Implements the operator ==.
The left.
The right.
The result of the operator.
Implements the operator !=.
The left.
The right.
The result of the operator.
Implements the operator >=.
The left.
The right.
The result of the operator.
Implements the operator >.
The left.
The right.
The result of the operator.
Adds the specified value.
The value.
Adds the specified value.
The value.
Subtracts the specified value.
The value.
Subtracts the specified value.
The value.
Multiplies the specified value.
The value.
Multiplies the specified value.
The value.
Divides the specified value.
The value.
Divides the specified value.
The value.
Returns the current instance increased by one.
Returns the current instance decreased by one.
Indicates if the current instance is smaller than the specified speed.
The value.
true if [is less than] [the specified value]; otherwise, false.
Indicates if the current instance is smaller or equivalent to than the specified
speed.
The value.
true if [is less than or equal to] [the specified value]; otherwise, false.
Indicates if the current instance is larger than the specified speed.
The value.
true if [is greater than] [the specified value]; otherwise, false.
Indicates if the current instance is larger or equivalent to than the specified
speed.
The value.
true if [is greater than or equal to] [the specified value]; otherwise, false.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Performs an explicit conversion from to .
The value.
The result of the conversion.
Indicates whether the current object is equal to another object of the same type.
An object to compare with this object.
true if the current object is equal to the parameter; otherwise, false.
Equalses the specified other.
The other.
The decimals.
Compares the current instance to the specified speed.
An object to compare with this object.
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings:
Value
Meaning
Less than zero
This object is less than the parameter.
Zero
This object is equal to .
Greater than zero
This object is greater than .
Outputs the speed measurement as a formatted string using the specified format
and culture information.
The format to use.-or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation.
The provider to use to format the value.-or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
A that represents this instance.
This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class.
An that describes the XML representation of the object that is produced by the method and consumed by the method.
Converts an object into its XML representation.
The stream to which the object is serialized.
Generates an object from its XML representation.
The stream from which the object is deserialized.
Returns the numeric portion of the speed measurement.
This property is combined with the
Units property to form a complete
speed measurement.
Returns the units portion of the speed measurement.
A value from the SpeedUnits enumeration.
Following proper scientific practices, speed measurements are always made
using a value paired with a unit type.
Always explicitly
convert to a specific speed unit type before performing
mathematics.
Since the Units property of the Speed class can be modified, it is not
safe to assume that a speed measurement will always be of a certain unit type.
Therefore, use a conversion method such as
ToKilometersPerHour or
ToStatuteMilesPerHour to ensure that the speed is in the correct unit
type before perfoming mathematics.
Indicates if the measurement is zero.
Indicates if the unit of measurement is a Metric unit type.
Indicates if the measurement is infinite.
Indicates if the current instance is invalid or unspecified.
Indicates the unit of measure for speed measurements.
Units Property (Speed Class)
Speed Class
This enumeration is used by the
Units property of the
Speed
class in conjunction with the Value
property to describe a speed measurement.
The number of nautical miles travelled in one hour.
The number of statute miles travelled in one hour, also known as MPH.
The number of kilometers travelled in one hour, also known as KPH.
The number of kilometers travelled in one second, also known as
KM/S.
The number of feet travelled in one second, also known as FT/S.
The number of meters travelled in one hour, also known as M/S.
Serves as a notification to dispose of static objects.
private static StaticFinalizer MyStaticFinalizer = new StaticFinalizer();
private static Brush UnmanagedResource = new SolidBrush(Color.Blue);
void Constructor()
{
MyStaticFinalizer.Disposed += new EventHandler(StaticFinalize);
}
void StaticFinalize(object sender, EventArgs e)
{
UnmanagedResource.Dispose();
}
It is not uncommon for static variables to contain unmanaged resources. Yet,
the .NET Garbage Collector does not allow for finalizers on static objects. The StaticFinalizer
class serves to work around this problem. To use this class, declare an instance as a
private, static variable. Then, hook into its Disposed event. The event will be raised
during the StaticFinalizer's own finalizer, allowing you to safely dispose of static resources.
Releases unmanaged resources and performs other cleanup operations before the is reclaimed by garbage collection.
Occurs when [disposed].
Represents a simulated GPS device.
Creates a new instance using the specified emulator.
The emulator.
Overrides OnChaceRemove
Since emulators don't qualify as detected devices, this
method has no behavior.
Records information about this device to the registry.
Reads information about this device from the registry.
Creates a new Stream object for the device.
The access.
The sharing.
A Stream object.
Gets the Name of the Virtual Device
Returns the XML namespace for GML documents.
Returns the prefix applied to all GML XML elements.
Returns the XML namespace for DotSpatial.Positioning documents.
Returns the prefix applied to all DotSpatial.Positioning XML elements.
Used to test the implementations of DotSpatial.Positioning types.
The obj.
Used to test the implementations of DotSpatial.Positioning types.
The XML.