Click or drag to resize

Speed Structure

Represents a speed measurement, in meters per second, as a double-precision floating-point number.
Inheritance Hierarchy
SystemObject
  SystemValueType
    GSF.UnitsSpeed

Namespace: GSF.Units
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.181-beta
Syntax
View Source

The Speed type exposes the following members.

Constructors
 NameDescription
Public methodSpeed Creates a new Speed.
Top
Methods
 NameDescription
Public methodCompareTo(Double) Compares this instance to a specified Double and returns an indication of their relative values.
Public methodCompareTo(Object) Compares this instance to a specified object and returns an indication of their relative values.
Public methodCompareTo(Speed) Compares this instance to a specified Speed and returns an indication of their relative values.
Public methodStatic memberConvertFrom Converts the value in the specified sourceUnit to a new Speed in meters per second.
Public methodConvertTo Converts the Speed to the specified targetUnit.
Public methodEquals(Double) Returns a value indicating whether this instance is equal to a specified Double value.
Public methodEquals(Object) Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueTypeEquals(Object))
Public methodEquals(Speed) Returns a value indicating whether this instance is equal to a specified Speed value.
Public methodStatic memberFromFeetPerMinute Creates a new Speed value from the specified value in feet per minute.
Public methodStatic memberFromInchesPerSecond Creates a new Speed value from the specified value in inches per second.
Public methodStatic memberFromKilometersPerHour Creates a new Speed value from the specified value in kilometers per hour.
Public methodStatic memberFromKnots Creates a new Speed value from the specified value in knots (International).
Public methodStatic memberFromMach Creates a new Speed value from the specified value in Mach.
Public methodStatic memberFromMilesPerHour Creates a new Speed value from the specified value in miles per hour.
Public methodGetHashCode Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodGetTypeCode Returns the TypeCode for value type Double.
Public methodStatic memberParse(String) Converts the string representation of a number to its Speed equivalent.
Public methodStatic memberParse(String, NumberStyles) Converts the string representation of a number in a specified style to its Speed equivalent.
Public methodStatic memberParse(String, IFormatProvider) Converts the string representation of a number in a specified culture-specific format to its Speed equivalent.
Public methodStatic memberParse(String, NumberStyles, IFormatProvider) Converts the string representation of a number in a specified style and culture-specific format to its Speed equivalent.
Public methodToFeetPerMinute Gets the Speed value in feet per minute.
Public methodToInchesPerSecond Gets the Speed value in inches per second.
Public methodToKilometersPerHour Gets the Speed value in kilometers per hour.
Public methodToKnots Gets the Speed value in knots (International).
Public methodToMach Gets the Speed value in Mach.
Public methodToMilesPerHour Gets the Speed value in miles per hour.
Public methodToString Converts the numeric value of this instance to its equivalent string representation.
(Overrides ValueTypeToString)
Public methodToString(IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
Public methodToString(String) Converts the numeric value of this instance to its equivalent string representation, using the specified format.
Public methodToString(String, IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
Public methodStatic memberTryParse(String, Speed) Converts the string representation of a number to its Speed equivalent. A return value indicates whether the conversion succeeded or failed.
Public methodStatic memberTryParse(String, NumberStyles, IFormatProvider, Speed) Converts the string representation of a number in a specified style and culture-specific format to its Speed equivalent. A return value indicates whether the conversion succeeded or failed.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(Speed, Speed) Returns computed sum of values.
Public operatorStatic memberDivision(Speed, Speed) Returns computed division of values.
Public operatorStatic memberEquality(Speed, Speed) Compares the two values for equality.
Public operatorStatic memberExponent(Speed, Speed) Returns result of first value raised to speed of second value.
Public operatorStatic memberGreaterThan(Speed, Speed) Returns true if left value is greater than right value.
Public operatorStatic memberGreaterThanOrEqual(Speed, Speed) Returns true if left value is greater than or equal to right value.
Public operatorStatic member(Double to Speed) Implicitly converts value, represented in meters per second, to a Speed.
Public operatorStatic member(Speed to Double) Implicitly converts Speed, represented in meters per second, to a Double.
Public operatorStatic memberInequality(Speed, Speed) Compares the two values for inequality.
Public operatorStatic memberLessThan(Speed, Speed) Returns true if left value is less than right value.
Public operatorStatic memberLessThanOrEqual(Speed, Speed) Returns true if left value is less or equal to than right value.
Public operatorStatic memberModulus(Speed, Speed) Returns computed remainder after dividing first value by the second.
Public operatorStatic memberMultiply(Speed, Speed) Returns computed product of values.
Public operatorStatic memberSubtraction(Speed, Speed) Returns computed difference of values.
Top
Fields
 NameDescription
Public fieldStatic memberMaxValueRepresents the largest possible value of an Speed. This field is constant.
Public fieldStatic memberMinValueRepresents the smallest possible value of an Speed. This field is constant.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
This class behaves just like a Double representing a speed in meters per second; it is implicitly castable to and from a Double and therefore can be generally used "as" a double, but it has the advantage of handling conversions to and from other speed representations, specifically miles per hour, kilometers per hour, feet per minute, inches per second, knots and Mach.
Example
This example converts mph to km/h:
C#
public double GetKilometersPerHour(double milesPerHour)
{
    return Speed.FromMilesPerHour(milesPerHour).ToKilometersPerHour();
}
See Also