Share via


Distance Struct

Definition

Struct that encapsulates a distance (natively stored as a double of meters).

public struct Distance
type Distance = struct
Inheritance
System.ValueType
Distance

Constructors

Distance(Double)

Creates a new Distance that represents the distance described by meters.

Properties

Kilometers

Gets the distance in kilometers that is spanned by thisDistance.

Meters

Gets the distance in meters that is spanned by thisDistance.

Miles

Gets the distance in miles that is spanned by thisDistance.

Methods

BetweenPositions(Position, Position)
Equals(Distance)

Whether a Distance has exactly the same values as this Distance.

Equals(Object)

Whether an System.Object is a Distance and has exactly the same values as thisDistance.

FromKilometers(Double)

Factory method to create a Distance from a value provided in kilometers.

FromMeters(Double)

Factory method to create a Distance from a value provided in meters.

FromMiles(Double)

Factory method to create a Distance from a value provided in miles.

GetHashCode()

The hashcode for the Distance.

Operators

Equality(Distance, Distance)

Whether two Distances have Meters properties that are exactly the same.

Inequality(Distance, Distance)

Whether two Distances have differing Meters properties.

Applies to