Distance Struct

Definition

Represents a distance in meters, miles, or kilometers.

public value class Distance
public struct Distance
type Distance = struct
Public Structure Distance
Inheritance
Distance

Constructors

Name Description
Distance(Double)

Initializes a new instance of the Distance struct with a value in meters.

Properties

Name Description
Kilometers

Gets the distance in kilometers.

Meters

Gets the distance in meters.

Miles

Gets the distance in miles.

Methods

Name Description
BetweenPositions(Location, Location)

Calculates the distance between two geographical positions using the Haversine formula.

Equals(Distance)

Determines whether this instance is equal to another Distance.

Equals(Object)

Indicates whether this instance and a specified object are equal.

FromKilometers(Double)

Creates a new Distance from a value in kilometers.

FromMeters(Double)

Creates a new Distance from a value in meters.

FromMiles(Double)

Creates a new Distance from a value in miles.

GetHashCode()

Returns the hash code for this instance.

Operators

Name Description
Equality(Distance, Distance)

Determines whether two Distance instances are equal.

Inequality(Distance, Distance)

Determines whether two Distance instances are not equal.

Applies to