File tree 2 files changed +13
-0
lines changed
UnitsNet/CustomCode/Quantities
UnitsNet.Tests/CustomCode 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,13 @@ public void SpeedDividedByDurationEqualsAcceleration()
103
103
Assert . Equal ( acceleration , Acceleration . FromMetersPerSecondSquared ( 10 ) ) ;
104
104
}
105
105
106
+ [ Fact ]
107
+ public void SpeedDividedByAccelerationEqualsDuration ( )
108
+ {
109
+ Duration duration = Speed . FromMetersPerSecond ( 20 ) / Acceleration . FromMetersPerSecondSquared ( 2 ) ;
110
+ Assert . Equal ( Duration . FromSeconds ( 10 ) , duration ) ;
111
+ }
112
+
106
113
[ Fact ]
107
114
public void SpeedDividedByTimeSpanEqualsAcceleration ( )
108
115
{
Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ public partial struct Speed
31
31
return Acceleration . FromMetersPerSecondSquared ( speed . MetersPerSecond / duration . Seconds ) ;
32
32
}
33
33
34
+ /// <summary>Get <see cref="Duration"/> from <see cref="Speed"/> divided by <see cref="Acceleration"/>.</summary>
35
+ public static Duration operator / ( Speed speed , Acceleration acceleration )
36
+ {
37
+ return Duration . FromSeconds ( speed . MetersPerSecond / acceleration . MetersPerSecondSquared ) ;
38
+ }
39
+
34
40
/// <summary>Get <see cref="Length"/> from <see cref="Speed"/> times <see cref="Duration"/>.</summary>
35
41
public static Length operator * ( Speed speed , Duration duration )
36
42
{
You can’t perform that action at this time.
0 commit comments