Struct Position
- Namespace
- TZFinder
- Assembly
- TZFinder.dll
Represents a geographic position with longitude and latitude.
public readonly struct Position : IEquatable<Position>
- Implements
- Inherited Members
Constructors
Position(float, float)
Initializes a new instance of the Position struct.
public Position(float longitude, float latitude)
Parameters
longitude
floatThe longitude, in degrees. Must be between -180 and 180.
latitude
floatThe latitude, in degrees. Must be between -90 and 90.
Exceptions
- ArgumentOutOfRangeException
Thrown when
longitude
orlatitude
is out of range or NaN.
Properties
Latitude
Gets the latitude of the position.
public float Latitude { get; }
Property Value
Longitude
Gets the longitude of the position.
public float Longitude { get; }
Property Value
Methods
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
Equals(Position)
public bool Equals(Position other)
Parameters
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(Position, Position)
Determines whether two specified Position instances are equal.
public static bool operator ==(Position left, Position right)
Parameters
Returns
operator !=(Position, Position)
Determines whether two specified Position instances are not equal.
public static bool operator !=(Position left, Position right)