forked from angularsen/UnitsNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TemperatureDelta / Duration = TemperatureChangeRate (angularsen#1370
) Added missing operator to divide a TemperatureDelta by a time/duration to get the TemperatureChangeRate. --------- Co-authored-by: Andreas Gullberg Larsen <[email protected]>
- Loading branch information
1 parent
d389213
commit aa61d5a
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
// Licensed under MIT No Attribution, see LICENSE file at the root. | ||
// Copyright 2013 Andreas Gullberg Larsen ([email protected]). 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; | ||
} | ||
|
||
/// <summary> Get <see cref="TemperatureChangeRate"/> from <see cref="TemperatureDelta"/> divided by <see cref="TimeSpan"/>.</summary> | ||
public static TemperatureChangeRate operator /(TemperatureDelta temperatureDelta, TimeSpan timespan) | ||
{ | ||
return TemperatureChangeRate.FromDegreesCelsiusPerSecond(temperatureDelta.Kelvins / timespan.TotalSeconds); | ||
} | ||
|
||
/// <summary> Get <see cref="TemperatureChangeRate"/> from <see cref="TemperatureDelta"/> divided by <see cref="Duration"/>.</summary> | ||
public static TemperatureChangeRate operator /(TemperatureDelta temperatureDelta, Duration duration) | ||
{ | ||
return TemperatureChangeRate.FromDegreesCelsiusPerSecond(temperatureDelta.Kelvins / duration.Seconds); | ||
} | ||
} | ||
} |