diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 2dd67625dd..89724a7161 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -42,6 +42,7 @@ namespace UnitsNet public readonly partial struct Acceleration : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IMultiplyOperators, IDivisionOperators, IMultiplyOperators, @@ -646,6 +647,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Accel #region Relational Operators + /// Get from / . + public static Duration operator /(Acceleration acceleration, Jerk jerk) + { + return Duration.FromSeconds(acceleration.MetersPerSecondSquared / jerk.MetersPerSecondCubed); + } + /// Get from * . public static Force operator *(Acceleration acceleration, Mass mass) { diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index c76c9b5b8a..58975e193f 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -42,7 +42,9 @@ namespace UnitsNet public readonly partial struct AmountOfSubstance : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IMultiplyOperators, + IDivisionOperators, IDivisionOperators, IDivisionOperators, #endif @@ -693,12 +695,24 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Amoun #region Relational Operators + /// Get from / . + public static Duration operator /(AmountOfSubstance amountOfSubstance, MolarFlow molarFlow) + { + return Duration.FromSeconds(amountOfSubstance.Kilomoles / molarFlow.KilomolesPerSecond); + } + /// Get from * . public static Mass operator *(AmountOfSubstance amountOfSubstance, MolarMass molarMass) { return Mass.FromGrams(amountOfSubstance.Moles * molarMass.GramsPerMole); } + /// Get from / . + public static MolarFlow operator /(AmountOfSubstance amountOfSubstance, Duration duration) + { + return MolarFlow.FromKilomolesPerSecond(amountOfSubstance.Kilomoles / duration.Seconds); + } + /// Get from / . public static Molarity operator /(AmountOfSubstance amountOfSubstance, Volume volume) { diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 30e9c87f47..4779c595ef 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -42,6 +42,7 @@ namespace UnitsNet public readonly partial struct Angle : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IDivisionOperators, IMultiplyOperators, #endif @@ -676,6 +677,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Angle #region Relational Operators + /// Get from / . + public static Duration operator /(Angle angle, RotationalSpeed rotationalSpeed) + { + return Duration.FromSeconds(angle.Radians / rotationalSpeed.RadiansPerSecond); + } + /// Get from / . public static RotationalSpeed operator /(Angle angle, Duration duration) { diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 23fc12cd84..4dbb6648d8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -42,8 +42,10 @@ namespace UnitsNet public readonly partial struct Area : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, IDivisionOperators, IMultiplyOperators, IMultiplyOperators, @@ -654,6 +656,19 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaU #region Relational Operators + /// Calculates the inverse of this quantity. + /// The corresponding inverse quantity, . + public ReciprocalArea Inverse() + { + return SquareMeters == 0.0 ? ReciprocalArea.Zero : ReciprocalArea.FromInverseSquareMeters(1 / SquareMeters); + } + + /// Get from / . + public static Duration operator /(Area area, KinematicViscosity kinematicViscosity) + { + return Duration.FromSeconds(area.SquareMeters / kinematicViscosity.SquareMetersPerSecond); + } + /// Get from * . public static Force operator *(Area area, Pressure pressure) { @@ -666,6 +681,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaU return ForcePerLength.FromNewtonsPerMeter(area.SquareMeters * specificWeight.NewtonsPerCubicMeter); } + /// Get from / . + public static KinematicViscosity operator /(Area area, Duration duration) + { + return KinematicViscosity.FromSquareMetersPerSecond(area.SquareMeters / duration.Seconds); + } + /// Get from / . public static Length operator /(Area area, Length length) { @@ -693,7 +714,7 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaU /// Get from * . public static MassFlow operator *(Area area, MassFlux massFlux) { - return MassFlow.FromGramsPerSecond(area.SquareMeters * massFlux.GramsPerSecondPerSquareMeter); + return MassFlow.FromKilogramsPerSecond(area.SquareMeters * massFlux.KilogramsPerSecondPerSquareMeter); } /// Get from * . @@ -708,13 +729,6 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaU return Ratio.FromDecimalFractions(area.SquareMeters * reciprocalArea.InverseSquareMeters); } - /// Calculates the inverse of this quantity. - /// The corresponding inverse quantity, . - public ReciprocalArea Inverse() - { - return SquareMeters == 0.0 ? ReciprocalArea.Zero : ReciprocalArea.FromInverseSquareMeters(1 / SquareMeters); - } - /// Get from * . public static Torque operator *(Area area, ForcePerLength forcePerLength) { diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 25e70f94d7..840e9b6d03 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -42,6 +42,7 @@ namespace UnitsNet public readonly partial struct AreaMomentOfInertia : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -515,6 +516,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaM #region Relational Operators + /// Get from / . + public static Length operator /(AreaMomentOfInertia areaMomentOfInertia, Volume volume) + { + return Length.FromMeters(areaMomentOfInertia.MetersToTheFourth / volume.CubicMeters); + } + /// Get from / . public static Volume operator /(AreaMomentOfInertia areaMomentOfInertia, Length length) { diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs index ab35f654f4..b931c4e7fe 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs @@ -569,6 +569,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Coeff #region Relational Operators + /// Get from / . + public static TemperatureDelta operator /(double value, CoefficientOfThermalExpansion coefficientOfThermalExpansion) + { + return TemperatureDelta.FromKelvins(value / coefficientOfThermalExpansion.PerKelvin); + } + /// Get from * . public static double operator *(CoefficientOfThermalExpansion coefficientOfThermalExpansion, TemperatureDelta temperatureDelta) { diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 331e969778..54634fe5d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -52,6 +52,7 @@ namespace UnitsNet IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, + IMultiplyOperators, #endif IComparable, IComparable, @@ -1360,12 +1361,24 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Densi return MassFlux.FromKilogramsPerSecondPerSquareMeter(density.KilogramsPerCubicMeter * speed.MetersPerSecond); } + /// Get from / . + public static SpecificVolume operator /(double value, Density density) + { + return SpecificVolume.FromCubicMetersPerKilogram(value / density.KilogramsPerCubicMeter); + } + /// Get from * . public static SpecificWeight operator *(Density density, Acceleration acceleration) { return SpecificWeight.FromNewtonsPerCubicMeter(density.KilogramsPerCubicMeter * acceleration.MetersPerSecondSquared); } + /// Get from * . + public static double operator *(Density density, SpecificVolume specificVolume) + { + return density.KilogramsPerCubicMeter * specificVolume.CubicMetersPerKilogram; + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index e7d4c4c012..188f396f88 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -42,6 +42,7 @@ namespace UnitsNet public readonly partial struct Duration : IArithmeticQuantity, #if NET7_0_OR_GREATER + IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, @@ -607,6 +608,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Durat #region Relational Operators + /// Get from * . + public static Acceleration operator *(Duration duration, Jerk jerk) + { + return Acceleration.FromMetersPerSecondSquared(duration.Seconds * jerk.MetersPerSecondCubed); + } + /// Get from * . public static AmountOfSubstance operator *(Duration duration, MolarFlow molarFlow) { diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 19a6692710..b38c05ab62 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -45,6 +45,7 @@ namespace UnitsNet public readonly partial struct DynamicViscosity : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -582,6 +583,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Dynam #region Relational Operators + /// Get from / . + public static Density operator /(DynamicViscosity dynamicViscosity, KinematicViscosity kinematicViscosity) + { + return Density.FromKilogramsPerCubicMeter(dynamicViscosity.NewtonSecondsPerMeterSquared / kinematicViscosity.SquareMetersPerSecond); + } + /// Get from / . public static KinematicViscosity operator /(DynamicViscosity dynamicViscosity, Density density) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index 9a5d304d76..d0ea9143fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -42,6 +42,7 @@ namespace UnitsNet public readonly partial struct ElectricCurrent : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IMultiplyOperators, IDivisionOperators, IMultiplyOperators, @@ -566,6 +567,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect #region Relational Operators + /// Get from / . + public static Duration operator /(ElectricCurrent electricCurrent, ElectricCurrentGradient electricCurrentGradient) + { + return Duration.FromSeconds(electricCurrent.Amperes / electricCurrentGradient.AmperesPerSecond); + } + /// Get from * . public static ElectricCharge operator *(ElectricCurrent electricCurrent, Duration duration) { diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index 3710d9f452..bf03909e6e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -45,12 +45,14 @@ namespace UnitsNet IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, IDivisionOperators, IDivisionOperators, IMultiplyOperators, IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -1085,6 +1087,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Energ return ElectricPotential.FromVolts(energy.Joules / electricCharge.Coulombs); } + /// Get from / . + public static EnergyDensity operator /(Energy energy, Volume volume) + { + return EnergyDensity.FromJoulesPerCubicMeter(energy.Joules / volume.CubicMeters); + } + /// Get from / . public static Entropy operator /(Energy energy, TemperatureDelta temperatureDelta) { @@ -1121,6 +1129,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Energ return TemperatureDelta.FromKelvins(energy.Joules / entropy.JoulesPerKelvin); } + /// Get from / . + public static Volume operator /(Energy energy, EnergyDensity energyDensity) + { + return Volume.FromCubicMeters(energy.Joules / energyDensity.JoulesPerCubicMeter); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index a63179ab80..44ae5ecd7a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -43,6 +43,7 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -538,6 +539,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Entro return Energy.FromJoules(entropy.JoulesPerKelvin * temperatureDelta.Kelvins); } + /// Get from / . + public static Mass operator /(Entropy entropy, SpecificEntropy specificEntropy) + { + return Mass.FromKilograms(entropy.JoulesPerKelvin / specificEntropy.JoulesPerKilogramKelvin); + } + /// Get from / . public static SpecificEntropy operator /(Entropy entropy, Mass mass) { diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index f0495ec4e3..a1274c9d42 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -43,7 +43,9 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, + IDivisionOperators, IDivisionOperators, + IDivisionOperators, IMultiplyOperators, IDivisionOperators, IDivisionOperators, @@ -674,12 +676,24 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force return Acceleration.FromMetersPerSecondSquared(force.Newtons / mass.Kilograms); } + /// Get from / . + public static Area operator /(Force force, Pressure pressure) + { + return Area.FromSquareMeters(force.Newtons / pressure.Pascals); + } + /// Get from / . public static Duration operator /(Force force, ForceChangeRate forceChangeRate) { return Duration.FromSeconds(force.Newtons / forceChangeRate.NewtonsPerSecond); } + /// Get from / . + public static ForceChangeRate operator /(Force force, Duration duration) + { + return ForceChangeRate.FromNewtonsPerSecond(force.Newtons / duration.Seconds); + } + /// Get from * . public static ForcePerLength operator *(Force force, ReciprocalLength reciprocalLength) { diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index 5388adea49..b33a84b513 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -42,10 +42,14 @@ namespace UnitsNet public readonly partial struct ForcePerLength : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IMultiplyOperators, IDivisionOperators, + IDivisionOperators, IMultiplyOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IMultiplyOperators, #endif IComparable, @@ -1031,6 +1035,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force #region Relational Operators + /// Get from / . + public static Area operator /(ForcePerLength forcePerLength, SpecificWeight specificWeight) + { + return Area.FromSquareMeters(forcePerLength.NewtonsPerMeter / specificWeight.NewtonsPerCubicMeter); + } + /// Get from * . public static Force operator *(ForcePerLength forcePerLength, Length length) { @@ -1043,6 +1053,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force return Force.FromNewtons(forcePerLength.NewtonsPerMeter / reciprocalLength.InverseMeters); } + /// Get from / . + public static Length operator /(ForcePerLength forcePerLength, Pressure pressure) + { + return Length.FromMeters(forcePerLength.NewtonsPerMeter / pressure.NewtonsPerSquareMeter); + } + /// Get from * . public static Pressure operator *(ForcePerLength forcePerLength, ReciprocalLength reciprocalLength) { @@ -1055,6 +1071,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force return Pressure.FromNewtonsPerSquareMeter(forcePerLength.NewtonsPerMeter / length.Meters); } + /// Get from / . + public static ReciprocalLength operator /(ForcePerLength forcePerLength, Force force) + { + return ReciprocalLength.FromInverseMeters(forcePerLength.NewtonsPerMeter / force.Newtons); + } + + /// Get from / . + public static SpecificWeight operator /(ForcePerLength forcePerLength, Area area) + { + return SpecificWeight.FromNewtonsPerCubicMeter(forcePerLength.NewtonsPerMeter / area.SquareMeters); + } + /// Get from * . public static Torque operator *(ForcePerLength forcePerLength, Area area) { diff --git a/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs b/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs index f3766501e4..657f51c33d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,9 @@ namespace UnitsNet [DataContract] public readonly partial struct Jerk : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -587,6 +593,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out JerkU #endregion + #region Relational Operators + + /// Get from * . + public static Acceleration operator *(Jerk jerk, Duration duration) + { + return Acceleration.FromMetersPerSecondSquared(jerk.MetersPerSecondCubed * duration.Seconds); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index e8fe56ad67..19dc50df99 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -47,6 +47,7 @@ namespace UnitsNet #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -580,6 +581,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Kinem return DynamicViscosity.FromNewtonSecondsPerMeterSquared(kinematicViscosity.SquareMetersPerSecond * density.KilogramsPerCubicMeter); } + /// Get from / . + public static Length operator /(KinematicViscosity kinematicViscosity, Speed speed) + { + return Length.FromMeters(kinematicViscosity.SquareMetersPerSecond / speed.MetersPerSecond); + } + /// Get from / . public static Speed operator /(KinematicViscosity kinematicViscosity, Length length) { diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index e6695b1d5b..6e4ae98f80 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -43,11 +43,14 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, + IMultiplyOperators, IDivisionOperators, IMultiplyOperators, + IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, + IMultiplyOperators, IMultiplyOperators, IDivisionOperators, IMultiplyOperators, @@ -1101,12 +1104,25 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lengt #region Relational Operators + /// Calculates the inverse of this quantity. + /// The corresponding inverse quantity, . + public ReciprocalLength Inverse() + { + return Meters == 0.0 ? ReciprocalLength.Zero : ReciprocalLength.FromInverseMeters(1 / Meters); + } + /// Get from * . public static Area operator *(Length left, Length right) { return Area.FromSquareMeters(left.Meters * right.Meters); } + /// Get from * . + public static AreaMomentOfInertia operator *(Length length, Volume volume) + { + return AreaMomentOfInertia.FromMetersToTheFourth(length.Meters * volume.CubicMeters); + } + /// Get from / . public static Duration operator /(Length length, Speed speed) { @@ -1119,6 +1135,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lengt return Force.FromNewtons(length.Meters * forcePerLength.NewtonsPerMeter); } + /// Get from * . + public static ForcePerLength operator *(Length length, Pressure pressure) + { + return ForcePerLength.FromNewtonsPerMeter(length.Meters * pressure.NewtonsPerSquareMeter); + } + /// Get from * . public static KinematicViscosity operator *(Length length, Speed speed) { @@ -1137,11 +1159,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lengt return Pressure.FromPascals(length.Meters * specificWeight.NewtonsPerCubicMeter); } - /// Calculates the inverse of this quantity. - /// The corresponding inverse quantity, . - public ReciprocalLength Inverse() + /// Get from * . + public static ReciprocalLength operator *(Length length, ReciprocalArea reciprocalArea) { - return Meters == 0.0 ? ReciprocalLength.Zero : ReciprocalLength.FromInverseMeters(1 / Meters); + return ReciprocalLength.FromInverseMeters(length.Meters * reciprocalArea.InverseSquareMeters); } /// Get from * . diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index fbb52246e6..6c8463810c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -46,6 +46,7 @@ namespace UnitsNet IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, @@ -54,6 +55,7 @@ namespace UnitsNet IMultiplyOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, IMultiplyOperators, IDivisionOperators, #endif @@ -867,7 +869,7 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassU /// Get from / . public static AmountOfSubstance operator /(Mass mass, MolarMass molarMass) { - return AmountOfSubstance.FromMoles(mass.Kilograms / molarMass.KilogramsPerMole); + return AmountOfSubstance.FromMoles(mass.Grams / molarMass.GramsPerMole); } /// Get from / . @@ -888,6 +890,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassU return Density.FromKilogramsPerCubicMeter(mass.Kilograms / volume.CubicMeters); } + /// Get from / . + public static Duration operator /(Mass mass, MassFlow massFlow) + { + return Duration.FromSeconds(mass.Kilograms / massFlow.KilogramsPerSecond); + } + /// Get from * . public static Energy operator *(Mass mass, SpecificEnergy specificEnergy) { @@ -936,6 +944,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassU return MassFlow.FromKilogramsPerSecond(mass.Kilograms / duration.Seconds); } + /// Get from / . + public static MolarMass operator /(Mass mass, AmountOfSubstance amountOfSubstance) + { + return MolarMass.FromGramsPerMole(mass.Grams / amountOfSubstance.Moles); + } + /// Get from * . public static Volume operator *(Mass mass, SpecificVolume specificVolume) { diff --git a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs index ab3824391e..b3bd701696 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs @@ -45,7 +45,9 @@ namespace UnitsNet public readonly partial struct MassConcentration : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IMultiplyOperators, + IDivisionOperators, IDivisionOperators, IDivisionOperators, #endif @@ -1208,16 +1210,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassC #region Relational Operators + /// Get from / . + public static Density operator /(MassConcentration massConcentration, VolumeConcentration volumeConcentration) + { + return Density.FromKilogramsPerCubicMeter(massConcentration.KilogramsPerCubicMeter / volumeConcentration.DecimalFractions); + } + /// Get from * . public static Mass operator *(MassConcentration massConcentration, Volume volume) { return Mass.FromKilograms(massConcentration.KilogramsPerCubicMeter * volume.CubicMeters); } + /// Get from / . + public static MolarMass operator /(MassConcentration massConcentration, Molarity molarity) + { + return MolarMass.FromKilogramsPerMole(massConcentration.KilogramsPerCubicMeter / molarity.MolesPerCubicMeter); + } + /// Get from / . public static Molarity operator /(MassConcentration massConcentration, MolarMass molarMass) { - return Molarity.FromMolesPerCubicMeter(massConcentration.GramsPerCubicMeter / molarMass.GramsPerMole); + return Molarity.FromMolesPerCubicMeter(massConcentration.KilogramsPerCubicMeter / molarMass.KilogramsPerMole); } /// Get from / . diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 2dc2d81e6c..5c62f5b89c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -47,6 +47,8 @@ namespace UnitsNet IDivisionOperators, IMultiplyOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IMultiplyOperators, IDivisionOperators, IDivisionOperators, @@ -984,6 +986,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassF return MassFlux.FromKilogramsPerSecondPerSquareMeter(massFlow.KilogramsPerSecond / area.SquareMeters); } + /// Get from / . + public static MolarFlow operator /(MassFlow massFlow, MolarMass molarMass) + { + return MolarFlow.FromKilomolesPerSecond(massFlow.KilogramsPerSecond / molarMass.KilogramsPerKilomole); + } + + /// Get from / . + public static MolarMass operator /(MassFlow massFlow, MolarFlow molarFlow) + { + return MolarMass.FromKilogramsPerKilomole(massFlow.KilogramsPerSecond / molarFlow.KilomolesPerSecond); + } + /// Get from * . public static Power operator *(MassFlow massFlow, SpecificEnergy specificEnergy) { diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index 5b22a0347c..51e34f5505 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -622,7 +622,7 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassF /// Get from * . public static MassFlow operator *(MassFlux massFlux, Area area) { - return MassFlow.FromGramsPerSecond(massFlux.GramsPerSecondPerSquareMeter * area.SquareMeters); + return MassFlow.FromKilogramsPerSecond(massFlux.KilogramsPerSecondPerSquareMeter * area.SquareMeters); } /// Get from / . diff --git a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs index fdd3530417..0ee93f35f4 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs @@ -44,6 +44,7 @@ namespace UnitsNet #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -577,6 +578,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar return MassFlow.FromKilogramsPerSecond(molarFlow.KilomolesPerSecond * molarMass.KilogramsPerKilomole); } + /// Get from / . + public static Molarity operator /(MolarFlow molarFlow, VolumeFlow volumeFlow) + { + return Molarity.FromMolesPerCubicMeter(molarFlow.MolesPerSecond / volumeFlow.CubicMetersPerSecond); + } + /// Get from / . public static VolumeFlow operator /(MolarFlow molarFlow, Molarity molarity) { diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 1857133cc9..37114c0762 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -638,7 +638,7 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar /// Get from * . public static MassConcentration operator *(MolarMass molarMass, Molarity molarity) { - return MassConcentration.FromGramsPerCubicMeter(molarMass.GramsPerMole * molarity.MolesPerCubicMeter); + return MassConcentration.FromKilogramsPerCubicMeter(molarMass.KilogramsPerMole * molarity.MolesPerCubicMeter); } /// Get from * . diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 20d292ea00..edc4201ad7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -45,8 +45,11 @@ namespace UnitsNet public readonly partial struct Molarity : IArithmeticQuantity, #if NET7_0_OR_GREATER + IMultiplyOperators, IMultiplyOperators, + IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -599,10 +602,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar #region Relational Operators + /// Get from * . + public static AmountOfSubstance operator *(Molarity molarity, Volume volume) + { + return AmountOfSubstance.FromMoles(molarity.MolesPerCubicMeter * volume.CubicMeters); + } + /// Get from * . public static MassConcentration operator *(Molarity molarity, MolarMass molarMass) { - return MassConcentration.FromGramsPerCubicMeter(molarity.MolesPerCubicMeter * molarMass.GramsPerMole); + return MassConcentration.FromKilogramsPerCubicMeter(molarity.MolesPerCubicMeter * molarMass.KilogramsPerMole); + } + + /// Get from * . + public static MolarFlow operator *(Molarity molarity, VolumeFlow volumeFlow) + { + return MolarFlow.FromMolesPerSecond(molarity.MolesPerCubicMeter * volumeFlow.CubicMetersPerSecond); } /// Get from * . @@ -611,6 +626,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar return Molarity.FromMolesPerCubicMeter(molarity.MolesPerCubicMeter * volumeConcentration.DecimalFractions); } + /// Get from / . + public static Molarity operator /(Molarity molarity, VolumeConcentration volumeConcentration) + { + return Molarity.FromMolesPerCubicMeter(molarity.MolesPerCubicMeter / volumeConcentration.DecimalFractions); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index 3514c7be25..20edecda3d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -46,12 +46,15 @@ namespace UnitsNet IDivisionOperators, IDivisionOperators, IMultiplyOperators, + IDivisionOperators, IDivisionOperators, + IDivisionOperators, IDivisionOperators, IMultiplyOperators, IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -869,12 +872,24 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power return Energy.FromJoules(power.Watts * duration.Seconds); } + /// Get from / . + public static Energy operator /(Power power, Frequency frequency) + { + return Energy.FromJoules(power.Watts / frequency.PerSecond); + } + /// Get from / . public static Force operator /(Power power, Speed speed) { return Force.FromNewtons(power.Watts / speed.MetersPerSecond); } + /// Get from / . + public static Frequency operator /(Power power, Energy energy) + { + return Frequency.FromPerSecond(power.Watts / energy.Joules); + } + /// Get from / . public static HeatFlux operator /(Power power, Area area) { @@ -905,6 +920,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power return SpecificEnergy.FromJoulesPerKilogram(power.Watts / massFlow.KilogramsPerSecond); } + /// Get from / . + public static Speed operator /(Power power, Force force) + { + return Speed.FromMetersPerSecond(power.Watts / force.Newtons); + } + /// Get from / . public static Torque operator /(Power power, RotationalSpeed rotationalSpeed) { diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index 461320f9ba..2b9b0ac0c2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -42,11 +42,15 @@ namespace UnitsNet public readonly partial struct Pressure : IArithmeticQuantity, #if NET7_0_OR_GREATER - IMultiplyOperators, + IDivisionOperators, IDivisionOperators, + IMultiplyOperators, + IMultiplyOperators, IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -1208,22 +1212,34 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Press #region Relational Operators + /// Get from / . + public static Duration operator /(Pressure pressure, PressureChangeRate pressureChangeRate) + { + return Duration.FromSeconds(pressure.Pascals / pressureChangeRate.PascalsPerSecond); + } + + /// Get from / . + public static Force operator /(Pressure pressure, ReciprocalArea reciprocalArea) + { + return Force.FromNewtons(pressure.NewtonsPerSquareMeter / reciprocalArea.InverseSquareMeters); + } + /// Get from * . public static Force operator *(Pressure pressure, Area area) { return Force.FromNewtons(pressure.Pascals * area.SquareMeters); } - /// Get from / . - public static Force operator /(Pressure pressure, ReciprocalArea reciprocalArea) + /// Get from * . + public static ForcePerLength operator *(Pressure pressure, Length length) { - return Force.FromNewtons(pressure.Pascals / reciprocalArea.InverseSquareMeters); + return ForcePerLength.FromNewtonsPerMeter(pressure.NewtonsPerSquareMeter * length.Meters); } /// Get from / . public static ForcePerLength operator /(Pressure pressure, ReciprocalLength reciprocalLength) { - return ForcePerLength.FromNewtonsPerMeter(pressure.Pascals / reciprocalLength.InverseMeters); + return ForcePerLength.FromNewtonsPerMeter(pressure.NewtonsPerSquareMeter / reciprocalLength.InverseMeters); } /// Get from / . @@ -1238,6 +1254,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Press return PressureChangeRate.FromPascalsPerSecond(pressure.Pascals / duration.Seconds); } + /// Get from / . + public static ReciprocalArea operator /(Pressure pressure, Force force) + { + return ReciprocalArea.FromInverseSquareMeters(pressure.NewtonsPerSquareMeter / force.Newtons); + } + + /// Get from / . + public static ReciprocalLength operator /(Pressure pressure, ForcePerLength forcePerLength) + { + return ReciprocalLength.FromInverseMeters(pressure.NewtonsPerSquareMeter / forcePerLength.NewtonsPerMeter); + } + /// Get from / . public static SpecificWeight operator /(Pressure pressure, Length length) { diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index 93351cfc49..b796ef11fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,10 @@ namespace UnitsNet [DataContract] public readonly partial struct Ratio : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -507,6 +514,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Ratio #endregion + #region Relational Operators + + /// Get from / . + public static Area operator /(Ratio ratio, ReciprocalArea reciprocalArea) + { + return Area.FromSquareMeters(ratio.DecimalFractions / reciprocalArea.InverseSquareMeters); + } + + /// Get from / . + public static ReciprocalArea operator /(Ratio ratio, Area area) + { + return ReciprocalArea.FromInverseSquareMeters(ratio.DecimalFractions / area.SquareMeters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs b/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs index 74b4bfab09..8bf4af8a24 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs @@ -47,6 +47,7 @@ namespace UnitsNet #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, + IMultiplyOperators, IDivisionOperators, #endif IComparable, @@ -600,6 +601,13 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Recip #region Relational Operators + /// Calculates the inverse of this quantity. + /// The corresponding inverse quantity, . + public Area Inverse() + { + return InverseSquareMeters == 0.0 ? Area.Zero : Area.FromSquareMeters(1 / InverseSquareMeters); + } + /// Get from * . public static Pressure operator *(ReciprocalArea reciprocalArea, Force force) { @@ -612,11 +620,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Recip return Ratio.FromDecimalFractions(reciprocalArea.InverseSquareMeters * area.SquareMeters); } - /// Calculates the inverse of this quantity. - /// The corresponding inverse quantity, . - public Area Inverse() + /// Get from * . + public static ReciprocalLength operator *(ReciprocalArea reciprocalArea, Length length) { - return InverseSquareMeters == 0.0 ? Area.Zero : Area.FromSquareMeters(1 / InverseSquareMeters); + return ReciprocalLength.FromInverseMeters(reciprocalArea.InverseSquareMeters * length.Meters); } /// Get from / . diff --git a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs index 5bc05e0eec..8fa5f8bcd3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs @@ -49,6 +49,7 @@ namespace UnitsNet IDivisionOperators, IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -585,6 +586,13 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Recip #region Relational Operators + /// Calculates the inverse of this quantity. + /// The corresponding inverse quantity, . + public Length Inverse() + { + return InverseMeters == 0.0 ? Length.Zero : Length.FromMeters(1 / InverseMeters); + } + /// Get from * . public static ForcePerLength operator *(ReciprocalLength reciprocalLength, Force force) { @@ -609,11 +617,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Recip return ReciprocalArea.FromInverseSquareMeters(left.InverseMeters * right.InverseMeters); } - /// Calculates the inverse of this quantity. - /// The corresponding inverse quantity, . - public Length Inverse() + /// Get from / . + public static ReciprocalArea operator /(ReciprocalLength reciprocalLength, Length length) { - return InverseMeters == 0.0 ? Length.Zero : Length.FromMeters(1 / InverseMeters); + return ReciprocalArea.FromInverseSquareMeters(reciprocalLength.InverseMeters / length.Meters); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 72a953fa87..2f917223fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -43,6 +43,7 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, + IMultiplyOperators, #endif IComparable, IComparable, @@ -633,6 +634,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Rotat return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * duration.Seconds); } + /// Get from * . + public static Power operator *(RotationalSpeed rotationalSpeed, Torque torque) + { + return Power.FromWatts(rotationalSpeed.RadiansPerSecond * torque.NewtonMeters); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 311617efc7..90133848e1 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -48,6 +48,8 @@ namespace UnitsNet IMultiplyOperators, IMultiplyOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IMultiplyOperators, #endif IComparable, @@ -929,6 +931,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci return SpecificEntropy.FromJoulesPerKilogramKelvin(specificEnergy.JoulesPerKilogram / temperatureDelta.Kelvins); } + /// Get from / . + public static Speed operator /(SpecificEnergy specificEnergy, Speed speed) + { + return Speed.FromMetersPerSecond(specificEnergy.JoulesPerKilogram / speed.MetersPerSecond); + } + + /// Get from / . + public static TemperatureDelta operator /(SpecificEnergy specificEnergy, SpecificEntropy specificEntropy) + { + return TemperatureDelta.FromKelvins(specificEnergy.JoulesPerKilogram / specificEntropy.JoulesPerKilogramKelvin); + } + /// Get from * . public static double operator *(SpecificEnergy specificEnergy, BrakeSpecificFuelConsumption brakeSpecificFuelConsumption) { diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index fcc1ed7e0e..c65602c990 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -43,6 +43,7 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, + IMultiplyOperators, #endif IComparable, IComparable, @@ -479,6 +480,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci return Volume.FromCubicMeters(specificVolume.CubicMetersPerKilogram * mass.Kilograms); } + /// Get from * . + public static double operator *(SpecificVolume specificVolume, Density density) + { + return specificVolume.CubicMetersPerKilogram * density.KilogramsPerCubicMeter; + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index 6d567d20d2..a3001d3e02 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -42,9 +42,11 @@ namespace UnitsNet public readonly partial struct TemperatureDelta : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IMultiplyOperators, IDivisionOperators, IMultiplyOperators, + IDivisionOperators, IDivisionOperators, IMultiplyOperators, #endif @@ -567,6 +569,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Tempe #region Relational Operators + /// Get from / . + public static CoefficientOfThermalExpansion operator /(double value, TemperatureDelta temperatureDelta) + { + return CoefficientOfThermalExpansion.FromPerKelvin(value / temperatureDelta.Kelvins); + } + + /// Get from / . + public static Duration operator /(TemperatureDelta temperatureDelta, TemperatureChangeRate temperatureChangeRate) + { + return Duration.FromSeconds(temperatureDelta.DegreesCelsius / temperatureChangeRate.DegreesCelsiusPerSecond); + } + /// Get from * . public static Energy operator *(TemperatureDelta temperatureDelta, Entropy entropy) { @@ -576,7 +590,7 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Tempe /// Get from / . public static Length operator /(TemperatureDelta temperatureDelta, TemperatureGradient temperatureGradient) { - return Length.FromKilometers(temperatureDelta.Kelvins / temperatureGradient.DegreesCelsiusPerKilometer); + return Length.FromKilometers(temperatureDelta.DegreesCelsius / temperatureGradient.DegreesCelsiusPerKilometer); } /// Get from * . @@ -585,10 +599,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Tempe return SpecificEnergy.FromJoulesPerKilogram(temperatureDelta.Kelvins * specificEntropy.JoulesPerKilogramKelvin); } + /// Get from / . + public static TemperatureChangeRate operator /(TemperatureDelta temperatureDelta, Duration duration) + { + return TemperatureChangeRate.FromDegreesCelsiusPerSecond(temperatureDelta.DegreesCelsius / duration.Seconds); + } + /// Get from / . public static TemperatureGradient operator /(TemperatureDelta temperatureDelta, Length length) { - return TemperatureGradient.FromKelvinsPerMeter(temperatureDelta.Kelvins / length.Meters); + return TemperatureGradient.FromDegreesCelsiusPerKilometer(temperatureDelta.DegreesCelsius / length.Kilometers); } /// Get from * . diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 694ad7a955..0f02672f0e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -43,8 +43,11 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, + IDivisionOperators, IDivisionOperators, + IDivisionOperators, IDivisionOperators, + IMultiplyOperators, IDivisionOperators, #endif IComparable, @@ -828,18 +831,36 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Torqu return Angle.FromRadians(torque.NewtonMeters / rotationalStiffness.NewtonMetersPerRadian); } + /// Get from / . + public static Area operator /(Torque torque, ForcePerLength forcePerLength) + { + return Area.FromSquareMeters(torque.NewtonMeters / forcePerLength.NewtonsPerMeter); + } + /// Get from / . public static Force operator /(Torque torque, Length length) { return Force.FromNewtons(torque.NewtonMeters / length.Meters); } + /// Get from / . + public static ForcePerLength operator /(Torque torque, Area area) + { + return ForcePerLength.FromNewtonsPerMeter(torque.NewtonMeters / area.SquareMeters); + } + /// Get from / . public static Length operator /(Torque torque, Force force) { return Length.FromMeters(torque.NewtonMeters / force.Newtons); } + /// Get from * . + public static Power operator *(Torque torque, RotationalSpeed rotationalSpeed) + { + return Power.FromWatts(torque.NewtonMeters * rotationalSpeed.RadiansPerSecond); + } + /// Get from / . public static RotationalStiffness operator /(Torque torque, Angle angle) { diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 1f7613d346..880acbe456 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -42,11 +42,16 @@ namespace UnitsNet public readonly partial struct Volume : IArithmeticQuantity, #if NET7_0_OR_GREATER + IMultiplyOperators, IDivisionOperators, + IMultiplyOperators, + IDivisionOperators, IMultiplyOperators, IDivisionOperators, IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -1288,12 +1293,30 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum #region Relational Operators + /// Get from * . + public static AmountOfSubstance operator *(Volume volume, Molarity molarity) + { + return AmountOfSubstance.FromMoles(volume.CubicMeters * molarity.MolesPerCubicMeter); + } + /// Get from / . public static Area operator /(Volume volume, Length length) { return Area.FromSquareMeters(volume.CubicMeters / length.Meters); } + /// Get from * . + public static AreaMomentOfInertia operator *(Volume volume, Length length) + { + return AreaMomentOfInertia.FromMetersToTheFourth(volume.CubicMeters * length.Meters); + } + + /// Get from / . + public static Duration operator /(Volume volume, VolumeFlow volumeFlow) + { + return Duration.FromSeconds(volume.CubicMeters / volumeFlow.CubicMetersPerSecond); + } + /// Get from * . public static Energy operator *(Volume volume, EnergyDensity energyDensity) { @@ -1318,6 +1341,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum return Mass.FromKilograms(volume.CubicMeters * massConcentration.KilogramsPerCubicMeter); } + /// Get from / . + public static Mass operator /(Volume volume, SpecificVolume specificVolume) + { + return Mass.FromKilograms(volume.CubicMeters / specificVolume.CubicMetersPerKilogram); + } + + /// Get from / . + public static SpecificVolume operator /(Volume volume, Mass mass) + { + return SpecificVolume.FromCubicMetersPerKilogram(volume.CubicMeters / mass.Kilograms); + } + /// Get from / . public static VolumeFlow operator /(Volume volume, Duration duration) { diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index bf86afcf8b..3c6413452c 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -44,6 +44,7 @@ namespace UnitsNet #if NET7_0_OR_GREATER IDivisionOperators, IMultiplyOperators, + IMultiplyOperators, IDivisionOperators, IMultiplyOperators, #endif @@ -1506,6 +1507,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum return MassFlow.FromKilogramsPerSecond(volumeFlow.CubicMetersPerSecond * density.KilogramsPerCubicMeter); } + /// Get from * . + public static MolarFlow operator *(VolumeFlow volumeFlow, Molarity molarity) + { + return MolarFlow.FromMolesPerSecond(volumeFlow.CubicMetersPerSecond * molarity.MolesPerCubicMeter); + } + /// Get from / . public static Speed operator /(VolumeFlow volumeFlow, Area area) {