Gemstone Common Library
Show/Hide TOC

# Speed Structure

Represents a speed measurement, in meters per second, as a double-precision floating-point number.

## Definition

Namespace: Gemstone.Units
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.176 -- Release Build+c74560d581224bfee7a285d73926fb4fb3df8ece
C#
View Source Request Example

    [SerializableAttribute]
    [TypeConverterAttribute(typeof(SpeedConverter))]
    public struct Speed : IComparable, IFormattable,
    	IConvertible, IComparable<Speed>, IComparable<double>, IEquatable<Speed>,
    	IEquatable<double>

VB
View Source Request Example

    <SerializableAttribute>
    <TypeConverterAttribute(GetType(SpeedConverter))>
    Public Structure Speed
    	Implements IComparable, IFormattable, IConvertible, IComparable(Of Speed),
    	IComparable(Of Double), IEquatable(Of Speed), IEquatable(Of Double)

C++
View Source Request Example

    [SerializableAttribute]
    [TypeConverterAttribute(typeof(SpeedConverter))]
    public value class Speed : IComparable,
    	IFormattable, IConvertible, IComparable<Speed>, IComparable<double>,
    	IEquatable<Speed>, IEquatable<double>

JavaScript
View Source Request Example

    JavaScript supports the use of structures, but not the declaration of new ones.

Inheritance
  Object ValueType Speed

Implements
  IComparable, IComparable Speed, IComparable Double, IConvertible, IEquatable Speed, IEquatable Double, IFormattable

## 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: `public double GetKilometersPerHour(double milesPerHour) { return Speed.FromMilesPerHour(milesPerHour).ToKilometersPerHour(); }`

## Constructors

Speed | Creates a new Speed.

## Methods

CompareTo(Double) | Compares this instance to a specified Double and returns an indication of their relative values.
CompareTo(Object) | Compares this instance to a specified object and returns an indication of their relative values.
CompareTo(Speed) | Compares this instance to a specified Speed and returns an indication of their relative values.
ConvertFrom | Converts the value in the specified sourceUnit to a new Speed in meters per second.
ConvertTo | Converts the Speed to the specified targetUnit.
Equals(Double) | Returns a value indicating whether this instance is equal to a specified Double value.
Equals(Object) | Returns a value indicating whether this instance is equal to a specified object. (Overrides ValueTypeEquals(Object))
Equals(Speed) | Returns a value indicating whether this instance is equal to a specified Speed value.
FromFeetPerMinute | Creates a new Speed value from the specified value in feet per minute.
FromInchesPerSecond | Creates a new Speed value from the specified value in inches per second.
FromKilometersPerHour | Creates a new Speed value from the specified value in kilometers per hour.
FromKnots | Creates a new Speed value from the specified value in knots (International).
FromMach | Creates a new Speed value from the specified value in Mach.
FromMilesPerHour | Creates a new Speed value from the specified value in miles per hour.
GetHashCode | Returns the hash code for this instance. (Overrides ValueTypeGetHashCode)
GetType | Gets the Type of the current instance. (Inherited from Object)
GetTypeCode | Returns the TypeCode for value type Double.
Parse(String) | Converts the string representation of a number to its Speed equivalent.
Parse(String, NumberStyles) | Converts the string representation of a number in a specified style to its Speed equivalent.
Parse(String, IFormatProvider) | Converts the string representation of a number in a specified culture-specific format to its Speed equivalent.
Parse(String, NumberStyles, IFormatProvider) | Converts the string representation of a number in a specified style and culture-specific format to its Speed equivalent.
ToFeetPerMinute | Gets the Speed value in feet per minute.
ToInchesPerSecond | Gets the Speed value in inches per second.
ToKilometersPerHour | Gets the Speed value in kilometers per hour.
ToKnots | Gets the Speed value in knots (International).
ToMach | Gets the Speed value in Mach.
ToMilesPerHour | Gets the Speed value in miles per hour.
ToString | Converts the numeric value of this instance to its equivalent string representation. (Overrides ValueTypeToString)
ToString(IFormatProvider) | Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
ToString(String) | Converts the numeric value of this instance to its equivalent string representation, using the specified format.
ToString(String, IFormatProvider) | Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
TryParse(String, Speed) | Converts the string representation of a number to its Speed equivalent. A return value indicates whether the conversion succeeded or failed.
TryParse(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.

## Operators

Addition(Speed, Speed) | Returns computed sum of values.
Division(Speed, Speed) | Returns computed division of values.
Equality(Speed, Speed) | Compares the two values for equality.
Exponent(Speed, Speed) | Returns result of first value raised to speed of second value.
GreaterThan(Speed, Speed) | Returns true if left value is greater than right value.
GreaterThanOrEqual(Speed, Speed) | Returns true if left value is greater than or equal to right value.
(Double to Speed) | Implicitly converts value, represented in meters per second, to a Speed.
(Speed to Double) | Implicitly converts Speed, represented in meters per second, to a Double.
Inequality(Speed, Speed) | Compares the two values for inequality.
LessThan(Speed, Speed) | Returns true if left value is less than right value.
LessThanOrEqual(Speed, Speed) | Returns true if left value is less or equal to than right value.
Modulus(Speed, Speed) | Returns computed remainder after dividing first value by the second.
Multiply(Speed, Speed) | Returns computed product of values.
Subtraction(Speed, Speed) | Returns computed difference of values.

## Fields

MaxValue | Represents the largest possible value of an Speed. This field is constant.
MinValue | Represents the smallest possible value of an Speed. This field is constant.

## Extension Methods

GetEnumValueOrDefault | Gets the enumeration constant for value, if defined in the enumeration, or a default value. (Defined by EnumExtensions)
GetEnumValueOrDefaultT | Gets the enumeration constant for this value, if defined in the enumeration, or a default value. (Defined by EnumExtensions)

## See Also

#### Reference

Gemstone.Units Namespace