diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 79bc1d9af5..ecc21be3ab 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, IDivisionOperators, @@ -648,6 +649,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..2deb6cb7ae 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -42,7 +42,10 @@ namespace UnitsNet public readonly partial struct AmountOfSubstance : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, IDivisionOperators, #endif @@ -693,12 +696,30 @@ 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 MolarFlow operator /(AmountOfSubstance amountOfSubstance, TimeSpan timeSpan) + { + return MolarFlow.FromKilomolesPerSecond(amountOfSubstance.Kilomoles / timeSpan.TotalSeconds); + } + /// 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 e5c763b8a3..4877ab347d 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, IDivisionOperators, IMultiplyOperators, @@ -677,6 +678,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..c6d93090d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -42,8 +42,11 @@ namespace UnitsNet public readonly partial struct Area : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, IMultiplyOperators, IMultiplyOperators, @@ -654,6 +657,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 +682,18 @@ 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 KinematicViscosity operator /(Area area, TimeSpan timeSpan) + { + return KinematicViscosity.FromSquareMetersPerSecond(area.SquareMeters / timeSpan.TotalSeconds); + } + /// Get from / . public static Length operator /(Area area, Length length) { @@ -693,7 +721,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 +736,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 387cdf0626..2107891be8 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, IMultiplyOperators, IDivisionOperators, @@ -568,6 +569,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 010cdd2be9..521277cde5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -45,6 +45,7 @@ namespace UnitsNet IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, IDivisionOperators, IDivisionOperators, IMultiplyOperators, @@ -52,6 +53,7 @@ namespace UnitsNet IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -1086,6 +1088,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) { @@ -1128,6 +1136,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..67125a4a55 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -43,7 +43,10 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, + IDivisionOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IMultiplyOperators, IDivisionOperators, IDivisionOperators, @@ -674,12 +677,30 @@ 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 ForceChangeRate operator /(Force force, TimeSpan timeSpan) + { + return ForceChangeRate.FromNewtonsPerSecond(force.Newtons / timeSpan.TotalSeconds); + } + /// 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..30724c6a8e 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,10 @@ namespace UnitsNet [DataContract] public readonly partial struct Jerk : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -587,6 +594,28 @@ 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); + } + + /// Get from * . + public static Acceleration operator *(Jerk jerk, TimeSpan timeSpan) + { + return Acceleration.FromMetersPerSecondSquared(jerk.MetersPerSecondCubed * timeSpan.TotalSeconds); + } + + /// Get from * . + public static Acceleration operator *(TimeSpan timeSpan, Jerk jerk) + { + return Acceleration.FromMetersPerSecondSquared(timeSpan.TotalSeconds * jerk.MetersPerSecondCubed); + } + + #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 4276bcde9e..897e32aa85 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -48,6 +48,7 @@ namespace UnitsNet IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -593,6 +594,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 13fa343521..b67685a950 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, IDivisionOperators, @@ -1102,12 +1105,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) { @@ -1120,6 +1136,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) { @@ -1138,11 +1160,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 cbdae2e60c..370f9c3946 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, @@ -55,6 +56,7 @@ namespace UnitsNet IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, IMultiplyOperators, IDivisionOperators, #endif @@ -868,7 +870,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 / . @@ -889,6 +891,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) { @@ -943,6 +951,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassU return MassFlow.FromKilogramsPerSecond(mass.Kilograms / timeSpan.TotalSeconds); } + /// 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 45a03749d8..48fbd75d6d 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -48,6 +48,8 @@ namespace UnitsNet IMultiplyOperators, IMultiplyOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IMultiplyOperators, IDivisionOperators, IDivisionOperators, @@ -997,6 +999,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 5919e4195d..6f749861ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs @@ -45,6 +45,7 @@ namespace UnitsNet IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -590,6 +591,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 1c635333bb..c89c88903a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -47,12 +47,15 @@ namespace UnitsNet IDivisionOperators, IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, IDivisionOperators, + IDivisionOperators, IDivisionOperators, IMultiplyOperators, IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -876,6 +879,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power return Energy.FromJoules(power.Watts * timeSpan.TotalSeconds); } + /// Get from / . + public static Energy operator /(Power power, Frequency frequency) + { + return Energy.FromJoules(power.Watts / frequency.PerSecond); + } + /// Get from * . public static Energy operator *(TimeSpan timeSpan, Power power) { @@ -888,6 +897,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power 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) { @@ -918,6 +933,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 001af7956c..8ab454518f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -42,12 +42,16 @@ namespace UnitsNet public readonly partial struct Pressure : IArithmeticQuantity, #if NET7_0_OR_GREATER - IMultiplyOperators, + IDivisionOperators, IDivisionOperators, + IMultiplyOperators, + IMultiplyOperators, IDivisionOperators, IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -1209,22 +1213,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 / . @@ -1245,6 +1261,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Press return PressureChangeRate.FromPascalsPerSecond(pressure.Pascals / timeSpan.TotalSeconds); } + /// 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 4d0bd4f8f7..38f1743ef8 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -44,6 +44,7 @@ namespace UnitsNet #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, + IMultiplyOperators, #endif IComparable, IComparable, @@ -646,6 +647,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Rotat return Angle.FromRadians(timeSpan.TotalSeconds * rotationalSpeed.RadiansPerSecond); } + /// 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..494a60c55c 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -42,9 +42,12 @@ namespace UnitsNet public readonly partial struct TemperatureDelta : IArithmeticQuantity, #if NET7_0_OR_GREATER + IDivisionOperators, IMultiplyOperators, IDivisionOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, IMultiplyOperators, #endif @@ -567,6 +570,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 +591,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 +600,22 @@ 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 TemperatureChangeRate operator /(TemperatureDelta temperatureDelta, TimeSpan timeSpan) + { + return TemperatureChangeRate.FromDegreesCelsiusPerSecond(temperatureDelta.DegreesCelsius / timeSpan.TotalSeconds); + } + /// 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 db6de26d11..4fca55bb06 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, IDivisionOperators, #endif @@ -1289,12 +1294,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) { @@ -1319,6 +1342,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 ae92dbd033..03ac34b297 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, IMultiplyOperators, @@ -1507,6 +1508,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) {