diff --git a/UnitsNet.Tests/CustomCode/TemperatureDeltaTests.cs b/UnitsNet.Tests/CustomCode/TemperatureDeltaTests.cs
index 320609c8eb..abf2d33e35 100644
--- a/UnitsNet.Tests/CustomCode/TemperatureDeltaTests.cs
+++ b/UnitsNet.Tests/CustomCode/TemperatureDeltaTests.cs
@@ -64,5 +64,19 @@ public void TemperatureDeltaTimesEntropyEqualsEnergy()
Energy energy = TemperatureDelta.FromKelvins(20) * Entropy.FromJoulesPerKelvin(4);
Assert.Equal(Energy.FromJoules(80), energy);
}
+
+ [Fact]
+ public void TemperatureDeltaDividedByTimeSpanEqualsTemperatureChangeRate()
+ {
+ TemperatureChangeRate changeRate = TemperatureDelta.FromKelvins(20) / TimeSpan.FromSeconds(2);
+ Assert.Equal(TemperatureChangeRate.FromDegreesCelsiusPerSecond(10), changeRate);
+ }
+
+ [Fact]
+ public void TemperatureDeltaDividedByDurationEqualsTemperatureChangeRate()
+ {
+ TemperatureChangeRate changeRate = TemperatureDelta.FromKelvins(20) / Duration.FromSeconds(2);
+ Assert.Equal(TemperatureChangeRate.FromDegreesCelsiusPerSecond(10), changeRate);
+ }
}
}
diff --git a/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs b/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs
index e126f14d29..baa8d3e805 100644
--- a/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs
+++ b/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs
@@ -1,6 +1,8 @@
// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
+using System;
+
namespace UnitsNet
{
public partial struct TemperatureDelta
@@ -40,5 +42,17 @@ public partial struct TemperatureDelta
{
return temperatureDelta.Kelvins * cte.PerKelvin;
}
+
+ /// Get from divided by .
+ public static TemperatureChangeRate operator /(TemperatureDelta temperatureDelta, TimeSpan timespan)
+ {
+ return TemperatureChangeRate.FromDegreesCelsiusPerSecond(temperatureDelta.Kelvins / timespan.TotalSeconds);
+ }
+
+ /// Get from divided by .
+ public static TemperatureChangeRate operator /(TemperatureDelta temperatureDelta, Duration duration)
+ {
+ return TemperatureChangeRate.FromDegreesCelsiusPerSecond(temperatureDelta.Kelvins / duration.Seconds);
+ }
}
}