示例#1
0
 public void MetersToInternationalFeet(double meters, double internationalFeet)
 {
     Assert.Equal(internationalFeet, UnitConverters.MetersToInternationalFeet(meters));
 }
示例#2
0
 public void MilesToKilometers(double miles, double km)
 {
     Assert.Equal(km, UnitConverters.MilesToKilometers(miles), 4);
 }
示例#3
0
 public override double ConvertFromBaseUnits(double unitsInKelvin) => UnitConverters.CelsiusToFahrenheit(UnitConverters.KelvinToCelsius(unitsInKelvin));
示例#4
0
 public void RadiansToDegrees(double rad, double deg)
 {
     Assert.Equal(deg, UnitConverters.RadiansToDegrees(rad), 4);
 }
示例#5
0
 public override double ConvertFromBaseUnits(double unitsInKelvin) => UnitConverters.KelvinToCelsius(unitsInKelvin);
示例#6
0
 public void USSurveyFeetToMeters(double usFeet, double meters)
 {
     Assert.Equal(meters, UnitConverters.USSurveyFeetToMeters(usFeet));
 }
示例#7
0
 public void HectopascalsKilopascals(double hpa, double kpa)
 {
     Assert.Equal(kpa, UnitConverters.HectopascalsToKilopascals(hpa), 4);
 }
示例#8
0
 public override double ConvertToBaseUnits(double numberInOunces) => UnitConverters.PoundsToKilograms(numberInOunces / 16) * 1000;
示例#9
0
 public void PoundsToKilograms(double pounds, double kg)
 {
     Assert.Equal(kg, UnitConverters.PoundsToKilograms(pounds), 4);
 }
示例#10
0
 [InlineData(43.623409, -79.368683, 42.35866, -71.05674, 690.2032)]  // toronto -> boston, ma
 public void CoordinatesToKilometers(double lat1, double lon1, double lat2, double lon2, double distance)
 {
     Assert.Equal(distance, UnitConverters.CoordinatesToKilometers(lat1, lon1, lat2, lon2), 4);
 }
示例#11
0
 public override double ConvertFromBaseUnits(double numberInGrams) => UnitConverters.KilogramsToPounds(numberInGrams / 1000) * 16;
示例#12
0
 public override double ConvertToBaseUnits(double unitInYards) => UnitConverters.InternationalFeetToMeters(unitInYards * 3);
示例#13
0
 public override double ConvertFromBaseUnits(double unitInMeters) => UnitConverters.MetersToInternationalFeet(unitInMeters) / 3;
示例#14
0
 public override double ConvertToBaseUnits(double unitsInFahrenheit) => UnitConverters.CelsiusToKelvin(UnitConverters.FahrenheitToCelsius(unitsInFahrenheit));
示例#15
0
 public void InternationalFeetToMeters(double internationalFeet, double meters)
 {
     Assert.Equal(meters, UnitConverters.InternationalFeetToMeters(internationalFeet));
 }
示例#16
0
 public void PoundsToStones(double pounds, double stones)
 {
     Assert.Equal(stones, UnitConverters.PoundsToStones(pounds), 4);
 }
示例#17
0
 public void MetersToUSSurveyFeet(double meters, double usFeet)
 {
     Assert.Equal(usFeet, UnitConverters.MetersToUSSurveyFeet(meters));
 }
示例#18
0
 public void StonesToPounds(double stones, double pounds)
 {
     Assert.Equal(pounds, UnitConverters.StonesToPounds(stones), 4);
 }
示例#19
0
 public void RadiansPerSecondToDegreesPerSecond(double radians, double degrees)
 {
     Assert.Equal(degrees, UnitConverters.RadiansPerSecondToDegreesPerSecond(radians), 4);
 }
示例#20
0
 public void KilogramsToPounds(double kg, double pounds)
 {
     Assert.Equal(pounds, UnitConverters.KilogramsToPounds(kg), 4);
 }
示例#21
0
 public void DegreesToRadians(double deg, double rad)
 {
     Assert.Equal(rad, UnitConverters.DegreesToRadians(deg), 4);
 }
示例#22
0
 public void AtmospheresToPascals(double atm, double pascal) =>
 Assert.Equal(UnitConverters.AtmospheresToPascals(atm), pascal);
示例#23
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var temp = UnitConverters.KelvinToCelsius((double)value);

            return($"{temp:N2} °C");
        }
示例#24
0
 public void PascalsToAtmospheres(double pascal, double atm) =>
 Assert.Equal(UnitConverters.PascalsToAtmospheres(pascal), atm);
示例#25
0
 public override double ConvertToBaseUnits(double unitsInCelsius) => UnitConverters.CelsiusToKelvin(unitsInCelsius);
 public EventRenderingOptions(UnitConverters converters)
 {
     this.Converters = converters;
 }
示例#27
0
 public void KilometersToMiles(double km, double miles)
 {
     Assert.Equal(miles, UnitConverters.KilometersToMiles(km), 4);
 }
示例#28
0
 /// <inheritdoc cref="Track.Track(UnitConverters, TrackType)"/>
 /// <param name="initialPoints">
 /// A set of initial points to add into the point data collection.
 /// </param>
 public Track(
     UnitConverters converter,
     TrackType trackType,
     params (int Frame, int Bin, double Amplitude)[] initialPoints)