From 9ed3328748281f2f2bc4d9ade8fe073b97dc69eb Mon Sep 17 00:00:00 2001 From: Muximize Date: Sun, 7 Jan 2024 00:38:33 +0100 Subject: [PATCH] Generate code --- .../Quantities/Acceleration.g.cs | 43 ++++---- .../Quantities/AmountOfSubstance.g.cs | 25 ++++- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 15 ++- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 99 +++++++++++-------- .../Quantities/AreaMomentOfInertia.g.cs | 7 ++ .../CoefficientOfThermalExpansion.g.cs | 6 ++ .../GeneratedCode/Quantities/Density.g.cs | 56 ++++++++--- .../GeneratedCode/Quantities/Duration.g.cs | 7 ++ .../Quantities/DynamicViscosity.g.cs | 7 ++ .../Quantities/ElectricCharge.g.cs | 16 +-- .../Quantities/ElectricCurrent.g.cs | 21 ++-- .../Quantities/ElectricPotential.g.cs | 28 +++--- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 72 ++++++++------ .../GeneratedCode/Quantities/Entropy.g.cs | 7 ++ UnitsNet/GeneratedCode/Quantities/Force.g.cs | 87 +++++++++------- .../Quantities/ForcePerLength.g.cs | 50 +++++++--- UnitsNet/GeneratedCode/Quantities/Jerk.g.cs | 29 ++++++ .../Quantities/KinematicViscosity.g.cs | 7 ++ UnitsNet/GeneratedCode/Quantities/Length.g.cs | 81 +++++++++------ .../Quantities/LinearDensity.g.cs | 14 +-- .../Quantities/LuminousIntensity.g.cs | 14 +-- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 94 +++++++++--------- .../Quantities/MassConcentration.g.cs | 30 ------ .../GeneratedCode/Quantities/MassFlow.g.cs | 64 +++++++----- .../GeneratedCode/Quantities/MassFlux.g.cs | 14 +-- .../Quantities/MassFraction.g.cs | 16 --- .../GeneratedCode/Quantities/MolarFlow.g.cs | 9 +- .../GeneratedCode/Quantities/MolarMass.g.cs | 14 +-- .../GeneratedCode/Quantities/Molarity.g.cs | 29 +++++- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 81 +++++++++------ .../GeneratedCode/Quantities/Pressure.g.cs | 46 +++++++-- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 23 +++++ .../Quantities/ReciprocalArea.g.cs | 15 ++- .../Quantities/ReciprocalLength.g.cs | 37 ++++--- .../Quantities/RotationalSpeed.g.cs | 7 ++ .../Quantities/RotationalStiffness.g.cs | 16 +-- .../Quantities/SpecificEnergy.g.cs | 26 +++-- .../Quantities/SpecificVolume.g.cs | 19 ++-- .../Quantities/SpecificWeight.g.cs | 28 +++--- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 64 ++++++------ .../Quantities/TemperatureDelta.g.cs | 45 +++++++-- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 37 +++++-- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 58 ++++++++--- .../Quantities/VolumeConcentration.g.cs | 8 +- .../GeneratedCode/Quantities/VolumeFlow.g.cs | 29 +++--- 45 files changed, 972 insertions(+), 528 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 725c643340..5c57a1b942 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -42,12 +42,13 @@ namespace UnitsNet public readonly partial struct Acceleration : IArithmeticQuantity, #if NET7_0_OR_GREATER - IMultiplyOperators, - IDivisionOperators, IMultiplyOperators, IMultiplyOperators, - IDivisionOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IMultiplyOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -677,18 +678,6 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Accel #region Relational Operators - /// Get from * . - public static Force operator *(Acceleration acceleration, Mass mass) - { - return Force.FromNewtons(acceleration.MetersPerSecondSquared * mass.Kilograms); - } - - /// Get from / . - public static Jerk operator /(Acceleration acceleration, Duration duration) - { - return Jerk.FromMetersPerSecondCubed(acceleration.MetersPerSecondSquared / duration.Seconds); - } - /// Get from * . public static SpecificWeight operator *(Acceleration acceleration, Density density) { @@ -701,10 +690,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Accel return Speed.FromMetersPerSecond(acceleration.MetersPerSecondSquared * duration.Seconds); } - /// Get from / . - public static Jerk operator /(Acceleration acceleration, TimeSpan timeSpan) + /// Get from * . + public static Force operator *(Acceleration acceleration, Mass mass) { - return Jerk.FromMetersPerSecondCubed(acceleration.MetersPerSecondSquared / timeSpan.TotalSeconds); + return Force.FromNewtons(acceleration.MetersPerSecondSquared * mass.Kilograms); + } + + /// Get from / . + public static Jerk operator /(Acceleration acceleration, Duration duration) + { + return Jerk.FromMetersPerSecondCubed(acceleration.MetersPerSecondSquared / duration.Seconds); + } + + /// Get from / . + public static Duration operator /(Acceleration acceleration, Jerk jerk) + { + return Duration.FromSeconds(acceleration.MetersPerSecondSquared / jerk.MetersPerSecondCubed); } /// Get from * . @@ -719,6 +720,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Accel return Speed.FromMetersPerSecond(timeSpan.TotalSeconds * acceleration.MetersPerSecondSquared); } + /// Get from / . + public static Jerk operator /(Acceleration acceleration, TimeSpan timeSpan) + { + return Jerk.FromMetersPerSecondCubed(acceleration.MetersPerSecondSquared / timeSpan.TotalSeconds); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 3dff1d8f94..7c4cb15f09 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -43,8 +43,11 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, + IDivisionOperators, IDivisionOperators, + IDivisionOperators, IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -734,16 +737,34 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Amoun 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) { - return Molarity.FromMolesPerCubicMeter(amountOfSubstance.Moles / volume.CubicMeters); + return Molarity.FromKilomolesPerCubicMeter(amountOfSubstance.Kilomoles / volume.CubicMeters); + } + + /// Get from / . + public static Duration operator /(AmountOfSubstance amountOfSubstance, MolarFlow molarFlow) + { + return Duration.FromSeconds(amountOfSubstance.Kilomoles / molarFlow.KilomolesPerSecond); } /// Get from / . public static Volume operator /(AmountOfSubstance amountOfSubstance, Molarity molarity) { - return Volume.FromCubicMeters(amountOfSubstance.Moles / molarity.MolesPerCubicMeter); + return Volume.FromCubicMeters(amountOfSubstance.Kilomoles / molarity.KilomolesPerCubicMeter); + } + + /// Get from / . + public static MolarFlow operator /(AmountOfSubstance amountOfSubstance, TimeSpan timeSpan) + { + return MolarFlow.FromKilomolesPerSecond(amountOfSubstance.Kilomoles / timeSpan.TotalSeconds); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 4761c4392e..303179f162 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -42,8 +42,9 @@ namespace UnitsNet public readonly partial struct Angle : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -710,16 +711,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Angle #region Relational Operators + /// Get from * . + public static Torque operator *(Angle angle, RotationalStiffness rotationalStiffness) + { + return Torque.FromNewtonMeters(angle.Radians * rotationalStiffness.NewtonMetersPerRadian); + } + /// Get from / . public static RotationalSpeed operator /(Angle angle, Duration duration) { return RotationalSpeed.FromRadiansPerSecond(angle.Radians / duration.Seconds); } - /// Get from * . - public static Torque operator *(Angle angle, RotationalStiffness rotationalStiffness) + /// Get from / . + public static Duration operator /(Angle angle, RotationalSpeed rotationalSpeed) { - return Torque.FromNewtonMeters(angle.Radians * rotationalStiffness.NewtonMetersPerRadian); + return Duration.FromSeconds(angle.Radians / rotationalSpeed.RadiansPerSecond); } /// Get from / . diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 195f583d77..c6cff59183 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -42,18 +42,21 @@ namespace UnitsNet public readonly partial struct Area : IArithmeticQuantity, #if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, - IDivisionOperators, - IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, - IMultiplyOperators, IMultiplyOperators, - IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, - IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -683,65 +686,65 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaU #region Relational Operators - /// Get from * . - public static Force operator *(Area area, Pressure pressure) + /// Calculates the inverse of this quantity. + /// The corresponding inverse quantity, . + public ReciprocalArea Inverse() { - return Force.FromNewtons(area.SquareMeters * pressure.Pascals); + return SquareMeters == 0.0 ? ReciprocalArea.Zero : ReciprocalArea.FromInverseSquareMeters(1 / SquareMeters); } - /// Get from * . - public static ForcePerLength operator *(Area area, SpecificWeight specificWeight) + /// Get from * . + public static LinearDensity operator *(Area area, Density density) { - return ForcePerLength.FromNewtonsPerMeter(area.SquareMeters * specificWeight.NewtonsPerCubicMeter); + return LinearDensity.FromKilogramsPerMeter(area.SquareMeters * density.KilogramsPerCubicMeter); } - /// Get from / . - public static Length operator /(Area area, Length length) + /// Get from * . + public static MassFlow operator *(Area area, MassFlux massFlux) { - return Length.FromMeters(area.SquareMeters / length.Meters); + return MassFlow.FromGramsPerSecond(area.SquareMeters * massFlux.GramsPerSecondPerSquareMeter); } - /// Get from * . - public static LinearDensity operator *(Area area, Density density) + /// Get from * . + public static Ratio operator *(Area area, ReciprocalArea reciprocalArea) { - return LinearDensity.FromKilogramsPerMeter(area.SquareMeters * density.KilogramsPerCubicMeter); + return Ratio.FromDecimalFractions(area.SquareMeters * reciprocalArea.InverseSquareMeters); } - /// Get from * . - public static LuminousIntensity operator *(Area area, Luminance luminance) + /// Get from * . + public static VolumeFlow operator *(Area area, Speed speed) { - return LuminousIntensity.FromCandela(area.SquareMeters * luminance.CandelasPerSquareMeter); + return VolumeFlow.FromCubicMetersPerSecond(area.SquareMeters * speed.MetersPerSecond); } - /// Get from * . - public static Mass operator *(Area area, AreaDensity areaDensity) + /// Get from * . + public static Force operator *(Area area, Pressure pressure) { - return Mass.FromKilograms(area.SquareMeters * areaDensity.KilogramsPerSquareMeter); + return Force.FromNewtons(area.SquareMeters * pressure.Pascals); } - /// Get from * . - public static MassFlow operator *(Area area, MassFlux massFlux) + /// Get from * . + public static ForcePerLength operator *(Area area, SpecificWeight specificWeight) { - return MassFlow.FromGramsPerSecond(area.SquareMeters * massFlux.GramsPerSecondPerSquareMeter); + return ForcePerLength.FromNewtonsPerMeter(area.SquareMeters * specificWeight.NewtonsPerCubicMeter); } - /// Get from * . - public static Power operator *(Area area, HeatFlux heatFlux) + /// Get from * . + public static LuminousIntensity operator *(Area area, Luminance luminance) { - return Power.FromWatts(area.SquareMeters * heatFlux.WattsPerSquareMeter); + return LuminousIntensity.FromCandela(area.SquareMeters * luminance.CandelasPerSquareMeter); } - /// Get from * . - public static Ratio operator *(Area area, ReciprocalArea reciprocalArea) + /// Get from * . + public static Mass operator *(Area area, AreaDensity areaDensity) { - return Ratio.FromDecimalFractions(area.SquareMeters * reciprocalArea.InverseSquareMeters); + return Mass.FromKilograms(area.SquareMeters * areaDensity.KilogramsPerSquareMeter); } - /// Calculates the inverse of this quantity. - /// The corresponding inverse quantity, . - public ReciprocalArea Inverse() + /// Get from * . + public static Power operator *(Area area, HeatFlux heatFlux) { - return SquareMeters == 0.0 ? ReciprocalArea.Zero : ReciprocalArea.FromInverseSquareMeters(1 / SquareMeters); + return Power.FromWatts(area.SquareMeters * heatFlux.WattsPerSquareMeter); } /// Get from * . @@ -756,10 +759,28 @@ public ReciprocalArea Inverse() return Volume.FromCubicMeters(area.SquareMeters * length.Meters); } - /// Get from * . - public static VolumeFlow operator *(Area area, Speed speed) + /// Get from / . + public static KinematicViscosity operator /(Area area, Duration duration) { - return VolumeFlow.FromCubicMetersPerSecond(area.SquareMeters * speed.MetersPerSecond); + return KinematicViscosity.FromSquareMetersPerSecond(area.SquareMeters / duration.Seconds); + } + + /// Get from / . + public static Length operator /(Area area, Length length) + { + return Length.FromMeters(area.SquareMeters / length.Meters); + } + + /// Get from / . + public static Duration operator /(Area area, KinematicViscosity kinematicViscosity) + { + return Duration.FromSeconds(area.SquareMeters / kinematicViscosity.SquareMetersPerSecond); + } + + /// Get from / . + public static KinematicViscosity operator /(Area area, TimeSpan timeSpan) + { + return KinematicViscosity.FromSquareMetersPerSecond(area.SquareMeters / timeSpan.TotalSeconds); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index a120b4caf0..461f880d82 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -43,6 +43,7 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -534,6 +535,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaM return Volume.FromCubicMeters(areaMomentOfInertia.MetersToTheFourth / length.Meters); } + /// Get from / . + public static Length operator /(AreaMomentOfInertia areaMomentOfInertia, Volume volume) + { + return Length.FromMeters(areaMomentOfInertia.MetersToTheFourth / volume.CubicMeters); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs index f54b257578..c257ac4fc5 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs @@ -594,6 +594,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Coeff return coefficientOfThermalExpansion.PerKelvin * temperatureDelta.Kelvins; } + /// Get from / . + public static TemperatureDelta operator /(double value, CoefficientOfThermalExpansion coefficientOfThermalExpansion) + { + return TemperatureDelta.FromKelvins(value / coefficientOfThermalExpansion.PerKelvin); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 423151009a..9aa63aa947 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -45,13 +45,17 @@ namespace UnitsNet public readonly partial struct Density : IArithmeticQuantity, #if NET7_0_OR_GREATER + IMultiplyOperators, IMultiplyOperators, - IMultiplyOperators, IMultiplyOperators, - IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -1437,16 +1441,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Densi #region Relational Operators - /// Get from * . - public static DynamicViscosity operator *(Density density, KinematicViscosity kinematicViscosity) + /// Get from * . + public static double operator *(Density density, SpecificVolume specificVolume) { - return DynamicViscosity.FromNewtonSecondsPerMeterSquared(density.KilogramsPerCubicMeter * kinematicViscosity.SquareMetersPerSecond); + return density.KilogramsPerCubicMeter * specificVolume.CubicMetersPerKilogram; } - /// Get from * . - public static LinearDensity operator *(Density density, Area area) + /// Get from * . + public static DynamicViscosity operator *(Density density, KinematicViscosity kinematicViscosity) { - return LinearDensity.FromKilogramsPerMeter(density.KilogramsPerCubicMeter * area.SquareMeters); + return DynamicViscosity.FromNewtonSecondsPerMeterSquared(density.KilogramsPerCubicMeter * kinematicViscosity.SquareMetersPerSecond); } /// Get from * . @@ -1455,10 +1459,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Densi return Mass.FromKilograms(density.KilogramsPerCubicMeter * volume.CubicMeters); } - /// Get from * . - public static MassConcentration operator *(Density density, VolumeConcentration volumeConcentration) + /// Get from * . + public static Density operator *(Density density, VolumeConcentration volumeConcentration) { - return MassConcentration.FromKilogramsPerCubicMeter(density.KilogramsPerCubicMeter * volumeConcentration.DecimalFractions); + return Density.FromKilogramsPerCubicMeter(density.KilogramsPerCubicMeter * volumeConcentration.DecimalFractions); + } + + /// Get from * . + public static LinearDensity operator *(Density density, Area area) + { + return LinearDensity.FromKilogramsPerMeter(density.KilogramsPerCubicMeter * area.SquareMeters); } /// Get from * . @@ -1479,6 +1489,30 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Densi return SpecificWeight.FromNewtonsPerCubicMeter(density.KilogramsPerCubicMeter * acceleration.MetersPerSecondSquared); } + /// Get from / . + public static Molarity operator /(Density density, MolarMass molarMass) + { + return Molarity.FromKilomolesPerCubicMeter(density.KilogramsPerCubicMeter / molarMass.KilogramsPerKilomole); + } + + /// Get from / . + public static MolarMass operator /(Density density, Molarity molarity) + { + return MolarMass.FromKilogramsPerKilomole(density.KilogramsPerCubicMeter / molarity.KilomolesPerCubicMeter); + } + + /// Get from / . + public static Density operator /(Density density, VolumeConcentration volumeConcentration) + { + return Density.FromKilogramsPerCubicMeter(density.KilogramsPerCubicMeter / volumeConcentration.DecimalFractions); + } + + /// Get from / . + public static SpecificVolume operator /(double value, Density density) + { + return SpecificVolume.FromCubicMetersPerKilogram(value / density.KilogramsPerCubicMeter); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 3d4ae1465e..7523e34884 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, @@ -630,6 +631,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 595cbeaad1..019a3f6475 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, @@ -603,6 +604,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/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index ba31a49c68..a66aa0a16c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -45,9 +45,9 @@ namespace UnitsNet public readonly partial struct ElectricCharge : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, - IDivisionOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -624,10 +624,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect #region Relational Operators - /// Get from / . - public static Duration operator /(ElectricCharge electricCharge, ElectricCurrent electricCurrent) + /// Get from * . + public static Energy operator *(ElectricCharge electricCharge, ElectricPotential electricPotential) { - return Duration.FromHours(electricCharge.AmpereHours / electricCurrent.Amperes); + return Energy.FromJoules(electricCharge.Coulombs * electricPotential.Volts); } /// Get from / . @@ -636,10 +636,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect return ElectricCurrent.FromAmperes(electricCharge.AmpereHours / duration.Hours); } - /// Get from * . - public static Energy operator *(ElectricCharge electricCharge, ElectricPotential electricPotential) + /// Get from / . + public static Duration operator /(ElectricCharge electricCharge, ElectricCurrent electricCurrent) { - return Energy.FromJoules(electricCharge.Coulombs * electricPotential.Volts); + return Duration.FromHours(electricCharge.AmpereHours / electricCurrent.Amperes); } /// Get from / . diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index 57c083f1c8..1859232297 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -43,9 +43,10 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, - IDivisionOperators, IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IMultiplyOperators, IDivisionOperators, #endif @@ -593,12 +594,6 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect return ElectricCharge.FromAmpereHours(electricCurrent.Amperes * duration.Hours); } - /// Get from / . - public static ElectricCurrentGradient operator /(ElectricCurrent electricCurrent, Duration duration) - { - return ElectricCurrentGradient.FromAmperesPerSecond(electricCurrent.Amperes / duration.Seconds); - } - /// Get from * . public static ElectricPotential operator *(ElectricCurrent electricCurrent, ElectricResistance electricResistance) { @@ -611,6 +606,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect return Power.FromWatts(electricCurrent.Amperes * electricPotential.Volts); } + /// Get from / . + public static ElectricCurrentGradient operator /(ElectricCurrent electricCurrent, Duration duration) + { + return ElectricCurrentGradient.FromAmperesPerSecond(electricCurrent.Amperes / duration.Seconds); + } + + /// 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, TimeSpan timeSpan) { diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index 04a4c8820a..fb726fae96 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -42,10 +42,10 @@ namespace UnitsNet public readonly partial struct ElectricPotential : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, - IDivisionOperators, IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -531,18 +531,6 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect #region Relational Operators - /// Get from / . - public static ElectricCurrent operator /(ElectricPotential electricPotential, ElectricResistance electricResistance) - { - return ElectricCurrent.FromAmperes(electricPotential.Volts / electricResistance.Ohms); - } - - /// Get from / . - public static ElectricResistance operator /(ElectricPotential electricPotential, ElectricCurrent electricCurrent) - { - return ElectricResistance.FromOhms(electricPotential.Volts / electricCurrent.Amperes); - } - /// Get from * . public static Energy operator *(ElectricPotential electricPotential, ElectricCharge electricCharge) { @@ -555,6 +543,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect return Power.FromWatts(electricPotential.Volts * electricCurrent.Amperes); } + /// Get from / . + public static ElectricCurrent operator /(ElectricPotential electricPotential, ElectricResistance electricResistance) + { + return ElectricCurrent.FromAmperes(electricPotential.Volts / electricResistance.Ohms); + } + + /// Get from / . + public static ElectricResistance operator /(ElectricPotential electricPotential, ElectricCurrent electricCurrent) + { + return ElectricResistance.FromOhms(electricPotential.Volts / electricCurrent.Amperes); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index 673d0ca5f2..5dd5bdb91e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -42,15 +42,17 @@ namespace UnitsNet public readonly partial struct Energy : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, - IDivisionOperators, - IDivisionOperators, - IDivisionOperators, - IDivisionOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -1149,16 +1151,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Energ #region Relational Operators - /// Get from / . - public static Duration operator /(Energy energy, Power power) - { - return Duration.FromSeconds(energy.Joules / (double)power.Watts); - } - - /// Get from / . - public static ElectricCharge operator /(Energy energy, ElectricPotential electricPotential) + /// Get from * . + public static Power operator *(Energy energy, Frequency frequency) { - return ElectricCharge.FromCoulombs(energy.Joules / electricPotential.Volts); + return Power.FromWatts(energy.Joules * frequency.PerSecond); } /// Get from / . @@ -1167,22 +1163,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Energ return ElectricPotential.FromVolts(energy.Joules / electricCharge.Coulombs); } - /// Get from / . - public static Entropy operator /(Energy energy, TemperatureDelta temperatureDelta) - { - return Entropy.FromJoulesPerKelvin(energy.Joules / temperatureDelta.Kelvins); - } - - /// Get from / . - public static Mass operator /(Energy energy, SpecificEnergy specificEnergy) - { - return Mass.FromKilograms(energy.Joules / specificEnergy.JoulesPerKilogram); - } - - /// Get from * . - public static Power operator *(Energy energy, Frequency frequency) + /// Get from / . + public static EnergyDensity operator /(Energy energy, Volume volume) { - return Power.FromWatts(energy.Joules * frequency.PerSecond); + return EnergyDensity.FromJoulesPerCubicMeter(energy.Joules / volume.CubicMeters); } /// Get from / . @@ -1203,6 +1187,36 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Energ return TemperatureDelta.FromKelvins(energy.Joules / entropy.JoulesPerKelvin); } + /// Get from / . + public static ElectricCharge operator /(Energy energy, ElectricPotential electricPotential) + { + return ElectricCharge.FromCoulombs(energy.Joules / electricPotential.Volts); + } + + /// Get from / . + public static Volume operator /(Energy energy, EnergyDensity energyDensity) + { + return Volume.FromCubicMeters(energy.Joules / energyDensity.JoulesPerCubicMeter); + } + + /// Get from / . + public static Duration operator /(Energy energy, Power power) + { + return Duration.FromSeconds(energy.Joules / (double)power.Watts); + } + + /// Get from / . + public static Mass operator /(Energy energy, SpecificEnergy specificEnergy) + { + return Mass.FromKilograms(energy.Joules / specificEnergy.JoulesPerKilogram); + } + + /// Get from / . + public static Entropy operator /(Energy energy, TemperatureDelta temperatureDelta) + { + return Entropy.FromJoulesPerKelvin(energy.Joules / temperatureDelta.Kelvins); + } + /// Get from / . public static Power operator /(Energy energy, TimeSpan timeSpan) { diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index 310a82e47f..ec26554435 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -44,6 +44,7 @@ namespace UnitsNet #if NET7_0_OR_GREATER IMultiplyOperators, IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -559,6 +560,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Entro return SpecificEntropy.FromJoulesPerKilogramKelvin(entropy.JoulesPerKelvin / mass.Kilograms); } + /// Get from / . + public static Mass operator /(Entropy entropy, SpecificEntropy specificEntropy) + { + return Mass.FromKilograms(entropy.JoulesPerKelvin / specificEntropy.JoulesPerKilogramKelvin); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index 2cd32df359..a8fa55f8b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -42,16 +42,19 @@ namespace UnitsNet public readonly partial struct Force : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, - IDivisionOperators, IMultiplyOperators, - IDivisionOperators, - IDivisionOperators, - IDivisionOperators, IMultiplyOperators, IMultiplyOperators, - IDivisionOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -699,34 +702,40 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force #region Relational Operators - /// Get from / . - public static Acceleration operator /(Force force, Mass mass) + /// Get from * . + public static ForcePerLength operator *(Force force, ReciprocalLength reciprocalLength) { - return Acceleration.FromMetersPerSecondSquared(force.Newtons / mass.Kilograms); + return ForcePerLength.FromNewtonsPerMeter(force.Newtons * reciprocalLength.InverseMeters); } - /// Get from / . - public static Duration operator /(Force force, ForceChangeRate forceChangeRate) + /// Get from * . + public static Power operator *(Force force, Speed speed) { - return Duration.FromSeconds(force.Newtons / forceChangeRate.NewtonsPerSecond); + return Power.FromWatts(force.Newtons * speed.MetersPerSecond); } - /// Get from * . - public static ForcePerLength operator *(Force force, ReciprocalLength reciprocalLength) + /// Get from * . + public static Pressure operator *(Force force, ReciprocalArea reciprocalArea) { - return ForcePerLength.FromNewtonsPerMeter(force.Newtons * reciprocalLength.InverseMeters); + return Pressure.FromNewtonsPerSquareMeter(force.Newtons * reciprocalArea.InverseSquareMeters); } - /// Get from / . - public static ForcePerLength operator /(Force force, Length length) + /// Get from * . + public static Torque operator *(Force force, Length length) { - return ForcePerLength.FromNewtonsPerMeter(force.Newtons / length.Meters); + return Torque.FromNewtonMeters(force.Newtons * length.Meters); } - /// Get from / . - public static Length operator /(Force force, ForcePerLength forcePerLength) + /// Get from / . + public static ForceChangeRate operator /(Force force, Duration duration) { - return Length.FromMeters(force.Newtons / forcePerLength.NewtonsPerMeter); + return ForceChangeRate.FromNewtonsPerSecond(force.Newtons / duration.Seconds); + } + + /// Get from / . + public static ForcePerLength operator /(Force force, Length length) + { + return ForcePerLength.FromNewtonsPerMeter(force.Newtons / length.Meters); } /// Get from / . @@ -735,28 +744,40 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force return Mass.FromKilograms(force.Newtons / acceleration.MetersPerSecondSquared); } - /// Get from * . - public static Power operator *(Force force, Speed speed) + /// Get from / . + public static Pressure operator /(Force force, Area area) { - return Power.FromWatts(force.Newtons * speed.MetersPerSecond); + return Pressure.FromPascals(force.Newtons / area.SquareMeters); } - /// Get from * . - public static Pressure operator *(Force force, ReciprocalArea reciprocalArea) + /// Get from / . + public static Duration operator /(Force force, ForceChangeRate forceChangeRate) { - return Pressure.FromNewtonsPerSquareMeter(force.Newtons * reciprocalArea.InverseSquareMeters); + return Duration.FromSeconds(force.Newtons / forceChangeRate.NewtonsPerSecond); } - /// Get from / . - public static Pressure operator /(Force force, Area area) + /// Get from / . + public static Length operator /(Force force, ForcePerLength forcePerLength) { - return Pressure.FromPascals(force.Newtons / area.SquareMeters); + return Length.FromMeters(force.Newtons / forcePerLength.NewtonsPerMeter); } - /// Get from * . - public static Torque operator *(Force force, Length length) + /// Get from / . + public static Acceleration operator /(Force force, Mass mass) { - return Torque.FromNewtonMeters(force.Newtons * length.Meters); + 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 ForceChangeRate operator /(Force force, TimeSpan timeSpan) + { + return ForceChangeRate.FromNewtonsPerSecond(force.Newtons / timeSpan.TotalSeconds); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index a12fcec880..8b10f7fbfc 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -43,10 +43,14 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, - IDivisionOperators, IMultiplyOperators, - IDivisionOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -1114,28 +1118,52 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force return Force.FromNewtons(forcePerLength.NewtonsPerMeter * length.Meters); } - /// Get from / . - public static Force operator /(ForcePerLength forcePerLength, ReciprocalLength reciprocalLength) - { - return Force.FromNewtons(forcePerLength.NewtonsPerMeter / reciprocalLength.InverseMeters); - } - /// Get from * . public static Pressure operator *(ForcePerLength forcePerLength, ReciprocalLength reciprocalLength) { return Pressure.FromNewtonsPerSquareMeter(forcePerLength.NewtonsPerMeter * reciprocalLength.InverseMeters); } + /// Get from * . + public static Torque operator *(ForcePerLength forcePerLength, Area area) + { + return Torque.FromNewtonMeters(forcePerLength.NewtonsPerMeter * area.SquareMeters); + } + + /// Get from / . + public static Force operator /(ForcePerLength forcePerLength, ReciprocalLength reciprocalLength) + { + return Force.FromNewtons(forcePerLength.NewtonsPerMeter / reciprocalLength.InverseMeters); + } + /// Get from / . public static Pressure operator /(ForcePerLength forcePerLength, Length length) { return Pressure.FromNewtonsPerSquareMeter(forcePerLength.NewtonsPerMeter / length.Meters); } - /// Get from * . - public static Torque operator *(ForcePerLength forcePerLength, Area area) + /// Get from / . + public static SpecificWeight operator /(ForcePerLength forcePerLength, Area area) { - return Torque.FromNewtonMeters(forcePerLength.NewtonsPerMeter * area.SquareMeters); + return SpecificWeight.FromNewtonsPerCubicMeter(forcePerLength.NewtonsPerMeter / area.SquareMeters); + } + + /// Get from / . + public static ReciprocalLength operator /(ForcePerLength forcePerLength, Force force) + { + return ReciprocalLength.FromInverseMeters(forcePerLength.NewtonsPerMeter / force.Newtons); + } + + /// Get from / . + public static Length operator /(ForcePerLength forcePerLength, Pressure pressure) + { + return Length.FromMeters(forcePerLength.NewtonsPerMeter / pressure.NewtonsPerSquareMeter); + } + + /// Get from / . + public static Area operator /(ForcePerLength forcePerLength, SpecificWeight specificWeight) + { + return Area.FromSquareMeters(forcePerLength.NewtonsPerMeter / specificWeight.NewtonsPerCubicMeter); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs b/UnitsNet/GeneratedCode/Quantities/Jerk.g.cs index 5618e8c0c5..3f1c087ba2 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, @@ -610,6 +617,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 71eed52ba8..30b0372118 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, IMultiplyOperators, #endif @@ -600,6 +601,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 e0e2fc0314..5ca1ebb34f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -43,16 +43,19 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, - IDivisionOperators, - IMultiplyOperators, IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, - IDivisionOperators, IMultiplyOperators, - IMultiplyOperators, - IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -1187,16 +1190,47 @@ 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 Duration operator /(Length length, Speed speed) + /// Get from * . + public static KinematicViscosity operator *(Length length, Speed speed) { - return Duration.FromSeconds(length.Meters / speed.MetersPerSecond); + return KinematicViscosity.FromSquareMetersPerSecond(length.Meters * speed.MetersPerSecond); + } + + /// Get from * . + public static ReciprocalLength operator *(Length length, ReciprocalArea reciprocalArea) + { + return ReciprocalLength.FromInverseMeters(length.Meters * reciprocalArea.InverseSquareMeters); + } + + /// Get from * . + public static Torque operator *(Length length, Force force) + { + return Torque.FromNewtonMeters(length.Meters * force.Newtons); + } + + /// Get from * . + public static Volume operator *(Length length, Area area) + { + return Volume.FromCubicMeters(length.Meters * area.SquareMeters); + } + + /// Get from * . + public static AreaMomentOfInertia operator *(Length length, Volume volume) + { + return AreaMomentOfInertia.FromMetersToTheFourth(length.Meters * volume.CubicMeters); } /// Get from * . @@ -1205,10 +1239,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lengt return Force.FromNewtons(length.Meters * forcePerLength.NewtonsPerMeter); } - /// Get from * . - public static KinematicViscosity operator *(Length length, Speed speed) + /// Get from * . + public static ForcePerLength operator *(Length length, Pressure pressure) { - return KinematicViscosity.FromSquareMetersPerSecond(length.Meters * speed.MetersPerSecond); + return ForcePerLength.FromNewtonsPerMeter(length.Meters * pressure.NewtonsPerSquareMeter); } /// Get from * . @@ -1223,41 +1257,28 @@ 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() - { - return Meters == 0.0 ? ReciprocalLength.Zero : ReciprocalLength.FromInverseMeters(1 / Meters); - } - /// Get from * . public static RotationalStiffness operator *(Length length, RotationalStiffnessPerLength rotationalStiffnessPerLength) { return RotationalStiffness.FromNewtonMetersPerRadian(length.Meters * rotationalStiffnessPerLength.NewtonMetersPerRadianPerMeter); } - /// Get from / . - public static Speed operator /(Length length, Duration duration) - { - return Speed.FromMetersPerSecond(length.Meters / duration.Seconds); - } - /// Get from * . public static TemperatureDelta operator *(Length length, TemperatureGradient temperatureGradient) { return TemperatureDelta.FromDegreesCelsius(length.Kilometers * temperatureGradient.DegreesCelciusPerKilometer); } - /// Get from * . - public static Torque operator *(Length length, Force force) + /// Get from / . + public static Speed operator /(Length length, Duration duration) { - return Torque.FromNewtonMeters(length.Meters * force.Newtons); + return Speed.FromMetersPerSecond(length.Meters / duration.Seconds); } - /// Get from * . - public static Volume operator *(Length length, Area area) + /// Get from / . + public static Duration operator /(Length length, Speed speed) { - return Volume.FromCubicMeters(length.Meters * area.SquareMeters); + return Duration.FromSeconds(length.Meters / speed.MetersPerSecond); } /// Get from / . diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index c4da627aa7..31279733ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -45,9 +45,9 @@ namespace UnitsNet public readonly partial struct LinearDensity : IArithmeticQuantity, #if NET7_0_OR_GREATER + IMultiplyOperators, IDivisionOperators, IDivisionOperators, - IMultiplyOperators, #endif IComparable, IComparable, @@ -677,6 +677,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Linea #region Relational Operators + /// Get from * . + public static Mass operator *(LinearDensity linearDensity, Length length) + { + return Mass.FromKilograms(linearDensity.KilogramsPerMeter * length.Meters); + } + /// Get from / . public static Area operator /(LinearDensity linearDensity, Density density) { @@ -689,12 +695,6 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Linea return Density.FromKilogramsPerCubicMeter(linearDensity.KilogramsPerMeter / area.SquareMeters); } - /// Get from * . - public static Mass operator *(LinearDensity linearDensity, Length length) - { - return Mass.FromKilograms(linearDensity.KilogramsPerMeter * length.Meters); - } - #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index 09735d275e..14849783ed 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -45,8 +45,8 @@ namespace UnitsNet public readonly partial struct LuminousIntensity : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -442,18 +442,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lumin #region Relational Operators - /// Get from / . - public static Area operator /(LuminousIntensity luminousIntensity, Luminance luminance) - { - return Area.FromSquareMeters(luminousIntensity.Candela / luminance.CandelasPerSquareMeter); - } - /// Get from / . public static Luminance operator /(LuminousIntensity luminousIntensity, Area area) { return Luminance.FromCandelasPerSquareMeter(luminousIntensity.Candela / area.SquareMeters); } + /// Get from / . + public static Area operator /(LuminousIntensity luminousIntensity, Luminance luminance) + { + return Area.FromSquareMeters(luminousIntensity.Candela / luminance.CandelasPerSquareMeter); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index 2d7fb4290b..0027e993db 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -42,20 +42,20 @@ namespace UnitsNet public readonly partial struct Mass : IArithmeticQuantity, #if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, IDivisionOperators, - IDivisionOperators, IDivisionOperators, IDivisionOperators, - IMultiplyOperators, - IMultiplyOperators, - IMultiplyOperators, - IDivisionOperators, IDivisionOperators, - IDivisionOperators, - IMultiplyOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, - IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -920,28 +920,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassU #region Relational Operators - /// Get from / . - public static AmountOfSubstance operator /(Mass mass, MolarMass molarMass) - { - return AmountOfSubstance.FromMoles(mass.Kilograms / molarMass.KilogramsPerMole); - } - - /// Get from / . - public static Area operator /(Mass mass, AreaDensity areaDensity) - { - return Area.FromSquareMeters(mass.Kilograms / areaDensity.KilogramsPerSquareMeter); - } - - /// Get from / . - public static AreaDensity operator /(Mass mass, Area area) - { - return AreaDensity.FromKilogramsPerSquareMeter(mass.Kilograms / area.SquareMeters); - } - - /// Get from / . - public static Density operator /(Mass mass, Volume volume) + /// Get from * . + public static Force operator *(Mass mass, Acceleration acceleration) { - return Density.FromKilogramsPerCubicMeter(mass.Kilograms / volume.CubicMeters); + return Force.FromNewtons(mass.Kilograms * acceleration.MetersPerSecondSquared); } /// Get from * . @@ -956,34 +938,34 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassU return Entropy.FromJoulesPerKelvin(mass.Kilograms * specificEntropy.JoulesPerKilogramKelvin); } - /// Get from * . - public static Force operator *(Mass mass, Acceleration acceleration) + /// Get from * . + public static Volume operator *(Mass mass, SpecificVolume specificVolume) { - return Force.FromNewtons(mass.Kilograms * acceleration.MetersPerSecondSquared); + return Volume.FromCubicMeters(mass.Kilograms * specificVolume.CubicMetersPerKilogram); } - /// Get from / . - public static Length operator /(Mass mass, LinearDensity linearDensity) + /// Get from / . + public static AmountOfSubstance operator /(Mass mass, MolarMass molarMass) { - return Length.FromMeters(mass.Kilograms / linearDensity.KilogramsPerMeter); + return AmountOfSubstance.FromMoles(mass.Grams / molarMass.GramsPerMole); } - /// Get from / . - public static LinearDensity operator /(Mass mass, Length length) + /// Get from / . + public static AreaDensity operator /(Mass mass, Area area) { - return LinearDensity.FromKilogramsPerMeter(mass.Kilograms / length.Meters); + return AreaDensity.FromKilogramsPerSquareMeter(mass.Kilograms / area.SquareMeters); } - /// Get from / . - public static Mass operator /(Mass mass, MassFraction massFraction) + /// Get from / . + public static Density operator /(Mass mass, Volume volume) { - return Mass.FromKilograms(mass.Kilograms / massFraction.DecimalFractions); + return Density.FromKilogramsPerCubicMeter(mass.Kilograms / volume.CubicMeters); } - /// Get from * . - public static Mass operator *(Mass mass, MassFraction massFraction) + /// Get from / . + public static LinearDensity operator /(Mass mass, Length length) { - return Mass.FromKilograms(mass.Kilograms * massFraction.DecimalFractions); + return LinearDensity.FromKilogramsPerMeter(mass.Kilograms / length.Meters); } /// Get from / . @@ -992,16 +974,34 @@ 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 Area operator /(Mass mass, AreaDensity areaDensity) + { + return Area.FromSquareMeters(mass.Kilograms / areaDensity.KilogramsPerSquareMeter); + } + /// Get from / . public static Volume operator /(Mass mass, Density density) { return Volume.FromCubicMeters(mass.Kilograms / density.KilogramsPerCubicMeter); } - /// Get from * . - public static Volume operator *(Mass mass, SpecificVolume specificVolume) + /// Get from / . + public static Length operator /(Mass mass, LinearDensity linearDensity) { - return Volume.FromCubicMeters(mass.Kilograms * specificVolume.CubicMetersPerKilogram); + return Length.FromMeters(mass.Kilograms / linearDensity.KilogramsPerMeter); + } + + /// Get from / . + public static Duration operator /(Mass mass, MassFlow massFlow) + { + return Duration.FromSeconds(mass.Kilograms / massFlow.KilogramsPerSecond); } /// Get from / . diff --git a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs index 090cec7288..aabfd7f1d6 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs @@ -21,9 +21,6 @@ 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; @@ -44,11 +41,6 @@ namespace UnitsNet [DataContract] public readonly partial struct MassConcentration : IArithmeticQuantity, -#if NET7_0_OR_GREATER - IMultiplyOperators, - IDivisionOperators, - IDivisionOperators, -#endif IComparable, IComparable, IConvertible, @@ -1305,28 +1297,6 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassC #endregion - #region Relational Operators - - /// Get from * . - public static Mass operator *(MassConcentration massConcentration, Volume volume) - { - return Mass.FromKilograms(massConcentration.KilogramsPerCubicMeter * volume.CubicMeters); - } - - /// Get from / . - public static Molarity operator /(MassConcentration massConcentration, MolarMass molarMass) - { - return Molarity.FromMolesPerCubicMeter(massConcentration.GramsPerCubicMeter / molarMass.GramsPerMole); - } - - /// Get from / . - public static VolumeConcentration operator /(MassConcentration massConcentration, Density density) - { - return VolumeConcentration.FromDecimalFractions(massConcentration.KilogramsPerCubicMeter / density.KilogramsPerCubicMeter); - } - - #endregion - #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 1d9487240c..86cd09beeb 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -42,14 +42,16 @@ namespace UnitsNet public readonly partial struct MassFlow : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, - IDivisionOperators, - IDivisionOperators, IMultiplyOperators, - IDivisionOperators, - IDivisionOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IMultiplyOperators, #endif IComparable, @@ -1022,52 +1024,64 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassF #region Relational Operators + /// Get from * . + public static Mass operator *(MassFlow massFlow, Duration duration) + { + return Mass.FromKilograms(massFlow.KilogramsPerSecond * duration.Seconds); + } + + /// Get from * . + public static Power operator *(MassFlow massFlow, SpecificEnergy specificEnergy) + { + return Power.FromWatts(massFlow.KilogramsPerSecond * specificEnergy.JoulesPerKilogram); + } + /// Get from / . public static Area operator /(MassFlow massFlow, MassFlux massFlux) { - return Area.FromSquareMeters(massFlow.KilogramsPerSecond / massFlux.KilogramsPerSecondPerSquareMeter); + return Area.FromSquareMeters(massFlow.GramsPerSecond / massFlux.GramsPerSecondPerSquareMeter); } - /// Get from / . - public static BrakeSpecificFuelConsumption operator /(MassFlow massFlow, Power power) + /// Get from / . + public static MolarFlow operator /(MassFlow massFlow, MolarMass molarMass) { - return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(massFlow.KilogramsPerSecond / (double)power.Watts); + return MolarFlow.FromKilomolesPerSecond(massFlow.KilogramsPerSecond / molarMass.KilogramsPerKilomole); } - /// Get from / . - public static Density operator /(MassFlow massFlow, VolumeFlow volumeFlow) + /// Get from / . + public static Power operator /(MassFlow massFlow, BrakeSpecificFuelConsumption brakeSpecificFuelConsumption) { - return Density.FromKilogramsPerCubicMeter(massFlow.KilogramsPerSecond / volumeFlow.CubicMetersPerSecond); + return Power.FromWatts(massFlow.KilogramsPerSecond / brakeSpecificFuelConsumption.KilogramsPerJoule); } - /// Get from * . - public static Mass operator *(MassFlow massFlow, Duration duration) + /// Get from / . + public static VolumeFlow operator /(MassFlow massFlow, Density density) { - return Mass.FromKilograms(massFlow.KilogramsPerSecond * duration.Seconds); + return VolumeFlow.FromCubicMetersPerSecond(massFlow.KilogramsPerSecond / density.KilogramsPerCubicMeter); } /// Get from / . public static MassFlux operator /(MassFlow massFlow, Area area) { - return MassFlux.FromKilogramsPerSecondPerSquareMeter(massFlow.KilogramsPerSecond / area.SquareMeters); + return MassFlux.FromGramsPerSecondPerSquareMeter(massFlow.GramsPerSecond / area.SquareMeters); } - /// Get from / . - public static Power operator /(MassFlow massFlow, BrakeSpecificFuelConsumption brakeSpecificFuelConsumption) + /// Get from / . + public static MolarMass operator /(MassFlow massFlow, MolarFlow molarFlow) { - return Power.FromWatts(massFlow.KilogramsPerSecond / brakeSpecificFuelConsumption.KilogramsPerJoule); + return MolarMass.FromKilogramsPerKilomole(massFlow.KilogramsPerSecond / molarFlow.KilomolesPerSecond); } - /// Get from * . - public static Power operator *(MassFlow massFlow, SpecificEnergy specificEnergy) + /// Get from / . + public static BrakeSpecificFuelConsumption operator /(MassFlow massFlow, Power power) { - return Power.FromWatts(massFlow.KilogramsPerSecond * specificEnergy.JoulesPerKilogram); + return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(massFlow.KilogramsPerSecond / (double)power.Watts); } - /// Get from / . - public static VolumeFlow operator /(MassFlow massFlow, Density density) + /// Get from / . + public static Density operator /(MassFlow massFlow, VolumeFlow volumeFlow) { - return VolumeFlow.FromCubicMetersPerSecond(massFlow.KilogramsPerSecond / density.KilogramsPerCubicMeter); + return Density.FromKilogramsPerCubicMeter(massFlow.KilogramsPerSecond / volumeFlow.CubicMetersPerSecond); } /// Get from * . diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index bc68c04747..db0bbad1ea 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -42,9 +42,9 @@ namespace UnitsNet public readonly partial struct MassFlux : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, IMultiplyOperators, IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -638,12 +638,6 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassF #region Relational Operators - /// Get from / . - public static Density operator /(MassFlux massFlux, Speed speed) - { - return Density.FromKilogramsPerCubicMeter(massFlux.KilogramsPerSecondPerSquareMeter / speed.MetersPerSecond); - } - /// Get from * . public static MassFlow operator *(MassFlux massFlux, Area area) { @@ -656,6 +650,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassF return Speed.FromMetersPerSecond(massFlux.KilogramsPerSecondPerSquareMeter / density.KilogramsPerCubicMeter); } + /// Get from / . + public static Density operator /(MassFlux massFlux, Speed speed) + { + return Density.FromKilogramsPerCubicMeter(massFlux.KilogramsPerSecondPerSquareMeter / speed.MetersPerSecond); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs index 3095de01bf..074b9bd8fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs @@ -21,9 +21,6 @@ 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; @@ -44,9 +41,6 @@ namespace UnitsNet [DataContract] public readonly partial struct MassFraction : IArithmeticQuantity, -#if NET7_0_OR_GREATER - IMultiplyOperators, -#endif IComparable, IComparable, IConvertible, @@ -853,16 +847,6 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassF #endregion - #region Relational Operators - - /// Get from * . - public static Mass operator *(MassFraction massFraction, Mass mass) - { - return Mass.FromKilograms(massFraction.DecimalFractions * mass.Kilograms); - } - - #endregion - #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs index 6a66d0c379..9d1e690e60 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs @@ -45,6 +45,7 @@ namespace UnitsNet IMultiplyOperators, IMultiplyOperators, IDivisionOperators, + IDivisionOperators, IMultiplyOperators, #endif IComparable, @@ -600,7 +601,13 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar /// Get from / . public static VolumeFlow operator /(MolarFlow molarFlow, Molarity molarity) { - return VolumeFlow.FromCubicMetersPerSecond(molarFlow.MolesPerSecond / molarity.MolesPerCubicMeter); + return VolumeFlow.FromCubicMetersPerSecond(molarFlow.KilomolesPerSecond / molarity.KilomolesPerCubicMeter); + } + + /// Get from / . + public static Molarity operator /(MolarFlow molarFlow, VolumeFlow volumeFlow) + { + return Molarity.FromKilomolesPerCubicMeter(molarFlow.KilomolesPerSecond / volumeFlow.CubicMetersPerSecond); } /// Get from * . diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 3e29004ac2..3c3a002539 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -42,8 +42,8 @@ namespace UnitsNet public readonly partial struct MolarMass : IArithmeticQuantity, #if NET7_0_OR_GREATER + IMultiplyOperators, IMultiplyOperators, - IMultiplyOperators, IMultiplyOperators, #endif IComparable, @@ -656,16 +656,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar #region Relational Operators - /// Get from * . - public static Mass operator *(MolarMass molarMass, AmountOfSubstance amountOfSubstance) + /// Get from * . + public static Density operator *(MolarMass molarMass, Molarity molarity) { - return Mass.FromGrams(molarMass.GramsPerMole * amountOfSubstance.Moles); + return Density.FromKilogramsPerCubicMeter(molarMass.KilogramsPerKilomole * molarity.KilomolesPerCubicMeter); } - /// Get from * . - public static MassConcentration operator *(MolarMass molarMass, Molarity molarity) + /// Get from * . + public static Mass operator *(MolarMass molarMass, AmountOfSubstance amountOfSubstance) { - return MassConcentration.FromGramsPerCubicMeter(molarMass.GramsPerMole * molarity.MolesPerCubicMeter); + return Mass.FromGrams(molarMass.GramsPerMole * amountOfSubstance.Moles); } /// Get from * . diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 478de5bb67..c78bc301d1 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, + IMultiplyOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -622,10 +625,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar #region Relational Operators - /// Get from * . - public static MassConcentration operator *(Molarity molarity, MolarMass molarMass) + /// Get from * . + public static AmountOfSubstance operator *(Molarity molarity, Volume volume) { - return MassConcentration.FromGramsPerCubicMeter(molarity.MolesPerCubicMeter * molarMass.GramsPerMole); + return AmountOfSubstance.FromKilomoles(molarity.KilomolesPerCubicMeter * volume.CubicMeters); + } + + /// Get from * . + public static Density operator *(Molarity molarity, MolarMass molarMass) + { + return Density.FromKilogramsPerCubicMeter(molarity.KilomolesPerCubicMeter * molarMass.KilogramsPerKilomole); } /// Get from * . @@ -634,6 +643,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar return Molarity.FromMolesPerCubicMeter(molarity.MolesPerCubicMeter * volumeConcentration.DecimalFractions); } + /// Get from * . + public static MolarFlow operator *(Molarity molarity, VolumeFlow volumeFlow) + { + return MolarFlow.FromKilomolesPerSecond(molarity.KilomolesPerCubicMeter * volumeFlow.CubicMetersPerSecond); + } + + /// 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 f074e2a525..e0be2ae92f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -42,17 +42,20 @@ namespace UnitsNet public readonly partial struct Power : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, - IDivisionOperators, - IDivisionOperators, IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, IDivisionOperators, - IMultiplyOperators, - IDivisionOperators, - IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IMultiplyOperators, #endif IDecimalQuantity, @@ -900,16 +903,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power #region Relational Operators - /// Get from / . - public static Area operator /(Power power, HeatFlux heatFlux) + /// Get from * . + public static Energy operator *(Power power, Duration duration) { - return Area.FromSquareMeters((double)power.Watts / heatFlux.WattsPerSquareMeter); + return Energy.FromJoules((double)power.Watts * duration.Seconds); } - /// Get from / . - public static ElectricCurrent operator /(Power power, ElectricPotential electricPotential) + /// Get from * . + public static MassFlow operator *(Power power, BrakeSpecificFuelConsumption brakeSpecificFuelConsumption) { - return ElectricCurrent.FromAmperes((double)power.Watts / electricPotential.Volts); + return MassFlow.FromKilogramsPerSecond((double)power.Watts * brakeSpecificFuelConsumption.KilogramsPerJoule); } /// Get from / . @@ -918,10 +921,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power return ElectricPotential.FromVolts((double)power.Watts / electricCurrent.Amperes); } - /// Get from * . - public static Energy operator *(Power power, Duration duration) + /// Get from / . + public static Energy operator /(Power power, Frequency frequency) { - return Energy.FromJoules((double)power.Watts * duration.Seconds); + return Energy.FromJoules((double)power.Watts / frequency.PerSecond); } /// Get from / . @@ -936,34 +939,52 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power return HeatFlux.FromWattsPerSquareMeter((double)power.Watts / area.SquareMeters); } - /// Get from * . - public static MassFlow operator *(Power power, BrakeSpecificFuelConsumption brakeSpecificFuelConsumption) + /// Get from / . + public static SpecificEnergy operator /(Power power, MassFlow massFlow) { - return MassFlow.FromKilogramsPerSecond((double)power.Watts * brakeSpecificFuelConsumption.KilogramsPerJoule); + return SpecificEnergy.FromJoulesPerKilogram((double)power.Watts / massFlow.KilogramsPerSecond); } - /// Get from / . - public static MassFlow operator /(Power power, SpecificEnergy specificEnergy) + /// Get from / . + public static Torque operator /(Power power, RotationalSpeed rotationalSpeed) { - return MassFlow.FromKilogramsPerSecond((double)power.Watts / specificEnergy.JoulesPerKilogram); + return Torque.FromNewtonMeters((double)power.Watts / rotationalSpeed.RadiansPerSecond); } - /// Get from / . - public static RotationalSpeed operator /(Power power, Torque torque) + /// Get from / . + public static ElectricCurrent operator /(Power power, ElectricPotential electricPotential) { - return RotationalSpeed.FromRadiansPerSecond((double)power.Watts / torque.NewtonMeters); + return ElectricCurrent.FromAmperes((double)power.Watts / electricPotential.Volts); } - /// Get from / . - public static SpecificEnergy operator /(Power power, MassFlow massFlow) + /// Get from / . + public static Frequency operator /(Power power, Energy energy) { - return SpecificEnergy.FromJoulesPerKilogram((double)power.Watts / massFlow.KilogramsPerSecond); + return Frequency.FromPerSecond((double)power.Watts / energy.Joules); } - /// Get from / . - public static Torque operator /(Power power, RotationalSpeed rotationalSpeed) + /// Get from / . + public static Speed operator /(Power power, Force force) { - return Torque.FromNewtonMeters((double)power.Watts / rotationalSpeed.RadiansPerSecond); + return Speed.FromMetersPerSecond((double)power.Watts / force.Newtons); + } + + /// Get from / . + public static Area operator /(Power power, HeatFlux heatFlux) + { + return Area.FromSquareMeters((double)power.Watts / heatFlux.WattsPerSquareMeter); + } + + /// Get from / . + public static MassFlow operator /(Power power, SpecificEnergy specificEnergy) + { + return MassFlow.FromKilogramsPerSecond((double)power.Watts / specificEnergy.JoulesPerKilogram); + } + + /// Get from / . + public static RotationalSpeed operator /(Power power, Torque torque) + { + return RotationalSpeed.FromRadiansPerSecond((double)power.Watts / torque.NewtonMeters); } /// Get from * . diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index 777d8c544d..cd65b686be 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -43,11 +43,15 @@ namespace UnitsNet IArithmeticQuantity, #if NET7_0_OR_GREATER IMultiplyOperators, + IMultiplyOperators, IDivisionOperators, IDivisionOperators, - IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -1314,22 +1318,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Press return Force.FromNewtons(pressure.Pascals * area.SquareMeters); } + /// Get from * . + public static ForcePerLength operator *(Pressure pressure, Length length) + { + return ForcePerLength.FromNewtonsPerMeter(pressure.NewtonsPerSquareMeter * length.Meters); + } + /// Get from / . public static Force operator /(Pressure pressure, ReciprocalArea reciprocalArea) { - return Force.FromNewtons(pressure.Pascals / reciprocalArea.InverseSquareMeters); + return Force.FromNewtons(pressure.NewtonsPerSquareMeter / reciprocalArea.InverseSquareMeters); } /// Get from / . public static ForcePerLength operator /(Pressure pressure, ReciprocalLength reciprocalLength) { - return ForcePerLength.FromNewtonsPerMeter(pressure.Pascals / reciprocalLength.InverseMeters); - } - - /// Get from / . - public static Length operator /(Pressure pressure, SpecificWeight specificWeight) - { - return Length.FromMeters(pressure.Pascals / specificWeight.NewtonsPerCubicMeter); + return ForcePerLength.FromNewtonsPerMeter(pressure.NewtonsPerSquareMeter / reciprocalLength.InverseMeters); } /// Get from / . @@ -1344,6 +1348,30 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Press return SpecificWeight.FromNewtonsPerCubicMeter(pressure.Pascals / length.Meters); } + /// 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 Duration operator /(Pressure pressure, PressureChangeRate pressureChangeRate) + { + return Duration.FromSeconds(pressure.Pascals / pressureChangeRate.PascalsPerSecond); + } + + /// Get from / . + public static Length operator /(Pressure pressure, SpecificWeight specificWeight) + { + return Length.FromMeters(pressure.Pascals / specificWeight.NewtonsPerCubicMeter); + } + /// Get from / . public static PressureChangeRate operator /(Pressure pressure, TimeSpan timeSpan) { diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index 64de7446aa..eb10cddd14 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, @@ -520,6 +527,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 95bb62799d..011273a349 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, @@ -623,6 +624,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) { @@ -635,11 +643,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 105635debb..0ad4acdfed 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs @@ -45,10 +45,11 @@ namespace UnitsNet public readonly partial struct ReciprocalLength : IArithmeticQuantity, #if NET7_0_OR_GREATER + IMultiplyOperators, IMultiplyOperators, - IDivisionOperators, IMultiplyOperators, - IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -606,16 +607,23 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Recip #region Relational Operators - /// Get from * . - public static ForcePerLength operator *(ReciprocalLength reciprocalLength, Force force) + /// Calculates the inverse of this quantity. + /// The corresponding inverse quantity, . + public Length Inverse() { - return ForcePerLength.FromNewtonsPerMeter(reciprocalLength.InverseMeters * force.Newtons); + return InverseMeters == 0.0 ? Length.Zero : Length.FromMeters(1 / InverseMeters); } - /// Get from / . - public static Length operator /(ReciprocalLength reciprocalLength, ReciprocalArea reciprocalArea) + /// Get from * . + public static ReciprocalArea operator *(ReciprocalLength left, ReciprocalLength right) { - return Length.FromMeters(reciprocalLength.InverseMeters / reciprocalArea.InverseSquareMeters); + return ReciprocalArea.FromInverseSquareMeters(left.InverseMeters * right.InverseMeters); + } + + /// Get from * . + public static ForcePerLength operator *(ReciprocalLength reciprocalLength, Force force) + { + return ForcePerLength.FromNewtonsPerMeter(reciprocalLength.InverseMeters * force.Newtons); } /// Get from * . @@ -624,17 +632,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Recip return Pressure.FromNewtonsPerSquareMeter(reciprocalLength.InverseMeters * forcePerLength.NewtonsPerMeter); } - /// Get from * . - public static ReciprocalArea operator *(ReciprocalLength left, ReciprocalLength right) + /// Get from / . + public static Length operator /(ReciprocalLength reciprocalLength, ReciprocalArea reciprocalArea) { - return ReciprocalArea.FromInverseSquareMeters(left.InverseMeters * right.InverseMeters); + return Length.FromMeters(reciprocalLength.InverseMeters / reciprocalArea.InverseSquareMeters); } - /// 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 8501363750..0fdbda9e2b 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, IMultiplyOperators, #endif IComparable, @@ -661,6 +662,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); + } + /// Get from * . public static Angle operator *(RotationalSpeed rotationalSpeed, TimeSpan timeSpan) { diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 64f19e8372..34c30e15fe 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -42,9 +42,9 @@ namespace UnitsNet public readonly partial struct RotationalStiffness : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, - IDivisionOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -1016,10 +1016,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Rotat #region Relational Operators - /// Get from / . - public static Length operator /(RotationalStiffness rotationalStiffness, RotationalStiffnessPerLength rotationalStiffnessPerLength) + /// Get from * . + public static Torque operator *(RotationalStiffness rotationalStiffness, Angle angle) { - return Length.FromMeters(rotationalStiffness.NewtonMetersPerRadian / rotationalStiffnessPerLength.NewtonMetersPerRadianPerMeter); + return Torque.FromNewtonMeters(rotationalStiffness.NewtonMetersPerRadian * angle.Radians); } /// Get from / . @@ -1028,10 +1028,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Rotat return RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(rotationalStiffness.NewtonMetersPerRadian / length.Meters); } - /// Get from * . - public static Torque operator *(RotationalStiffness rotationalStiffness, Angle angle) + /// Get from / . + public static Length operator /(RotationalStiffness rotationalStiffness, RotationalStiffnessPerLength rotationalStiffnessPerLength) { - return Torque.FromNewtonMeters(rotationalStiffness.NewtonMetersPerRadian * angle.Radians); + return Length.FromMeters(rotationalStiffness.NewtonMetersPerRadian / rotationalStiffnessPerLength.NewtonMetersPerRadianPerMeter); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 2c71ec1cbd..be470c62f8 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -49,6 +49,8 @@ namespace UnitsNet IMultiplyOperators, IMultiplyOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -966,12 +968,6 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci #region Relational Operators - /// Get from / . - public static BrakeSpecificFuelConsumption operator /(double value, SpecificEnergy specificEnergy) - { - return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(value / specificEnergy.JoulesPerKilogram); - } - /// Get from * . public static double operator *(SpecificEnergy specificEnergy, BrakeSpecificFuelConsumption brakeSpecificFuelConsumption) { @@ -996,6 +992,24 @@ 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 BrakeSpecificFuelConsumption operator /(double value, SpecificEnergy specificEnergy) + { + return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(value / specificEnergy.JoulesPerKilogram); + } + + /// Get from / . + public static TemperatureDelta operator /(SpecificEnergy specificEnergy, SpecificEntropy specificEntropy) + { + return TemperatureDelta.FromKelvins(specificEnergy.JoulesPerKilogram / specificEntropy.JoulesPerKilogramKelvin); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index 1236972c5d..9fb76d54ec 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, @@ -474,18 +475,24 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci #region Relational Operators - /// Get from / . - public static Density operator /(double value, SpecificVolume specificVolume) - { - return Density.FromKilogramsPerCubicMeter(value / specificVolume.CubicMetersPerKilogram); - } - /// Get from * . public static Volume operator *(SpecificVolume specificVolume, Mass mass) { return Volume.FromCubicMeters(specificVolume.CubicMetersPerKilogram * mass.Kilograms); } + /// Get from * . + public static double operator *(SpecificVolume specificVolume, Density density) + { + return specificVolume.CubicMetersPerKilogram * density.KilogramsPerCubicMeter; + } + + /// Get from / . + public static Density operator /(double value, SpecificVolume specificVolume) + { + return Density.FromKilogramsPerCubicMeter(value / specificVolume.CubicMetersPerKilogram); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 2072c61c37..320c13a18e 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -45,10 +45,10 @@ namespace UnitsNet public readonly partial struct SpecificWeight : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, - IDivisionOperators, IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -732,18 +732,6 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci #region Relational Operators - /// Get from / . - public static Acceleration operator /(SpecificWeight specificWeight, Density density) - { - return Acceleration.FromMetersPerSecondSquared(specificWeight.NewtonsPerCubicMeter / density.KilogramsPerCubicMeter); - } - - /// Get from / . - public static Density operator /(SpecificWeight specificWeight, Acceleration acceleration) - { - return Density.FromKilogramsPerCubicMeter(specificWeight.NewtonsPerCubicMeter / acceleration.MetersPerSecondSquared); - } - /// Get from * . public static ForcePerLength operator *(SpecificWeight specificWeight, Area area) { @@ -756,6 +744,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci return Pressure.FromPascals(specificWeight.NewtonsPerCubicMeter * length.Meters); } + /// Get from / . + public static Acceleration operator /(SpecificWeight specificWeight, Density density) + { + return Acceleration.FromMetersPerSecondSquared(specificWeight.NewtonsPerCubicMeter / density.KilogramsPerCubicMeter); + } + + /// Get from / . + public static Density operator /(SpecificWeight specificWeight, Acceleration acceleration) + { + return Density.FromKilogramsPerCubicMeter(specificWeight.NewtonsPerCubicMeter / acceleration.MetersPerSecondSquared); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 4f20de6ffc..a32e7b1e2e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -42,16 +42,16 @@ namespace UnitsNet public readonly partial struct Speed : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, - IDivisionOperators, - IMultiplyOperators, IMultiplyOperators, IMultiplyOperators, - IMultiplyOperators, IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, IMultiplyOperators, - IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IMultiplyOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -1023,24 +1023,6 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speed #region Relational Operators - /// Get from / . - public static Acceleration operator /(Speed speed, Duration duration) - { - return Acceleration.FromMetersPerSecondSquared(speed.MetersPerSecond / duration.Seconds); - } - - /// Get from / . - public static Duration operator /(Speed speed, Acceleration acceleration) - { - return Duration.FromSeconds(speed.MetersPerSecond / acceleration.MetersPerSecondSquared); - } - - /// Get from * . - public static KinematicViscosity operator *(Speed speed, Length length) - { - return KinematicViscosity.FromSquareMetersPerSecond(speed.MetersPerSecond * length.Meters); - } - /// Get from * . public static Length operator *(Speed speed, Duration duration) { @@ -1053,28 +1035,40 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speed return MassFlux.FromKilogramsPerSecondPerSquareMeter(speed.MetersPerSecond * density.KilogramsPerCubicMeter); } - /// Get from * . - public static Power operator *(Speed speed, Force force) - { - return Power.FromWatts(speed.MetersPerSecond * force.Newtons); - } - /// Get from * . public static SpecificEnergy operator *(Speed left, Speed right) { return SpecificEnergy.FromJoulesPerKilogram(left.MetersPerSecond * right.MetersPerSecond); } + /// Get from * . + public static KinematicViscosity operator *(Speed speed, Length length) + { + return KinematicViscosity.FromSquareMetersPerSecond(speed.MetersPerSecond * length.Meters); + } + + /// Get from * . + public static Power operator *(Speed speed, Force force) + { + return Power.FromWatts(speed.MetersPerSecond * force.Newtons); + } + /// Get from * . public static VolumeFlow operator *(Speed speed, Area area) { return VolumeFlow.FromCubicMetersPerSecond(speed.MetersPerSecond * area.SquareMeters); } - /// Get from / . - public static Acceleration operator /(Speed speed, TimeSpan timeSpan) + /// Get from / . + public static Acceleration operator /(Speed speed, Duration duration) { - return Acceleration.FromMetersPerSecondSquared(speed.MetersPerSecond / timeSpan.TotalSeconds); + return Acceleration.FromMetersPerSecondSquared(speed.MetersPerSecond / duration.Seconds); + } + + /// Get from / . + public static Duration operator /(Speed speed, Acceleration acceleration) + { + return Duration.FromSeconds(speed.MetersPerSecond / acceleration.MetersPerSecondSquared); } /// Get from * . @@ -1089,6 +1083,12 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speed return Length.FromMeters(timeSpan.TotalSeconds * speed.MetersPerSecond); } + /// Get from / . + public static Acceleration operator /(Speed speed, TimeSpan timeSpan) + { + return Acceleration.FromMetersPerSecondSquared(speed.MetersPerSecond / timeSpan.TotalSeconds); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index 3519803abd..9c0ecd208e 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -44,9 +44,12 @@ namespace UnitsNet #if NET7_0_OR_GREATER IMultiplyOperators, IMultiplyOperators, - IDivisionOperators, IMultiplyOperators, + IDivisionOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -597,23 +600,47 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Tempe { return Energy.FromJoules(temperatureDelta.Kelvins * entropy.JoulesPerKelvin); } - - /// Get from / . - public static Length operator /(TemperatureDelta temperatureDelta, TemperatureGradient temperatureGradient) - { - return Length.FromKilometers(temperatureDelta.Kelvins / temperatureGradient.DegreesCelciusPerKilometer); - } - + /// Get from * . public static SpecificEnergy operator *(TemperatureDelta temperatureDelta, SpecificEntropy specificEntropy) { 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.FromDegreesCelciusPerKilometer(temperatureDelta.DegreesCelsius / length.Kilometers); + } + + /// 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 Length operator /(TemperatureDelta temperatureDelta, TemperatureGradient temperatureGradient) + { + return Length.FromKilometers(temperatureDelta.DegreesCelsius / temperatureGradient.DegreesCelciusPerKilometer); + } + + /// Get from / . + public static TemperatureChangeRate operator /(TemperatureDelta temperatureDelta, TimeSpan timeSpan) + { + return TemperatureChangeRate.FromDegreesCelsiusPerSecond(temperatureDelta.DegreesCelsius / timeSpan.TotalSeconds); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 7a4fd8c7af..ab6825b8dd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -42,10 +42,13 @@ namespace UnitsNet public readonly partial struct Torque : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, - IDivisionOperators, + IMultiplyOperators, + IDivisionOperators, IDivisionOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, #endif IComparable, IComparable, @@ -873,16 +876,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Torqu #region Relational Operators - /// Get from / . - public static Angle operator /(Torque torque, RotationalStiffness rotationalStiffness) + /// Get from * . + public static Power operator *(Torque torque, RotationalSpeed rotationalSpeed) { - return Angle.FromRadians(torque.NewtonMeters / rotationalStiffness.NewtonMetersPerRadian); + return Power.FromWatts(torque.NewtonMeters * rotationalSpeed.RadiansPerSecond); } - /// Get from / . - public static Force operator /(Torque torque, Length length) + /// Get from / . + public static ForcePerLength operator /(Torque torque, Area area) { - return Force.FromNewtons(torque.NewtonMeters / length.Meters); + return ForcePerLength.FromNewtonsPerMeter(torque.NewtonMeters / area.SquareMeters); } /// Get from / . @@ -897,6 +900,24 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Torqu return RotationalStiffness.FromNewtonMetersPerRadian(torque.NewtonMeters / angle.Radians); } + /// 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 Angle operator /(Torque torque, RotationalStiffness rotationalStiffness) + { + return Angle.FromRadians(torque.NewtonMeters / rotationalStiffness.NewtonMetersPerRadian); + } + #endregion #region Equality / IComparable diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index d3e788cfdc..0555b1c391 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -42,12 +42,16 @@ namespace UnitsNet public readonly partial struct Volume : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, + IMultiplyOperators, + IMultiplyOperators, IMultiplyOperators, - IDivisionOperators, IMultiplyOperators, - IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, IDivisionOperators, #endif IComparable, @@ -1398,22 +1402,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum #region Relational Operators - /// Get from / . - public static Area operator /(Volume volume, Length length) + /// Get from * . + public static AreaMomentOfInertia operator *(Volume volume, Length length) { - return Area.FromSquareMeters(volume.CubicMeters / length.Meters); + return AreaMomentOfInertia.FromMetersToTheFourth(volume.CubicMeters * length.Meters); } - /// Get from * . - public static Energy operator *(Volume volume, EnergyDensity energyDensity) + /// Get from * . + public static AmountOfSubstance operator *(Volume volume, Molarity molarity) { - return Energy.FromJoules(volume.CubicMeters * energyDensity.JoulesPerCubicMeter); + return AmountOfSubstance.FromKilomoles(volume.CubicMeters * molarity.KilomolesPerCubicMeter); } - /// Get from / . - public static Length operator /(Volume volume, Area area) + /// Get from * . + public static Energy operator *(Volume volume, EnergyDensity energyDensity) { - return Length.FromMeters(volume.CubicMeters / area.SquareMeters); + return Energy.FromJoules(volume.CubicMeters * energyDensity.JoulesPerCubicMeter); } /// Get from * . @@ -1422,10 +1426,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum return Mass.FromKilograms(volume.CubicMeters * density.KilogramsPerCubicMeter); } - /// Get from * . - public static Mass operator *(Volume volume, MassConcentration massConcentration) + /// Get from / . + public static Length operator /(Volume volume, Area area) + { + return Length.FromMeters(volume.CubicMeters / area.SquareMeters); + } + + /// Get from / . + public static SpecificVolume operator /(Volume volume, Mass mass) { - return Mass.FromKilograms(volume.CubicMeters * massConcentration.KilogramsPerCubicMeter); + return SpecificVolume.FromCubicMetersPerKilogram(volume.CubicMeters / mass.Kilograms); } /// Get from / . @@ -1434,6 +1444,24 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum return VolumeFlow.FromCubicMetersPerSecond(volume.CubicMeters / duration.Seconds); } + /// Get from / . + public static Area operator /(Volume volume, Length length) + { + return Area.FromSquareMeters(volume.CubicMeters / length.Meters); + } + + /// Get from / . + public static Mass operator /(Volume volume, SpecificVolume specificVolume) + { + return Mass.FromKilograms(volume.CubicMeters / specificVolume.CubicMetersPerKilogram); + } + + /// Get from / . + public static Duration operator /(Volume volume, VolumeFlow volumeFlow) + { + return Duration.FromSeconds(volume.CubicMeters / volumeFlow.CubicMetersPerSecond); + } + /// Get from / . public static VolumeFlow operator /(Volume volume, TimeSpan timeSpan) { diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs index 6f1fc9723f..68c3f6f974 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs @@ -45,7 +45,7 @@ namespace UnitsNet public readonly partial struct VolumeConcentration : IArithmeticQuantity, #if NET7_0_OR_GREATER - IMultiplyOperators, + IMultiplyOperators, IMultiplyOperators, #endif IComparable, @@ -784,10 +784,10 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum #region Relational Operators - /// Get from * . - public static MassConcentration operator *(VolumeConcentration volumeConcentration, Density density) + /// Get from * . + public static Density operator *(VolumeConcentration volumeConcentration, Density density) { - return MassConcentration.FromKilogramsPerCubicMeter(volumeConcentration.DecimalFractions * density.KilogramsPerCubicMeter); + return Density.FromKilogramsPerCubicMeter(volumeConcentration.DecimalFractions * density.KilogramsPerCubicMeter); } /// Get from * . diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index f3eadae85c..f7788f7ada 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -42,10 +42,11 @@ namespace UnitsNet public readonly partial struct VolumeFlow : IArithmeticQuantity, #if NET7_0_OR_GREATER - IDivisionOperators, IMultiplyOperators, - IDivisionOperators, + IMultiplyOperators, IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, IMultiplyOperators, #endif IComparable, @@ -1630,22 +1631,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum #region Relational Operators - /// Get from / . - public static Area operator /(VolumeFlow volumeFlow, Speed speed) - { - return Area.FromSquareMeters(volumeFlow.CubicMetersPerSecond / speed.MetersPerSecond); - } - /// Get from * . public static MassFlow operator *(VolumeFlow volumeFlow, Density density) { return MassFlow.FromKilogramsPerSecond(volumeFlow.CubicMetersPerSecond * density.KilogramsPerCubicMeter); } - /// Get from / . - public static Speed operator /(VolumeFlow volumeFlow, Area area) + /// Get from * . + public static MolarFlow operator *(VolumeFlow volumeFlow, Molarity molarity) { - return Speed.FromMetersPerSecond(volumeFlow.CubicMetersPerSecond / area.SquareMeters); + return MolarFlow.FromKilomolesPerSecond(volumeFlow.CubicMetersPerSecond * molarity.KilomolesPerCubicMeter); } /// Get from * . @@ -1654,6 +1649,18 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * duration.Seconds); } + /// Get from / . + public static Area operator /(VolumeFlow volumeFlow, Speed speed) + { + return Area.FromSquareMeters(volumeFlow.CubicMetersPerSecond / speed.MetersPerSecond); + } + + /// Get from / . + public static Speed operator /(VolumeFlow volumeFlow, Area area) + { + return Speed.FromMetersPerSecond(volumeFlow.CubicMetersPerSecond / area.SquareMeters); + } + /// Get from * . public static Volume operator *(VolumeFlow volumeFlow, TimeSpan timeSpan) {