diff --git a/UnitsNet.Tests/CustomCode/AreaTests.cs b/UnitsNet.Tests/CustomCode/AreaTests.cs index 322b519d74..6c0f6a20a2 100644 --- a/UnitsNet.Tests/CustomCode/AreaTests.cs +++ b/UnitsNet.Tests/CustomCode/AreaTests.cs @@ -45,6 +45,13 @@ public void AreaDividedByLengthEqualsLength() Assert.Equal(length, Length.FromMeters(10)); } + [Fact] + public void AreaDividedByVolumeEqualsReciprocalLength() + { + ReciprocalLength reciprocalLength = Area.FromSquareMeters(50) / Volume.FromCubicMeters(5); + Assert.Equal(reciprocalLength, ReciprocalLength.FromInverseMeters(10)); + } + [Fact] public void AreaTimesMassFluxEqualsMassFlow() { diff --git a/UnitsNet.Tests/CustomCode/LengthTests.cs b/UnitsNet.Tests/CustomCode/LengthTests.cs index 4f888a23c2..2f3e74e892 100644 --- a/UnitsNet.Tests/CustomCode/LengthTests.cs +++ b/UnitsNet.Tests/CustomCode/LengthTests.cs @@ -134,6 +134,20 @@ public void LengthDividedBySpeedEqualsDuration() Assert.Equal(Duration.FromSeconds(10), duration); } + [Fact] + public void LengthDividedByAreaEqualsReciprocalLength() + { + ReciprocalLength reciprocalLength = Length.FromMeters(20) / Area.FromSquareMeters(2); + Assert.Equal(ReciprocalLength.FromInverseMeters(10), reciprocalLength); + } + + [Fact] + public void LengthDividedByVolumeEqualsReciprocalArea() + { + ReciprocalArea reciprocalArea = Length.FromMeters(20) / Volume.FromCubicMeters(2); + Assert.Equal(ReciprocalArea.FromInverseSquareMeters(10), reciprocalArea); + } + [Fact] public void LengthTimesSpeedEqualsKinematicViscosity() { diff --git a/UnitsNet/CustomCode/Quantities/Area.extra.cs b/UnitsNet/CustomCode/Quantities/Area.extra.cs index 8df2a275d3..9a7da2f28a 100644 --- a/UnitsNet/CustomCode/Quantities/Area.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Area.extra.cs @@ -42,6 +42,12 @@ public ReciprocalArea Inverse() return Length.FromMeters(area.SquareMeters / length.Meters); } + /// Get from divided by . + public static ReciprocalLength operator /(Area area, Volume volume) + { + return ReciprocalLength.FromInverseMeters(area.SquareMeters / volume.CubicMeters); + } + /// Get from times . public static MassFlow operator *(Area area, MassFlux massFlux) { diff --git a/UnitsNet/CustomCode/Quantities/Length.extra.cs b/UnitsNet/CustomCode/Quantities/Length.extra.cs index 7c41035344..159a8dc793 100644 --- a/UnitsNet/CustomCode/Quantities/Length.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Length.extra.cs @@ -141,6 +141,18 @@ public static bool TryParseFeetInches(string? str, out Length result, IFormatPro return Duration.FromSeconds(length.Meters/speed.MetersPerSecond); } + /// Get from divided by . + public static ReciprocalLength operator /(Length length, Area area) + { + return ReciprocalLength.FromInverseMeters(length.Meters / area.SquareMeters); + } + + /// Get from divided by . + public static ReciprocalArea operator /(Length length, Volume volume) + { + return ReciprocalArea.FromInverseSquareMeters(length.Meters / volume.CubicMeters); + } + /// Get from times . public static Area operator *(Length length1, Length length2) {