Distance Distance Struct

Definition

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

public struct Distance
type Distance = struct
Inheritance
DistanceDistance

Constructors

Distance(Double) Distance(Double)

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

Properties

Kilometers Kilometers

Gets the distance in kilometers that is spanned by thisDistance.

Meters Meters

Gets the distance in meters that is spanned by thisDistance.

Miles Miles

Gets the distance in miles that is spanned by thisDistance.

Methods

Equals(Object) Equals(Object)

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

Equals(Distance) Equals(Distance)

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

FromKilometers(Double) FromKilometers(Double)

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

FromMeters(Double) FromMeters(Double)

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

FromMiles(Double) FromMiles(Double)

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

GetHashCode() GetHashCode()

The hashcode for the Distance.

Operators

Equality(Distance, Distance) Equality(Distance, Distance)

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

Inequality(Distance, Distance) Inequality(Distance, Distance)

Whether two Distances have differing Meters properties.

Applies to