From e7ba65004a1a254d97a7b471a15c0cf0f7c57906 Mon Sep 17 00:00:00 2001 From: Muximize Date: Mon, 6 Nov 2023 22:57:47 +0100 Subject: [PATCH] Generate code, clean up extras --- .../Quantities/Acceleration.extra.cs | 32 ----- .../Quantities/AmountOfSubstance.extra.cs | 25 ---- UnitsNet/CustomCode/Quantities/Angle.extra.cs | 22 ---- UnitsNet/CustomCode/Quantities/Area.extra.cs | 42 ------- .../Quantities/AreaDensity.extra.cs | 14 --- .../Quantities/AreaMomentOfInertia.extra.cs | 14 --- .../BrakeSpecificFuelConsumption.extra.cs | 26 ---- .../CoefficientOfThermalExpansion.extra.cs | 11 -- .../CustomCode/Quantities/Density.extra.cs | 46 ------- .../CustomCode/Quantities/Duration.extra.cs | 24 ---- .../Quantities/DynamicViscosity.extra.cs | 14 --- .../Quantities/ElectricCharge.extra.cs | 26 ---- .../Quantities/ElectricConductivity.extra.cs | 22 ---- .../Quantities/ElectricCurrent.extra.cs | 42 ------- .../ElectricCurrentGradient.extra.cs | 22 ---- .../Quantities/ElectricPotential.extra.cs | 27 ----- .../Quantities/ElectricResistance.extra.cs | 15 --- .../Quantities/ElectricResistivity.extra.cs | 22 ---- .../CustomCode/Quantities/Energy.extra.cs | 76 ------------ .../Quantities/EnergyDensity.extra.cs | 16 --- .../CustomCode/Quantities/Entropy.extra.cs | 14 --- UnitsNet/CustomCode/Quantities/Force.extra.cs | 54 --------- .../Quantities/ForceChangeRate.extra.cs | 16 --- .../Quantities/ForcePerLength.extra.cs | 44 ------- .../CustomCode/Quantities/HeatFlux.extra.cs | 14 --- .../Quantities/KinematicViscosity.extra.cs | 46 ------- .../CustomCode/Quantities/Length.extra.cs | 71 ----------- .../Quantities/LinearDensity.extra.cs | 27 ----- .../CustomCode/Quantities/Luminance.extra.cs | 14 --- .../Quantities/LuminousIntensity.extra.cs | 20 --- UnitsNet/CustomCode/Quantities/Mass.extra.cs | 66 ---------- .../Quantities/MassConcentration.extra.cs | 29 ----- .../CustomCode/Quantities/MassFlow.extra.cs | 76 ------------ .../CustomCode/Quantities/MassFlux.extra.cs | 26 ---- .../Quantities/MassFraction.extra.cs | 21 +--- .../CustomCode/Quantities/MolarFlow.extra.cs | 32 ----- .../CustomCode/Quantities/Molarity.extra.cs | 29 ----- UnitsNet/CustomCode/Quantities/Power.extra.cs | 86 ------------- .../CustomCode/Quantities/Pressure.extra.cs | 58 --------- .../Quantities/PressureChangeRate.extra.cs | 22 ---- .../Quantities/ReciprocalArea.extra.cs | 40 ------ .../Quantities/ReciprocalLength.extra.cs | 46 ------- .../Quantities/RotationalSpeed.extra.cs | 34 ------ .../Quantities/RotationalStiffness.extra.cs | 26 ---- .../RotationalStiffnessPerLength.extra.cs | 15 --- .../Quantities/SpecificEnergy.extra.cs | 44 ------- .../Quantities/SpecificEntropy.extra.cs | 20 --- .../Quantities/SpecificVolume.extra.cs | 20 --- .../Quantities/SpecificWeight.extra.cs | 40 ------ UnitsNet/CustomCode/Quantities/Speed.extra.cs | 76 ------------ .../Quantities/TemperatureChangeRate.extra.cs | 29 ----- .../Quantities/TemperatureDelta.extra.cs | 44 ------- .../Quantities/TemperatureGradient.extra.cs | 23 ---- .../CustomCode/Quantities/Torque.extra.cs | 32 ----- .../CustomCode/Quantities/Volume.extra.cs | 40 ------ .../Quantities/VolumeConcentration.extra.cs | 17 --- .../CustomCode/Quantities/VolumeFlow.extra.cs | 46 ------- .../Quantities/Acceleration.g.cs | 57 +++++++++ .../Quantities/AmountOfSubstance.g.cs | 30 +++++ UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 30 +++++ UnitsNet/GeneratedCode/Quantities/Area.g.cs | 100 +++++++++++++++ .../GeneratedCode/Quantities/AreaDensity.g.cs | 16 +++ .../Quantities/AreaMomentOfInertia.g.cs | 16 +++ .../BrakeSpecificFuelConsumption.g.cs | 29 +++++ .../CoefficientOfThermalExpansion.g.cs | 16 +++ .../GeneratedCode/Quantities/Density.g.cs | 58 +++++++++ .../GeneratedCode/Quantities/Duration.g.cs | 100 +++++++++++++++ .../Quantities/DynamicViscosity.g.cs | 16 +++ .../Quantities/ElectricCharge.g.cs | 37 ++++++ .../Quantities/ElectricConductivity.g.cs | 11 ++ .../Quantities/ElectricCurrent.g.cs | 57 +++++++++ .../Quantities/ElectricCurrentGradient.g.cs | 29 +++++ .../Quantities/ElectricPotential.g.cs | 37 ++++++ .../Quantities/ElectricResistance.g.cs | 16 +++ .../Quantities/ElectricResistivity.g.cs | 11 ++ UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 79 ++++++++++++ .../Quantities/EnergyDensity.g.cs | 16 +++ .../GeneratedCode/Quantities/Entropy.g.cs | 23 ++++ UnitsNet/GeneratedCode/Quantities/Force.g.cs | 79 ++++++++++++ .../Quantities/ForceChangeRate.g.cs | 29 +++++ .../Quantities/ForcePerLength.g.cs | 44 +++++++ .../GeneratedCode/Quantities/Frequency.g.cs | 16 +++ .../GeneratedCode/Quantities/HeatFlux.g.cs | 16 +++ .../Quantities/KinematicViscosity.g.cs | 43 +++++++ UnitsNet/GeneratedCode/Quantities/Length.g.cs | 100 +++++++++++++++ .../Quantities/LinearDensity.g.cs | 30 +++++ .../GeneratedCode/Quantities/Luminance.g.cs | 16 +++ .../Quantities/LuminousIntensity.g.cs | 23 ++++ UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 114 ++++++++++++++++++ .../Quantities/MassConcentration.g.cs | 30 +++++ .../GeneratedCode/Quantities/MassFlow.g.cs | 78 ++++++++++++ .../GeneratedCode/Quantities/MassFlux.g.cs | 30 +++++ .../Quantities/MassFraction.g.cs | 16 +++ .../GeneratedCode/Quantities/MolarFlow.g.cs | 43 +++++++ .../GeneratedCode/Quantities/MolarMass.g.cs | 30 +++++ .../GeneratedCode/Quantities/Molarity.g.cs | 23 ++++ UnitsNet/GeneratedCode/Quantities/Power.g.cs | 99 +++++++++++++++ .../GeneratedCode/Quantities/Pressure.g.cs | 58 +++++++++ .../Quantities/PressureChangeRate.g.cs | 29 +++++ .../Quantities/ReciprocalArea.g.cs | 37 ++++++ .../Quantities/ReciprocalLength.g.cs | 44 +++++++ .../Quantities/RotationalSpeed.g.cs | 29 +++++ .../Quantities/RotationalStiffness.g.cs | 30 +++++ .../RotationalStiffnessPerLength.g.cs | 16 +++ .../Quantities/SpecificEnergy.g.cs | 43 +++++++ .../Quantities/SpecificEntropy.g.cs | 23 ++++ .../Quantities/SpecificVolume.g.cs | 22 ++++ .../Quantities/SpecificWeight.g.cs | 37 ++++++ UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 85 +++++++++++++ .../Quantities/TemperatureChangeRate.g.cs | 29 +++++ .../Quantities/TemperatureDelta.g.cs | 44 +++++++ .../Quantities/TemperatureGradient.g.cs | 16 +++ UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 37 ++++++ UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 65 ++++++++++ .../Quantities/VolumeConcentration.g.cs | 23 ++++ .../GeneratedCode/Quantities/VolumeFlow.g.cs | 50 ++++++++ 116 files changed, 2362 insertions(+), 1893 deletions(-) delete mode 100644 UnitsNet/CustomCode/Quantities/Acceleration.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/Angle.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/AreaDensity.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/AreaMomentOfInertia.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/CoefficientOfThermalExpansion.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/Density.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/DynamicViscosity.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/ElectricCharge.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/ElectricConductivity.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/ElectricCurrent.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/ElectricCurrentGradient.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/ElectricResistance.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/ElectricResistivity.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/Energy.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/Entropy.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/ForceChangeRate.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/ForcePerLength.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/HeatFlux.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/KinematicViscosity.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/LinearDensity.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/Luminance.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/LuminousIntensity.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/MassFlow.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/MassFlux.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/MolarFlow.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/Pressure.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/PressureChangeRate.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/ReciprocalArea.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/ReciprocalLength.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/RotationalSpeed.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/RotationalStiffness.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/SpecificEnergy.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/SpecificEntropy.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/SpecificVolume.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/SpecificWeight.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/Speed.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/TemperatureChangeRate.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/TemperatureGradient.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/Torque.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/Volume.extra.cs delete mode 100644 UnitsNet/CustomCode/Quantities/VolumeFlow.extra.cs diff --git a/UnitsNet/CustomCode/Quantities/Acceleration.extra.cs b/UnitsNet/CustomCode/Quantities/Acceleration.extra.cs deleted file mode 100644 index 562111afd0..0000000000 --- a/UnitsNet/CustomCode/Quantities/Acceleration.extra.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct Acceleration - { - /// - /// Multiply and to get . - /// - public static SpecificWeight operator *(Acceleration acceleration, Density density) - { - return new SpecificWeight(acceleration.MetersPerSecondSquared * density.KilogramsPerCubicMeter, UnitsNet.Units.SpecificWeightUnit.NewtonPerCubicMeter); - } - - /// - /// Multiply and to get . - /// - public static Speed operator *(Acceleration acceleration, Duration duration) - { - return new Speed(acceleration.MetersPerSecondSquared * duration.Seconds, UnitsNet.Units.SpeedUnit.MeterPerSecond); - } - - /// - /// Divide by to get . - /// - public static Jerk operator /(Acceleration acceleration, Duration duration) - { - return new Jerk(acceleration.MetersPerSecondSquared / duration.Seconds, UnitsNet.Units.JerkUnit.MeterPerSecondCubed); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/AmountOfSubstance.extra.cs b/UnitsNet/CustomCode/Quantities/AmountOfSubstance.extra.cs index 6fb8944cfe..83b85777cf 100644 --- a/UnitsNet/CustomCode/Quantities/AmountOfSubstance.extra.cs +++ b/UnitsNet/CustomCode/Quantities/AmountOfSubstance.extra.cs @@ -39,30 +39,5 @@ public static AmountOfSubstance FromMass(Mass mass, MolarMass molarMass) { return mass / molarMass; } - - /// Get from for a given . - public static Mass operator *(AmountOfSubstance amountOfSubstance, MolarMass molarMass) - { - return Mass.FromGrams(amountOfSubstance.Moles * molarMass.GramsPerMole); - } - - /// Get from for a given . - public static Mass operator *(MolarMass molarMass, AmountOfSubstance amountOfSubstance) - { - return Mass.FromGrams(amountOfSubstance.Moles * molarMass.GramsPerMole); - } - - /// Get from divided by . - public static Molarity operator /(AmountOfSubstance amountOfComponent, Volume mixtureVolume) - { - return Molarity.FromMolesPerCubicMeter(amountOfComponent.Moles / mixtureVolume.CubicMeters); - } - - /// Get from divided by . - public static Volume operator /(AmountOfSubstance amountOfSubstance, Molarity molarity) - { - return Volume.FromCubicMeters(amountOfSubstance.Moles / molarity.MolesPerCubicMeter); - } - } } diff --git a/UnitsNet/CustomCode/Quantities/Angle.extra.cs b/UnitsNet/CustomCode/Quantities/Angle.extra.cs deleted file mode 100644 index 59318915c4..0000000000 --- a/UnitsNet/CustomCode/Quantities/Angle.extra.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct Angle - { - /// Get from delta over time delta. - public static RotationalSpeed operator /(Angle angle, TimeSpan timeSpan) - { - return RotationalSpeed.FromRadiansPerSecond(angle.Radians / timeSpan.TotalSeconds); - } - - /// - public static RotationalSpeed operator /(Angle angle, Duration duration) - { - return RotationalSpeed.FromRadiansPerSecond(angle.Radians / duration.Seconds); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/Area.extra.cs b/UnitsNet/CustomCode/Quantities/Area.extra.cs index 8df2a275d3..3a9d28e973 100644 --- a/UnitsNet/CustomCode/Quantities/Area.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Area.extra.cs @@ -23,47 +23,5 @@ public static Area FromCircleRadius(Length radius) } #endregion - - /// - /// Calculates the inverse of this quantity. - /// - /// The corresponding inverse quantity, . - public ReciprocalArea Inverse() - { - if (SquareMeters == 0.0) - return new ReciprocalArea(0.0, UnitsNet.Units.ReciprocalAreaUnit.InverseSquareMeter); - - return new ReciprocalArea(1 / SquareMeters, UnitsNet.Units.ReciprocalAreaUnit.InverseSquareMeter); - } - - /// Get from divided by . - public static Length operator /(Area area, Length length) - { - return Length.FromMeters(area.SquareMeters / length.Meters); - } - - /// Get from times . - public static MassFlow operator *(Area area, MassFlux massFlux) - { - return MassFlow.FromGramsPerSecond(area.SquareMeters * massFlux.GramsPerSecondPerSquareMeter); - } - - /// Get from times . - public static VolumeFlow operator *(Area area, Speed speed) - { - return VolumeFlow.FromCubicMetersPerSecond(area.SquareMeters * speed.MetersPerSecond); - } - - /// Get from times . - public static LinearDensity operator *(Area area, Density density) - { - return LinearDensity.FromKilogramsPerMeter(area.SquareMeters * density.KilogramsPerCubicMeter); - } - - /// Get from times . - public static Ratio operator *(Area area, ReciprocalArea reciprocalArea) - { - return Ratio.FromDecimalFractions(area.SquareMeters * reciprocalArea.InverseSquareMeters); - } } } diff --git a/UnitsNet/CustomCode/Quantities/AreaDensity.extra.cs b/UnitsNet/CustomCode/Quantities/AreaDensity.extra.cs deleted file mode 100644 index 1e92e6f211..0000000000 --- a/UnitsNet/CustomCode/Quantities/AreaDensity.extra.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct AreaDensity - { - /// Get from times . - public static Mass operator *(AreaDensity areaDensity, Area area) - { - return Mass.FromKilograms(areaDensity.KilogramsPerSquareMeter * area.SquareMeters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/AreaMomentOfInertia.extra.cs b/UnitsNet/CustomCode/Quantities/AreaMomentOfInertia.extra.cs deleted file mode 100644 index 2d254b9c17..0000000000 --- a/UnitsNet/CustomCode/Quantities/AreaMomentOfInertia.extra.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct AreaMomentOfInertia - { - /// Get from divided by . - public static Volume operator /(AreaMomentOfInertia areaMomentOfInertia, Length length) - { - return Volume.FromCubicMeters(areaMomentOfInertia.MetersToTheFourth / length.Meters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs b/UnitsNet/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs deleted file mode 100644 index e2bfa67d7a..0000000000 --- a/UnitsNet/CustomCode/Quantities/BrakeSpecificFuelConsumption.extra.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct BrakeSpecificFuelConsumption - { - /// Get from times . - public static MassFlow operator *(BrakeSpecificFuelConsumption bsfc, Power power) - { - return MassFlow.FromKilogramsPerSecond(bsfc.KilogramsPerJoule * (double)power.Watts); - } - - /// Get from divided by . - public static SpecificEnergy operator /(double value, BrakeSpecificFuelConsumption bsfc) - { - return SpecificEnergy.FromJoulesPerKilogram(value/bsfc.KilogramsPerJoule); - } - - /// Get constant from times . - public static double operator *(BrakeSpecificFuelConsumption bsfc, SpecificEnergy specificEnergy) - { - return specificEnergy.JoulesPerKilogram*bsfc.KilogramsPerJoule; - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/CoefficientOfThermalExpansion.extra.cs b/UnitsNet/CustomCode/Quantities/CoefficientOfThermalExpansion.extra.cs deleted file mode 100644 index 0a426727fd..0000000000 --- a/UnitsNet/CustomCode/Quantities/CoefficientOfThermalExpansion.extra.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct CoefficientOfThermalExpansion - { - /// Get a scalar from a multiplied by a . - public static double operator *(CoefficientOfThermalExpansion cte, TemperatureDelta temperatureDelta) => cte.PerKelvin * temperatureDelta.Kelvins; - } -} diff --git a/UnitsNet/CustomCode/Quantities/Density.extra.cs b/UnitsNet/CustomCode/Quantities/Density.extra.cs deleted file mode 100644 index fd036dc519..0000000000 --- a/UnitsNet/CustomCode/Quantities/Density.extra.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using UnitsNet.Units; - -namespace UnitsNet -{ - public partial struct Density - { - /// Get from times . - public static Mass operator *(Density density, Volume volume) - { - return Mass.FromKilograms(density.KilogramsPerCubicMeter * volume.CubicMeters); - } - - /// Get from times . - public static Mass operator *(Volume volume, Density density) - { - return Mass.FromKilograms(density.KilogramsPerCubicMeter * volume.CubicMeters); - } - - /// Get from times . - public static DynamicViscosity operator *(Density density, KinematicViscosity kinematicViscosity) - { - return DynamicViscosity.FromNewtonSecondsPerMeterSquared(kinematicViscosity.SquareMetersPerSecond * density.KilogramsPerCubicMeter); - } - - /// Get times . - public static MassFlux operator *(Density density, Speed speed) - { - return MassFlux.FromKilogramsPerSecondPerSquareMeter(density.KilogramsPerCubicMeter * speed.MetersPerSecond); - } - - /// Get from times . - public static SpecificWeight operator *(Density density, Acceleration acceleration) - { - return new SpecificWeight(density.KilogramsPerCubicMeter * acceleration.MetersPerSecondSquared, SpecificWeightUnit.NewtonPerCubicMeter); - } - - /// Get from times . - public static LinearDensity operator *(Density density, Area area) - { - return LinearDensity.FromKilogramsPerMeter(density.KilogramsPerCubicMeter * area.SquareMeters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/Duration.extra.cs b/UnitsNet/CustomCode/Quantities/Duration.extra.cs index e1e898c62d..4333d3c745 100644 --- a/UnitsNet/CustomCode/Quantities/Duration.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Duration.extra.cs @@ -92,29 +92,5 @@ public static explicit operator Duration(TimeSpan duration) { return timeSpan.TotalSeconds >= duration.Seconds; } - - /// Get from multiplied by . - public static Volume operator *(Duration duration, VolumeFlow volumeFlow) - { - return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * duration.Seconds); - } - - /// Get from multiplied by . - public static ElectricCharge operator *(Duration time, ElectricCurrent current) - { - return ElectricCharge.FromAmpereHours(current.Amperes * time.Hours); - } - - /// Get from multiplied by . - public static Speed operator *(Duration duration, Acceleration acceleration) - { - return new Speed(acceleration.MetersPerSecondSquared * duration.Seconds, SpeedUnit.MeterPerSecond); - } - - /// Get from multiplied by . - public static Force operator *(Duration duration, ForceChangeRate forceChangeRate) - { - return new Force(forceChangeRate.NewtonsPerSecond * duration.Seconds, ForceUnit.Newton); - } } } diff --git a/UnitsNet/CustomCode/Quantities/DynamicViscosity.extra.cs b/UnitsNet/CustomCode/Quantities/DynamicViscosity.extra.cs deleted file mode 100644 index e99348a111..0000000000 --- a/UnitsNet/CustomCode/Quantities/DynamicViscosity.extra.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct DynamicViscosity - { - /// Get from divided by . - public static KinematicViscosity operator /(DynamicViscosity dynamicViscosity, Density density) - { - return KinematicViscosity.FromSquareMetersPerSecond(dynamicViscosity.NewtonSecondsPerMeterSquared / density.KilogramsPerCubicMeter); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/ElectricCharge.extra.cs b/UnitsNet/CustomCode/Quantities/ElectricCharge.extra.cs deleted file mode 100644 index 2ece06a503..0000000000 --- a/UnitsNet/CustomCode/Quantities/ElectricCharge.extra.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct ElectricCharge - { - /// Get from divided by . - public static ElectricCurrent operator /(ElectricCharge charge, Duration time) - { - return ElectricCurrent.FromAmperes(charge.AmpereHours / time.Hours); - } - - /// Get from divided by . - public static Duration operator /(ElectricCharge charge, ElectricCurrent current) - { - return Duration.FromHours(charge.AmpereHours / current.Amperes); - } - - /// Get from times . - public static Energy operator *(ElectricCharge charge, ElectricPotential potential) - { - return Energy.FromJoules(potential.Volts * charge.Coulombs); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/ElectricConductivity.extra.cs b/UnitsNet/CustomCode/Quantities/ElectricConductivity.extra.cs deleted file mode 100644 index 120fae5701..0000000000 --- a/UnitsNet/CustomCode/Quantities/ElectricConductivity.extra.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using UnitsNet.Units; - -namespace UnitsNet -{ - public partial struct ElectricConductivity - { - /// - /// Calculates the inverse or of this unit. - /// - /// The inverse or of this unit. - public ElectricResistivity Inverse() - { - if (SiemensPerMeter == 0.0) - return new ElectricResistivity( 0.0, ElectricResistivityUnit.OhmMeter ); - - return new ElectricResistivity( 1 / SiemensPerMeter, ElectricResistivityUnit.OhmMeter ); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/ElectricCurrent.extra.cs b/UnitsNet/CustomCode/Quantities/ElectricCurrent.extra.cs deleted file mode 100644 index 8928254f82..0000000000 --- a/UnitsNet/CustomCode/Quantities/ElectricCurrent.extra.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct ElectricCurrent - { - /// Get from multiplied by . - /// Ohm's law implementation - public static ElectricPotential operator *(ElectricCurrent current, ElectricResistance resistance) - { - return ElectricPotential.FromVolts(resistance.Ohms * current.Amperes); - } - - /// Calculate from multiplied by . - /// Electric power is defined as P = U * I. - public static Power operator *(ElectricCurrent current, ElectricPotential potential) - { - return Power.FromWatts(potential.Volts * current.Amperes); - } - - /// Calculate from multiplied by . - public static ElectricCharge operator *(ElectricCurrent current, Duration time) - { - return ElectricCharge.FromAmpereHours(current.Amperes * time.Hours); - } - - /// Get from divided by . - public static ElectricCurrentGradient operator /(ElectricCurrent current, Duration duration) - { - return ElectricCurrentGradient.FromAmperesPerSecond(current.Amperes / duration.Seconds); - } - - /// Get from divided by . - public static ElectricCurrentGradient operator /(ElectricCurrent current, TimeSpan timeSpan) - { - return ElectricCurrentGradient.FromAmperesPerSecond(current.Amperes / timeSpan.TotalSeconds); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/ElectricCurrentGradient.extra.cs b/UnitsNet/CustomCode/Quantities/ElectricCurrentGradient.extra.cs deleted file mode 100644 index 11800f51f6..0000000000 --- a/UnitsNet/CustomCode/Quantities/ElectricCurrentGradient.extra.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct ElectricCurrentGradient - { - /// Get from times . - public static ElectricCurrent operator *(ElectricCurrentGradient currentGradient, Duration duration) - { - return ElectricCurrent.FromAmperes(currentGradient.AmperesPerSecond * duration.Seconds); - } - - /// Get from times . - public static ElectricCurrent operator *(ElectricCurrentGradient currentGradient, TimeSpan timeSpan) - { - return ElectricCurrent.FromAmperes(currentGradient.AmperesPerSecond * timeSpan.TotalSeconds); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/ElectricPotential.extra.cs b/UnitsNet/CustomCode/Quantities/ElectricPotential.extra.cs index 5ff53c0389..5a807c63c5 100644 --- a/UnitsNet/CustomCode/Quantities/ElectricPotential.extra.cs +++ b/UnitsNet/CustomCode/Quantities/ElectricPotential.extra.cs @@ -18,32 +18,5 @@ public AmplitudeRatio ToAmplitudeRatio() { return AmplitudeRatio.FromElectricPotential(this); } - - /// Get from divided by . - /// Ohm's law implementation - public static ElectricResistance operator /(ElectricPotential potential, ElectricCurrent current) - { - return ElectricResistance.FromOhms(potential.Volts / current.Amperes); - } - - /// Get from divided by . - /// Ohm's law implementation - public static ElectricCurrent operator /(ElectricPotential potential, ElectricResistance resistance) - { - return ElectricCurrent.FromAmperes(potential.Volts / resistance.Ohms); - } - - /// Calculate from multiplied by . - /// Electric power is defined as P = U * I. - public static Power operator *(ElectricPotential potential, ElectricCurrent current) - { - return Power.FromWatts(potential.Volts * current.Amperes); - } - - /// Get from times . - public static Energy operator *(ElectricPotential potential, ElectricCharge charge) - { - return Energy.FromJoules(potential.Volts * charge.Coulombs); - } } } diff --git a/UnitsNet/CustomCode/Quantities/ElectricResistance.extra.cs b/UnitsNet/CustomCode/Quantities/ElectricResistance.extra.cs deleted file mode 100644 index 95d103d89e..0000000000 --- a/UnitsNet/CustomCode/Quantities/ElectricResistance.extra.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct ElectricResistance - { - /// Get from multiplied by . - /// Ohm's law implementation - public static ElectricPotential operator *(ElectricResistance resistance, ElectricCurrent current) - { - return ElectricPotential.FromVolts(resistance.Ohms * current.Amperes); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/ElectricResistivity.extra.cs b/UnitsNet/CustomCode/Quantities/ElectricResistivity.extra.cs deleted file mode 100644 index f53482d9f2..0000000000 --- a/UnitsNet/CustomCode/Quantities/ElectricResistivity.extra.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using UnitsNet.Units; - -namespace UnitsNet -{ - public partial struct ElectricResistivity - { - /// - /// Calculates the inverse or of this unit. - /// - /// The inverse or of this unit. - public ElectricConductivity Inverse() - { - if (OhmMeters == 0.0) - return new ElectricConductivity( 0, ElectricConductivityUnit.SiemensPerMeter ); - - return new ElectricConductivity( 1 / OhmMeters, ElectricConductivityUnit.SiemensPerMeter ); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/Energy.extra.cs b/UnitsNet/CustomCode/Quantities/Energy.extra.cs deleted file mode 100644 index 10fd0ff4ab..0000000000 --- a/UnitsNet/CustomCode/Quantities/Energy.extra.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct Energy - { - /// Get from divided by . - public static Power operator /(Energy energy, TimeSpan time) - { - return Power.FromWatts(energy.Joules / time.TotalSeconds); - } - - /// Get from divided by . - public static Power operator /(Energy energy, Duration duration) - { - return Power.FromWatts(energy.Joules / duration.Seconds); - } - - /// Get from divided by . - public static Duration operator /(Energy energy, Power power) - { - return Duration.FromSeconds(energy.Joules / (double)power.Watts); - } - - /// Get from divided by . - public static ElectricCharge operator /(Energy energy, ElectricPotential potential) - { - return ElectricCharge.FromCoulombs(energy.Joules / potential.Volts); - } - - /// Get from divided by . - public static ElectricPotential operator /(Energy energy, ElectricCharge current) - { - return ElectricPotential.FromVolts(energy.Joules / current.Coulombs); - } - - /// Get from times . - public static Power operator *(Energy energy, Frequency frequency) - { - return Power.FromWatts(energy.Joules * frequency.PerSecond); - } - - /// Get from times . - public static Power operator *(Frequency frequency, Energy energy) - { - return Power.FromWatts(energy.Joules * frequency.PerSecond); - } - - /// Get from divided by - public static Entropy operator /(Energy energy, TemperatureDelta temperatureDelta) - { - return Entropy.FromJoulesPerKelvin(energy.Joules / temperatureDelta.Kelvins); - } - - /// Get from divided by . - public static TemperatureDelta operator /(Energy energy, Entropy entropy) - { - return TemperatureDelta.FromKelvins(energy.Joules / entropy.JoulesPerKelvin); - } - - /// Get from divided by - public static SpecificEnergy operator /(Energy energy, Mass mass) - { - return SpecificEnergy.FromJoulesPerKilogram(energy.Joules / mass.Kilograms); - } - - /// Get from divided by . - public static Mass operator /(Energy energy, SpecificEnergy specificEnergy) - { - return Mass.FromKilograms(energy.Joules / specificEnergy.JoulesPerKilogram); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/EnergyDensity.extra.cs b/UnitsNet/CustomCode/Quantities/EnergyDensity.extra.cs index d2fda8070b..811267d7f9 100644 --- a/UnitsNet/CustomCode/Quantities/EnergyDensity.extra.cs +++ b/UnitsNet/CustomCode/Quantities/EnergyDensity.extra.cs @@ -4,20 +4,6 @@ namespace UnitsNet { public partial struct EnergyDensity { - #region Operators - - /// - /// Returns the from the given and . - /// - public static Energy operator * ( EnergyDensity energyDensity, Volume volume ) - { - return Energy.FromJoules ( energyDensity.JoulesPerCubicMeter * volume.As ( VolumeUnit.CubicMeter ) ); - } - - #endregion - - #region Methods - /// /// Computes the combustion energy of a natural gas heating system. /// @@ -46,7 +32,5 @@ public static Energy CombustionEnergy ( EnergyDensity energyDensity, Volume volu { return Energy.FromJoules ( (energyDensity * volume).As ( EnergyUnit.Joule ) * conversionFactor.DecimalFractions ); } - - #endregion } } diff --git a/UnitsNet/CustomCode/Quantities/Entropy.extra.cs b/UnitsNet/CustomCode/Quantities/Entropy.extra.cs deleted file mode 100644 index 5b3d45c313..0000000000 --- a/UnitsNet/CustomCode/Quantities/Entropy.extra.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct Entropy - { - /// Get from divided by . - public static SpecificEntropy operator /(Entropy entropy, Mass mass) - { - return SpecificEntropy.FromJoulesPerKilogramKelvin(entropy.JoulesPerKelvin / mass.Kilograms); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/Force.extra.cs b/UnitsNet/CustomCode/Quantities/Force.extra.cs index 7972c0f412..d729d18b18 100644 --- a/UnitsNet/CustomCode/Quantities/Force.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Force.extra.cs @@ -19,59 +19,5 @@ public static Force FromMassByAcceleration(Mass mass, Acceleration acceleration) { return new Force(mass.Kilograms * acceleration.MetersPerSecondSquared, ForceUnit.Newton); } - - /// Get from times . - public static Power operator *(Force force, Speed speed) - { - return Power.FromWatts(force.Newtons * speed.MetersPerSecond); - } - - /// Get from times . - public static Power operator *(Speed speed, Force force) - { - return Power.FromWatts(force.Newtons * speed.MetersPerSecond); - } - - /// Get from times . - public static ForcePerLength operator *(Force force, ReciprocalLength reciprocalLength) - { - return ForcePerLength.FromNewtonsPerMeter(force.Newtons * reciprocalLength.InverseMeters); - } - - /// Get from times . - public static Pressure operator *(Force force, ReciprocalArea reciprocalArea) - { - return Pressure.FromNewtonsPerSquareMeter(force.Newtons * reciprocalArea.InverseSquareMeters); - } - - /// Get from divided by . - public static Acceleration operator /(Force force, Mass mass) - { - return Acceleration.FromMetersPerSecondSquared(force.Newtons / mass.Kilograms); - } - - /// Get from divided by . - public static Mass operator /(Force force, Acceleration acceleration) - { - return Mass.FromKilograms(force.Newtons / acceleration.MetersPerSecondSquared); - } - - /// Get from divided by . - public static Pressure operator /(Force force, Area area) - { - return Pressure.FromPascals(force.Newtons / area.SquareMeters); - } - - /// Get from divided by . - public static ForcePerLength operator /(Force force, Length length) - { - return ForcePerLength.FromNewtonsPerMeter(force.Newtons / length.Meters); - } - - /// Get from divided by . - public static Duration operator /(Force force, ForceChangeRate forceChangeRate) - { - return new Duration(force.Newtons / forceChangeRate.NewtonsPerSecond, DurationUnit.Second); - } } } diff --git a/UnitsNet/CustomCode/Quantities/ForceChangeRate.extra.cs b/UnitsNet/CustomCode/Quantities/ForceChangeRate.extra.cs deleted file mode 100644 index 4880daadde..0000000000 --- a/UnitsNet/CustomCode/Quantities/ForceChangeRate.extra.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using UnitsNet.Units; - -namespace UnitsNet -{ - public partial struct ForceChangeRate - { - /// Get from multiplied by . - public static Force operator *(ForceChangeRate forceChangeRate, Duration duration) - { - return new Force(forceChangeRate.NewtonsPerSecond * duration.Seconds, ForceUnit.Newton); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/ForcePerLength.extra.cs b/UnitsNet/CustomCode/Quantities/ForcePerLength.extra.cs deleted file mode 100644 index 5c37361248..0000000000 --- a/UnitsNet/CustomCode/Quantities/ForcePerLength.extra.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct ForcePerLength - { - /// Get from multiplied by . - public static Force operator *(ForcePerLength forcePerLength, Length length) - { - return Force.FromNewtons(forcePerLength.NewtonsPerMeter * length.Meters); - } - - /// Get from divided by . - public static Length operator /(Force force, ForcePerLength forcePerLength) - { - return Length.FromMeters(force.Newtons / forcePerLength.NewtonsPerMeter); - } - - /// Get from divided by . - public static Pressure operator /(ForcePerLength forcePerLength, Length length) - { - return Pressure.FromNewtonsPerSquareMeter(forcePerLength.NewtonsPerMeter / length.Meters); - } - - /// Get from multiplied by . - public static Torque operator *(ForcePerLength forcePerLength, Area area) - { - return Torque.FromNewtonMeters(forcePerLength.NewtonsPerMeter * area.SquareMeters); - } - - /// Get from multiplied by . - public static Pressure operator *(ForcePerLength forcePerLength, ReciprocalLength reciprocalLength) - { - return Pressure.FromNewtonsPerSquareMeter(forcePerLength.NewtonsPerMeter * reciprocalLength.InverseMeters); - } - - /// Get from divided by . - public static Force operator /(ForcePerLength forcePerLength, ReciprocalLength reciprocalLength) - { - return Force.FromNewtons(forcePerLength.NewtonsPerMeter / reciprocalLength.InverseMeters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/HeatFlux.extra.cs b/UnitsNet/CustomCode/Quantities/HeatFlux.extra.cs deleted file mode 100644 index 395661fb1f..0000000000 --- a/UnitsNet/CustomCode/Quantities/HeatFlux.extra.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct HeatFlux - { - /// Get from times . - public static Power operator *(HeatFlux heatFlux, Area area) - { - return Power.FromWatts(heatFlux.WattsPerSquareMeter * area.SquareMeters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/KinematicViscosity.extra.cs b/UnitsNet/CustomCode/Quantities/KinematicViscosity.extra.cs deleted file mode 100644 index f43b75534c..0000000000 --- a/UnitsNet/CustomCode/Quantities/KinematicViscosity.extra.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct KinematicViscosity - { - /// Get from divided by . - public static Speed operator /(KinematicViscosity kinematicViscosity, Length length) - { - return Speed.FromMetersPerSecond(kinematicViscosity.SquareMetersPerSecond / length.Meters); - } - - /// Get from times . - public static Area operator *(KinematicViscosity kinematicViscosity, TimeSpan timeSpan) - { - return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * timeSpan.TotalSeconds); - } - - /// Get from times . - public static Area operator *(TimeSpan timeSpan, KinematicViscosity kinematicViscosity) - { - return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * timeSpan.TotalSeconds); - } - - /// Get from times . - public static Area operator *(KinematicViscosity kinematicViscosity, Duration duration) - { - return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * duration.Seconds); - } - - /// Get from times . - public static Area operator *(Duration duration, KinematicViscosity kinematicViscosity) - { - return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * duration.Seconds); - } - - /// Get from times . - public static DynamicViscosity operator *(KinematicViscosity kinematicViscosity, Density density) - { - return DynamicViscosity.FromNewtonSecondsPerMeterSquared(kinematicViscosity.SquareMetersPerSecond * density.KilogramsPerCubicMeter); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/Length.extra.cs b/UnitsNet/CustomCode/Quantities/Length.extra.cs index 7c41035344..3d251b249f 100644 --- a/UnitsNet/CustomCode/Quantities/Length.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Length.extra.cs @@ -13,17 +13,6 @@ public partial struct Length { private const double InchesInOneFoot = 12; - /// - /// Calculates the inverse of this unit. - /// - /// The inverse of this unit as . - public ReciprocalLength Inverse() - { - return Meters == 0.0 - ? new ReciprocalLength(0.0, ReciprocalLengthUnit.InverseMeter) - : new ReciprocalLength(1 / Meters, ReciprocalLengthUnit.InverseMeter); - } - /// /// Converts the length to a customary feet/inches combination. /// @@ -122,66 +111,6 @@ public static bool TryParseFeetInches(string? str, out Length result, IFormatPro result = default; return false; } - - /// Get from divided by . - public static Speed operator /(Length length, TimeSpan timeSpan) - { - return Speed.FromMetersPerSecond(length.Meters/timeSpan.TotalSeconds); - } - - /// Get from divided by . - public static Speed operator /(Length length, Duration duration) - { - return Speed.FromMetersPerSecond(length.Meters/duration.Seconds); - } - - /// Get from divided by . - public static Duration operator /(Length length, Speed speed) - { - return Duration.FromSeconds(length.Meters/speed.MetersPerSecond); - } - - /// Get from times . - public static Area operator *(Length length1, Length length2) - { - return Area.FromSquareMeters(length1.Meters*length2.Meters); - } - - /// Get from times . - public static Volume operator *(Area area, Length length) - { - return Volume.FromCubicMeters(area.SquareMeters*length.Meters); - } - - /// Get from times . - public static Volume operator *(Length length, Area area) - { - return Volume.FromCubicMeters(area.SquareMeters*length.Meters); - } - - /// Get from times . - public static Torque operator *(Force force, Length length) - { - return Torque.FromNewtonMeters(force.Newtons*length.Meters); - } - - /// Get from times . - public static Torque operator *(Length length, Force force) - { - return Torque.FromNewtonMeters(force.Newtons*length.Meters); - } - - /// Get from times . - public static KinematicViscosity operator *(Length length, Speed speed) - { - return KinematicViscosity.FromSquareMetersPerSecond(length.Meters*speed.MetersPerSecond); - } - - /// Get from times . - public static Pressure operator *(Length length, SpecificWeight specificWeight) - { - return new Pressure(length.Meters * specificWeight.NewtonsPerCubicMeter, PressureUnit.Pascal); - } } /// diff --git a/UnitsNet/CustomCode/Quantities/LinearDensity.extra.cs b/UnitsNet/CustomCode/Quantities/LinearDensity.extra.cs deleted file mode 100644 index 1b4740e08d..0000000000 --- a/UnitsNet/CustomCode/Quantities/LinearDensity.extra.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct LinearDensity - { - - /// Get from times . - public static Density operator /(LinearDensity linearDensity, Area area) - { - return Density.FromKilogramsPerCubicMeter(linearDensity.KilogramsPerMeter / area.SquareMeters); - } - - /// Get from times . - public static Area operator /(LinearDensity linearDensity, Density density) - { - return Area.FromSquareMeters(linearDensity.KilogramsPerMeter / density.KilogramsPerCubicMeter); - } - - /// Get from times . - public static Mass operator *(LinearDensity linearDensity, Length length) - { - return Mass.FromKilograms(linearDensity.KilogramsPerMeter * length.Meters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/Luminance.extra.cs b/UnitsNet/CustomCode/Quantities/Luminance.extra.cs deleted file mode 100644 index 25d59b34cc..0000000000 --- a/UnitsNet/CustomCode/Quantities/Luminance.extra.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct Luminance - { - /// Get from times . - public static LuminousIntensity operator *(Luminance luminance, Area area) - { - return LuminousIntensity.FromCandela(luminance.CandelasPerSquareMeter * area.SquareMeters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/LuminousIntensity.extra.cs b/UnitsNet/CustomCode/Quantities/LuminousIntensity.extra.cs deleted file mode 100644 index b2f5960f7b..0000000000 --- a/UnitsNet/CustomCode/Quantities/LuminousIntensity.extra.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct LuminousIntensity - { - /// Get from divided by . - public static Luminance operator /(LuminousIntensity luminousIntensity, Area area) - { - return Luminance.FromCandelasPerSquareMeter(luminousIntensity.Candela / area.SquareMeters); - } - - /// Get from divided by . - public static Area operator /(LuminousIntensity luminousIntensity, Luminance luminance) - { - return Area.FromSquareMeters(luminousIntensity.Candela / luminance.CandelasPerSquareMeter); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/Mass.extra.cs b/UnitsNet/CustomCode/Quantities/Mass.extra.cs index e82862fc21..906feca314 100644 --- a/UnitsNet/CustomCode/Quantities/Mass.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Mass.extra.cs @@ -45,72 +45,6 @@ public static Mass FromStonePounds(double stone, double pounds) { return FromPounds(StonesInOnePound*stone + pounds); } - - /// Get from divided by . - public static MassFlow operator /(Mass mass, TimeSpan timeSpan) - { - return MassFlow.FromKilogramsPerSecond(mass.Kilograms/timeSpan.TotalSeconds); - } - - /// Get from divided by . - public static MassFlow operator /(Mass mass, Duration duration) - { - return MassFlow.FromKilogramsPerSecond(mass.Kilograms/duration.Seconds); - } - - /// Get from divided by . - public static Density operator /(Mass mass, Volume volume) - { - return Density.FromKilogramsPerCubicMeter(mass.Kilograms/volume.CubicMeters); - } - - /// Get from divided by . - public static Volume operator /(Mass mass, Density density) - { - return Volume.FromCubicMeters(mass.Kilograms / density.KilogramsPerCubicMeter); - } - - /// Get from divided by . - public static AmountOfSubstance operator /(Mass mass, MolarMass molarMass) - { - return AmountOfSubstance.FromMoles(mass.Kilograms / molarMass.KilogramsPerMole); - } - - /// Get from divided by . - public static AreaDensity operator /(Mass mass, Area area) - { - return AreaDensity.FromKilogramsPerSquareMeter(mass.Kilograms / area.SquareMeters); - } - - /// Get from divided by . - public static Area operator /(Mass mass, AreaDensity areaDensity) - { - return Area.FromSquareMeters(mass.Kilograms / areaDensity.KilogramsPerSquareMeter); - } - - /// Get from times . - public static Force operator *(Mass mass, Acceleration acceleration) - { - return Force.FromNewtons(mass.Kilograms*acceleration.MetersPerSecondSquared); - } - - /// Get from times . - public static Force operator *(Acceleration acceleration, Mass mass) - { - return Force.FromNewtons(mass.Kilograms*acceleration.MetersPerSecondSquared); - } - - /// Get from times . - public static LinearDensity operator /(Mass mass, Length length) - { - return LinearDensity.FromKilogramsPerMeter(mass.Kilograms / length.Meters); - } - - /// Get from divided by . - public static Length operator /(Mass mass, LinearDensity linearDensity) - { - return Length.FromMeters(mass.Kilograms / linearDensity.KilogramsPerMeter); - } } /// diff --git a/UnitsNet/CustomCode/Quantities/MassConcentration.extra.cs b/UnitsNet/CustomCode/Quantities/MassConcentration.extra.cs index 3e02c6e53d..569c228523 100644 --- a/UnitsNet/CustomCode/Quantities/MassConcentration.extra.cs +++ b/UnitsNet/CustomCode/Quantities/MassConcentration.extra.cs @@ -43,34 +43,5 @@ public static MassConcentration FromVolumeConcentration(VolumeConcentration volu } #endregion - - #region Operators - - /// Get from times . - public static Mass operator *(MassConcentration density, Volume volume) - { - return Mass.FromKilograms(density.KilogramsPerCubicMeter * volume.CubicMeters); - } - - /// Get from times . - public static Mass operator *(Volume volume, MassConcentration density) - { - return Mass.FromKilograms(density.KilogramsPerCubicMeter * volume.CubicMeters); - } - - /// Get from divided by the component's . - public static Molarity operator /(MassConcentration massConcentration, MolarMass componentMass) - { - return Molarity.FromMolesPerCubicMeter(massConcentration.GramsPerCubicMeter / componentMass.GramsPerMole); - } - - /// Get from divided by the component's . - public static VolumeConcentration operator /(MassConcentration massConcentration, Density componentDensity) - { - return VolumeConcentration.FromDecimalFractions(massConcentration.KilogramsPerCubicMeter / componentDensity.KilogramsPerCubicMeter); - } - - #endregion - } } diff --git a/UnitsNet/CustomCode/Quantities/MassFlow.extra.cs b/UnitsNet/CustomCode/Quantities/MassFlow.extra.cs deleted file mode 100644 index 47ed64f065..0000000000 --- a/UnitsNet/CustomCode/Quantities/MassFlow.extra.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct MassFlow - { - /// Get from times . - public static Mass operator *(MassFlow massFlow, TimeSpan time) - { - return Mass.FromKilograms(massFlow.KilogramsPerSecond * time.TotalSeconds); - } - - /// Get from times . - public static Mass operator *(TimeSpan time, MassFlow massFlow) - { - return Mass.FromKilograms(massFlow.KilogramsPerSecond * time.TotalSeconds); - } - - /// Get from times . - public static Mass operator *(MassFlow massFlow, Duration duration) - { - return Mass.FromKilograms(massFlow.KilogramsPerSecond * duration.Seconds); - } - - /// Get from times . - public static Mass operator *(Duration duration, MassFlow massFlow) - { - return Mass.FromKilograms(massFlow.KilogramsPerSecond * duration.Seconds); - } - - /// Get from divided by . - public static Power operator /(MassFlow massFlow, BrakeSpecificFuelConsumption bsfc) - { - return Power.FromWatts(massFlow.KilogramsPerSecond / bsfc.KilogramsPerJoule); - } - - /// Get from divided by . - public static BrakeSpecificFuelConsumption operator /(MassFlow massFlow, Power power) - { - return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(massFlow.KilogramsPerSecond / (double)power.Watts); - } - - /// Get from times . - public static Power operator *(MassFlow massFlow, SpecificEnergy specificEnergy) - { - return Power.FromWatts(massFlow.KilogramsPerSecond * specificEnergy.JoulesPerKilogram); - } - - /// Get from divided by . - public static MassFlux operator /(MassFlow massFlow, Area area) - { - return MassFlux.FromKilogramsPerSecondPerSquareMeter(massFlow.KilogramsPerSecond / area.SquareMeters); - } - - /// Get from divided by . - public static Area operator /(MassFlow massFlow, MassFlux massFlux) - { - return Area.FromSquareMeters(massFlow.KilogramsPerSecond / massFlux.KilogramsPerSecondPerSquareMeter); - } - - /// Get from divided by . - public static Density operator /(MassFlow massFlow, VolumeFlow volumeFlow) - { - return Density.FromKilogramsPerCubicMeter(massFlow.KilogramsPerSecond / volumeFlow.CubicMetersPerSecond); - } - - /// Get from divided by . - public static VolumeFlow operator /(MassFlow massFlow, Density density) - { - return VolumeFlow.FromCubicMetersPerSecond(massFlow.KilogramsPerSecond / density.KilogramsPerCubicMeter); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/MassFlux.extra.cs b/UnitsNet/CustomCode/Quantities/MassFlux.extra.cs deleted file mode 100644 index 654ce48a20..0000000000 --- a/UnitsNet/CustomCode/Quantities/MassFlux.extra.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct MassFlux - { - /// Get from divided by . - public static Density operator /(MassFlux massFlux, Speed speed) - { - return Density.FromKilogramsPerCubicMeter(massFlux.KilogramsPerSecondPerSquareMeter / speed.MetersPerSecond); - } - - /// Get from divided by . - public static Speed operator /(MassFlux massFlux, Density density) - { - return Speed.FromMetersPerSecond(massFlux.KilogramsPerSecondPerSquareMeter / density.KilogramsPerCubicMeter); - } - - /// Get from times . - public static MassFlow operator *(MassFlux massFlux, Area area) - { - return MassFlow.FromGramsPerSecond(massFlux.GramsPerSecondPerSquareMeter * area.SquareMeters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/MassFraction.extra.cs b/UnitsNet/CustomCode/Quantities/MassFraction.extra.cs index c685887214..bf504e94cb 100644 --- a/UnitsNet/CustomCode/Quantities/MassFraction.extra.cs +++ b/UnitsNet/CustomCode/Quantities/MassFraction.extra.cs @@ -11,7 +11,7 @@ public partial struct MassFraction /// The actual mass of the component involved in this mixture public Mass GetComponentMass(Mass totalMass) { - return totalMass * this; + return this * totalMass; } /// @@ -35,23 +35,6 @@ public static MassFraction FromMasses(Mass componentMass, Mass mixtureMass) } #endregion - - /// Get from multiplied by a . - public static Mass operator *(MassFraction massFraction, Mass mass) - { - return Mass.FromKilograms(massFraction.DecimalFractions * mass.Kilograms); - } - - /// Get from multiplied by a . - public static Mass operator *(Mass mass, MassFraction massFraction) - { - return Mass.FromKilograms(massFraction.DecimalFractions * mass.Kilograms); - } - /// Get the total by dividing the component by a . - public static Mass operator /(Mass mass, MassFraction massFraction) - { - return Mass.FromKilograms(mass.Kilograms / massFraction.DecimalFractions); - } - + } } diff --git a/UnitsNet/CustomCode/Quantities/MolarFlow.extra.cs b/UnitsNet/CustomCode/Quantities/MolarFlow.extra.cs deleted file mode 100644 index 9a69147ce3..0000000000 --- a/UnitsNet/CustomCode/Quantities/MolarFlow.extra.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; - -namespace UnitsNet -{ - public partial struct MolarFlow - { - /// Get from times . - public static AmountOfSubstance operator *(MolarFlow molarFlow, TimeSpan timeSpan) - { - return AmountOfSubstance.FromKilomoles(molarFlow.KilomolesPerSecond * timeSpan.TotalSeconds); - } - - /// Get from times . - public static AmountOfSubstance operator *(MolarFlow molarFlow, Duration duration) - { - return AmountOfSubstance.FromKilomoles(molarFlow.KilomolesPerSecond * duration.Seconds); - } - - /// Get from times . - public static MassFlow operator *(MolarFlow molarFlow, MolarMass molecularWeight) - { - return MassFlow.FromKilogramsPerSecond(molarFlow.KilomolesPerSecond * molecularWeight.KilogramsPerKilomole); - } - - /// Get from divided by . - public static VolumeFlow operator /(MolarFlow molarFlow, Molarity molarity) - { - return VolumeFlow.FromCubicMetersPerSecond(molarFlow.KilomolesPerSecond / molarity.KilomolesPerCubicMeter); - } - - } -} diff --git a/UnitsNet/CustomCode/Quantities/Molarity.extra.cs b/UnitsNet/CustomCode/Quantities/Molarity.extra.cs index 05bad46e43..32203f21f7 100644 --- a/UnitsNet/CustomCode/Quantities/Molarity.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Molarity.extra.cs @@ -38,34 +38,5 @@ public static Molarity FromVolumeConcentration(VolumeConcentration volumeConcent } #endregion - - #region Operators - - /// Get from times the . - public static MassConcentration operator *(Molarity molarity, MolarMass componentMass) - { - return MassConcentration.FromGramsPerCubicMeter(molarity.MolesPerCubicMeter * componentMass.GramsPerMole); - } - - /// Get from times the . - public static MassConcentration operator *(MolarMass componentMass, Molarity molarity) - { - return MassConcentration.FromGramsPerCubicMeter(molarity.MolesPerCubicMeter * componentMass.GramsPerMole); - } - - /// Get from diluting the current by the given . - public static Molarity operator *(Molarity molarity, VolumeConcentration volumeConcentration) - { - return new Molarity(molarity.MolesPerCubicMeter * volumeConcentration.DecimalFractions, MolarityUnit.MolePerCubicMeter); - } - - /// Get from diluting the current by the given . - public static Molarity operator *(VolumeConcentration volumeConcentration, Molarity molarity) - { - return new Molarity(molarity.MolesPerCubicMeter * volumeConcentration.DecimalFractions, MolarityUnit.MolePerCubicMeter); - } - - #endregion - } } diff --git a/UnitsNet/CustomCode/Quantities/Power.extra.cs b/UnitsNet/CustomCode/Quantities/Power.extra.cs index 562192b2f4..b16eec0c63 100644 --- a/UnitsNet/CustomCode/Quantities/Power.extra.cs +++ b/UnitsNet/CustomCode/Quantities/Power.extra.cs @@ -20,91 +20,5 @@ public PowerRatio ToPowerRatio() { return PowerRatio.FromPower(this); } - - /// Get from times . - public static Energy operator *(Power power, TimeSpan time) - { - return Energy.FromJoules((double)power.Watts * time.TotalSeconds); - } - - /// Get from times . - public static Energy operator *(TimeSpan time, Power power) - { - return Energy.FromJoules((double)power.Watts * time.TotalSeconds); - } - - /// Get from times . - public static Energy operator *(Power power, Duration duration) - { - return Energy.FromJoules((double)power.Watts * duration.Seconds); - } - - /// Get from times . - public static Energy operator *(Duration duration, Power power) - { - return Energy.FromJoules((double)power.Watts * duration.Seconds); - } - - /// Get from divided by . - public static Force operator /(Power power, Speed speed) - { - return Force.FromNewtons((double)power.Watts / speed.MetersPerSecond); - } - - /// Get from divided by . - public static Torque operator /(Power power, RotationalSpeed rotationalSpeed) - { - return Torque.FromNewtonMeters((double)power.Watts / rotationalSpeed.RadiansPerSecond); - } - - /// Get from divided by . - public static RotationalSpeed operator /(Power power, Torque torque) - { - return RotationalSpeed.FromRadiansPerSecond((double)power.Watts / torque.NewtonMeters); - } - - /// Get from times . - public static MassFlow operator *(Power power, BrakeSpecificFuelConsumption bsfc) - { - return MassFlow.FromKilogramsPerSecond(bsfc.KilogramsPerJoule * (double)power.Watts); - } - - /// Get from divided by . - public static SpecificEnergy operator /(Power power, MassFlow massFlow) - { - return SpecificEnergy.FromJoulesPerKilogram((double)power.Watts / massFlow.KilogramsPerSecond); - } - - /// Get from divided by . - public static MassFlow operator /(Power power, SpecificEnergy specificEnergy) - { - return MassFlow.FromKilogramsPerSecond((double)power.Watts / specificEnergy.JoulesPerKilogram); - } - - /// Get from divided by . - public static HeatFlux operator /(Power power, Area area) - { - return HeatFlux.FromWattsPerSquareMeter((double)power.Watts / area.SquareMeters); - } - - /// Get from divided by . - public static Area operator /(Power power, HeatFlux heatFlux) - { - return Area.FromSquareMeters((double)power.Watts / heatFlux.WattsPerSquareMeter ); - } - - /// Calculate from divided by . - /// Electric power is defined as P = U * I, so I = P / U. - public static ElectricCurrent operator /(Power power, ElectricPotential potential) - { - return ElectricCurrent.FromAmperes((double)power.Watts / potential.Volts); - } - - /// Calculate from divided by . - /// Electric power is defined as P = U * I, so I = P / U. - public static ElectricPotential operator /(Power power, ElectricCurrent current) - { - return ElectricPotential.FromVolts((double)power.Watts / current.Amperes); - } } } diff --git a/UnitsNet/CustomCode/Quantities/Pressure.extra.cs b/UnitsNet/CustomCode/Quantities/Pressure.extra.cs deleted file mode 100644 index 259771f8dc..0000000000 --- a/UnitsNet/CustomCode/Quantities/Pressure.extra.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct Pressure - { - /// Get from times . - public static Force operator *(Pressure pressure, Area area) - { - return Force.FromNewtons(pressure.Pascals * area.SquareMeters); - } - - /// Get from times . - public static Force operator *(Area area, Pressure pressure) - { - return Force.FromNewtons(pressure.Pascals * area.SquareMeters); - } - - /// Get from divided by . - public static Length operator /(Pressure pressure, SpecificWeight specificWeight) - { - return new Length(pressure.Pascals / specificWeight.NewtonsPerCubicMeter, UnitsNet.Units.LengthUnit.Meter); - } - - /// Get from divided by . - public static SpecificWeight operator /(Pressure pressure, Length length) - { - return new SpecificWeight(pressure.Pascals / length.Meters, UnitsNet.Units.SpecificWeightUnit.NewtonPerCubicMeter); - } - - /// Get from divided by . - public static ForcePerLength operator /(Pressure pressure, ReciprocalLength reciprocalLength) - { - return new ForcePerLength(pressure.Pascals / reciprocalLength.InverseMeters, UnitsNet.Units.ForcePerLengthUnit.NewtonPerMeter); - } - - /// Get from divided by . - public static Force operator /(Pressure pressure, ReciprocalArea reciprocalArea) - { - return new Force(pressure.Pascals / reciprocalArea.InverseSquareMeters, UnitsNet.Units.ForceUnit.Newton); - } - - /// Get from divided by - public static PressureChangeRate operator /(Pressure pressure, TimeSpan timeSpan) - { - return new PressureChangeRate(pressure.Pascals / timeSpan.TotalSeconds , UnitsNet.Units.PressureChangeRateUnit.PascalPerSecond); - } - - /// Get from divided by - public static PressureChangeRate operator /(Pressure pressure, Duration duration) - { - return new PressureChangeRate(pressure.Pascals / duration.Seconds, UnitsNet.Units.PressureChangeRateUnit.PascalPerSecond); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/PressureChangeRate.extra.cs b/UnitsNet/CustomCode/Quantities/PressureChangeRate.extra.cs deleted file mode 100644 index 1d2359459e..0000000000 --- a/UnitsNet/CustomCode/Quantities/PressureChangeRate.extra.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct PressureChangeRate - { - /// Get from times - public static Pressure operator *(PressureChangeRate pressureChangeRate, TimeSpan timeSpan) - { - return new Pressure(pressureChangeRate.PascalsPerSecond * timeSpan.TotalSeconds , UnitsNet.Units.PressureUnit.Pascal); - } - - /// Get from times - public static Pressure operator *(PressureChangeRate pressureChangeRate, Duration duration) - { - return new Pressure(pressureChangeRate.PascalsPerSecond * duration.Seconds, UnitsNet.Units.PressureUnit.Pascal); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/ReciprocalArea.extra.cs b/UnitsNet/CustomCode/Quantities/ReciprocalArea.extra.cs deleted file mode 100644 index 067fd556f0..0000000000 --- a/UnitsNet/CustomCode/Quantities/ReciprocalArea.extra.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using UnitsNet.Units; - -namespace UnitsNet -{ - public partial struct ReciprocalArea - { - /// - /// Calculates the inverse of this quantity. - /// - /// The corresponding inverse quantity, . - public Area Inverse() - { - if (InverseSquareMeters == 0.0) - return new Area(0.0, AreaUnit.SquareMeter); - - return new Area(1 / InverseSquareMeters, AreaUnit.SquareMeter); - } - - /// Get from multiplied by . - public static Pressure operator *(ReciprocalArea reciprocalArea, Force force) - { - return Pressure.FromNewtonsPerSquareMeter(reciprocalArea.InverseSquareMeters * force.Newtons); - } - - /// Get from multiplied by . - public static Ratio operator *(ReciprocalArea reciprocalArea, Area area) - { - return new Ratio(reciprocalArea.InverseSquareMeters * area.SquareMeters, RatioUnit.DecimalFraction); - } - - /// Get from divided by . - public static ReciprocalLength operator /(ReciprocalArea reciprocalArea, ReciprocalLength reciprocalLength) - { - return ReciprocalLength.FromInverseMeters(reciprocalArea.InverseSquareMeters / reciprocalLength.InverseMeters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/ReciprocalLength.extra.cs b/UnitsNet/CustomCode/Quantities/ReciprocalLength.extra.cs deleted file mode 100644 index caf649773c..0000000000 --- a/UnitsNet/CustomCode/Quantities/ReciprocalLength.extra.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using UnitsNet.Units; - -namespace UnitsNet -{ - public partial struct ReciprocalLength - { - /// - /// Calculates the inverse of this quantity. - /// - /// The corresponding inverse quantity, . - public Length Inverse() - { - if (InverseMeters == 0.0) - return new Length(0.0, LengthUnit.Meter); - - return new Length(1 / InverseMeters, LengthUnit.Meter); - } - - /// Get from multiplied by . - public static Pressure operator *(ReciprocalLength reciprocalLength, ForcePerLength forcePerLength) - { - return Pressure.FromNewtonsPerSquareMeter(reciprocalLength.InverseMeters * forcePerLength.NewtonsPerMeter); - } - - /// Get from times . - public static ForcePerLength operator *(ReciprocalLength reciprocalLength, Force force) - { - return ForcePerLength.FromNewtonsPerMeter(reciprocalLength.InverseMeters * force.Newtons); - } - - /// Get from times . - public static ReciprocalArea operator *(ReciprocalLength reciprocalLength, ReciprocalLength other) - { - return ReciprocalArea.FromInverseSquareMeters(reciprocalLength.InverseMeters * other.InverseMeters); - } - - /// Get from times . - public static Length operator /(ReciprocalLength reciprocalLength, ReciprocalArea reciprocalArea) - { - return Length.FromMeters(reciprocalLength.InverseMeters / reciprocalArea.InverseSquareMeters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/RotationalSpeed.extra.cs b/UnitsNet/CustomCode/Quantities/RotationalSpeed.extra.cs deleted file mode 100644 index a1f18c79cd..0000000000 --- a/UnitsNet/CustomCode/Quantities/RotationalSpeed.extra.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct RotationalSpeed - { - /// Get from times . - public static Angle operator *(RotationalSpeed rotationalSpeed, TimeSpan timeSpan) - { - return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * timeSpan.TotalSeconds); - } - - /// Get from times . - public static Angle operator *(TimeSpan timeSpan, RotationalSpeed rotationalSpeed) - { - return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * timeSpan.TotalSeconds); - } - - /// Get from times . - public static Angle operator *(RotationalSpeed rotationalSpeed, Duration duration) - { - return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * duration.Seconds); - } - - /// Get from times . - public static Angle operator *(Duration duration, RotationalSpeed rotationalSpeed) - { - return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * duration.Seconds); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/RotationalStiffness.extra.cs b/UnitsNet/CustomCode/Quantities/RotationalStiffness.extra.cs deleted file mode 100644 index 48b9342455..0000000000 --- a/UnitsNet/CustomCode/Quantities/RotationalStiffness.extra.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct RotationalStiffness - { - /// Get from times . - public static Torque operator *(RotationalStiffness rotationalStiffness, Angle angle) - { - return Torque.FromNewtonMeters(rotationalStiffness.NewtonMetersPerRadian * angle.Radians); - } - - /// Get from divided by . - public static RotationalStiffnessPerLength operator /(RotationalStiffness rotationalStiffness, Length length) - { - return RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(rotationalStiffness.NewtonMetersPerRadian / length.Meters); - } - - /// Get from divided by . - public static Length operator /(RotationalStiffness rotationalStiffness, RotationalStiffnessPerLength rotationalStiffnessPerLength) - { - return Length.FromMeters(rotationalStiffness.NewtonMetersPerRadian / rotationalStiffnessPerLength.NewtonMetersPerRadianPerMeter); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs b/UnitsNet/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs deleted file mode 100644 index 1aef772c05..0000000000 --- a/UnitsNet/CustomCode/Quantities/RotationalStiffnessPerLength.extra.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -// ReSharper disable once CheckNamespace -namespace UnitsNet -{ - public partial struct RotationalStiffnessPerLength - { - /// Get from times . - public static RotationalStiffness operator *(RotationalStiffnessPerLength rotationalStiffness, Length length) - { - return RotationalStiffness.FromNewtonMetersPerRadian(rotationalStiffness.NewtonMetersPerRadianPerMeter * length.Meters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/SpecificEnergy.extra.cs b/UnitsNet/CustomCode/Quantities/SpecificEnergy.extra.cs deleted file mode 100644 index d90dcf8de5..0000000000 --- a/UnitsNet/CustomCode/Quantities/SpecificEnergy.extra.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct SpecificEnergy - { - /// Get from times . - public static Energy operator *(SpecificEnergy specificEnergy, Mass mass) - { - return Energy.FromJoules(specificEnergy.JoulesPerKilogram * mass.Kilograms); - } - - /// Get from times . - public static Energy operator *(Mass mass, SpecificEnergy specificEnergy) - { - return Energy.FromJoules(specificEnergy.JoulesPerKilogram * mass.Kilograms); - } - - /// Get from divided by . - public static BrakeSpecificFuelConsumption operator /(double value, SpecificEnergy specificEnergy) - { - return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(value / specificEnergy.JoulesPerKilogram); - } - - /// Get from times . - public static double operator *(SpecificEnergy specificEnergy, BrakeSpecificFuelConsumption bsfc) - { - return specificEnergy.JoulesPerKilogram * bsfc.KilogramsPerJoule; - } - - /// Get from times . - public static Power operator *(SpecificEnergy specificEnergy, MassFlow massFlow) - { - return Power.FromWatts(massFlow.KilogramsPerSecond * specificEnergy.JoulesPerKilogram); - } - - /// Get from divided by . - public static SpecificEntropy operator /(SpecificEnergy specificEnergy, TemperatureDelta temperatureDelta) - { - return SpecificEntropy.FromJoulesPerKilogramKelvin(specificEnergy.JoulesPerKilogram / temperatureDelta.Kelvins); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/SpecificEntropy.extra.cs b/UnitsNet/CustomCode/Quantities/SpecificEntropy.extra.cs deleted file mode 100644 index 96b2f1e58e..0000000000 --- a/UnitsNet/CustomCode/Quantities/SpecificEntropy.extra.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct SpecificEntropy - { - /// Get from times . - public static Entropy operator *(SpecificEntropy specificEntropy, Mass mass) - { - return Entropy.FromJoulesPerKelvin(specificEntropy.JoulesPerKilogramKelvin * mass.Kilograms); - } - - /// Get from times . - public static Entropy operator *(Mass mass, SpecificEntropy specificEntropy) - { - return Entropy.FromJoulesPerKelvin(specificEntropy.JoulesPerKilogramKelvin * mass.Kilograms); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/SpecificVolume.extra.cs b/UnitsNet/CustomCode/Quantities/SpecificVolume.extra.cs deleted file mode 100644 index f284f8bb28..0000000000 --- a/UnitsNet/CustomCode/Quantities/SpecificVolume.extra.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct SpecificVolume - { - /// Get from divided by . - public static Density operator /(double constant, SpecificVolume volume) - { - return Density.FromKilogramsPerCubicMeter(constant / volume.CubicMetersPerKilogram); - } - - /// Get from times . - public static Volume operator *(SpecificVolume volume, Mass mass) - { - return Volume.FromCubicMeters(volume.CubicMetersPerKilogram * mass.Kilograms); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/SpecificWeight.extra.cs b/UnitsNet/CustomCode/Quantities/SpecificWeight.extra.cs deleted file mode 100644 index 0a6bd6e6d9..0000000000 --- a/UnitsNet/CustomCode/Quantities/SpecificWeight.extra.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using UnitsNet.Units; - -namespace UnitsNet -{ - public partial struct SpecificWeight - { - /// Get from times . - public static Pressure operator *(SpecificWeight specificWeight, Length length) - { - return new Pressure(specificWeight.NewtonsPerCubicMeter * length.Meters, PressureUnit.Pascal); - } - - /// Get from times . - public static ForcePerLength operator *(SpecificWeight specificWeight, Area area) - { - return new ForcePerLength(specificWeight.NewtonsPerCubicMeter * area.SquareMeters, ForcePerLengthUnit.NewtonPerMeter); - } - - /// Get from times . - public static ForcePerLength operator *(Area area, SpecificWeight specificWeight) - { - return new ForcePerLength(area.SquareMeters * specificWeight.NewtonsPerCubicMeter, ForcePerLengthUnit.NewtonPerMeter); - } - - /// Get from divided by . - public static Acceleration operator /(SpecificWeight specificWeight, Density density) - { - return new Acceleration(specificWeight.NewtonsPerCubicMeter / density.KilogramsPerCubicMeter, AccelerationUnit.MeterPerSecondSquared); - } - - /// Get from divided by . - public static Density operator /(SpecificWeight specific, Acceleration acceleration) - { - return new Density(specific.NewtonsPerCubicMeter / acceleration.MetersPerSecondSquared, DensityUnit.KilogramPerCubicMeter); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/Speed.extra.cs b/UnitsNet/CustomCode/Quantities/Speed.extra.cs deleted file mode 100644 index b46031ab8d..0000000000 --- a/UnitsNet/CustomCode/Quantities/Speed.extra.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct Speed - { - /// Get from divided by . - public static Acceleration operator /(Speed speed, TimeSpan timeSpan) - { - return Acceleration.FromMetersPerSecondSquared(speed.MetersPerSecond / timeSpan.TotalSeconds); - } - - /// Get from times . - public static Length operator *(Speed speed, TimeSpan timeSpan) - { - return Length.FromMeters(speed.MetersPerSecond * timeSpan.TotalSeconds); - } - - /// Get from times . - public static Length operator *(TimeSpan timeSpan, Speed speed) - { - return Length.FromMeters(speed.MetersPerSecond * timeSpan.TotalSeconds); - } - - /// Get from divided by . - public static Acceleration operator /(Speed speed, Duration duration) - { - return Acceleration.FromMetersPerSecondSquared(speed.MetersPerSecond / duration.Seconds); - } - - /// Get from divided by . - public static Duration operator /(Speed speed, Acceleration acceleration) - { - return Duration.FromSeconds(speed.MetersPerSecond / acceleration.MetersPerSecondSquared); - } - - /// Get from times . - public static Length operator *(Speed speed, Duration duration) - { - return Length.FromMeters(speed.MetersPerSecond * duration.Seconds); - } - - /// Get from times . - public static Length operator *(Duration duration, Speed speed) - { - return Length.FromMeters(speed.MetersPerSecond * duration.Seconds); - } - - /// Get from times . - public static KinematicViscosity operator *(Speed speed, Length length) - { - return KinematicViscosity.FromSquareMetersPerSecond(length.Meters * speed.MetersPerSecond); - } - - /// Get from times . - public static SpecificEnergy operator *(Speed left, Speed right) - { - return SpecificEnergy.FromJoulesPerKilogram(left.MetersPerSecond * right.MetersPerSecond); - } - - /// Get from times . - public static MassFlux operator *(Speed speed, Density density) - { - return MassFlux.FromKilogramsPerSecondPerSquareMeter(speed.MetersPerSecond * density.KilogramsPerCubicMeter); - } - - /// Get from times . - public static VolumeFlow operator *(Speed speed, Area area) - { - return VolumeFlow.FromCubicMetersPerSecond(speed.MetersPerSecond * area.SquareMeters); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/TemperatureChangeRate.extra.cs b/UnitsNet/CustomCode/Quantities/TemperatureChangeRate.extra.cs deleted file mode 100644 index 04f36df7bf..0000000000 --- a/UnitsNet/CustomCode/Quantities/TemperatureChangeRate.extra.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct TemperatureChangeRate - { - /// Get from times . - public static TemperatureDelta operator *(Duration left, TemperatureChangeRate right) => right * left; - - /// Get from times . - public static TemperatureDelta operator *(TemperatureChangeRate left, Duration right) - { - return TemperatureDelta.FromDegreesCelsius(left.DegreesCelsiusPerSecond * right.Seconds); - } - - - /// Get from times . - public static TemperatureDelta operator *(TimeSpan left, TemperatureChangeRate right) => right * left; - - /// Get from times . - public static TemperatureDelta operator *(TemperatureChangeRate left, TimeSpan right) - { - return TemperatureDelta.FromDegreesCelsius(left.DegreesCelsiusPerSecond * right.TotalSeconds); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs b/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs deleted file mode 100644 index e126f14d29..0000000000 --- a/UnitsNet/CustomCode/Quantities/TemperatureDelta.extra.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct TemperatureDelta - { - /// Get from divided by . - public static TemperatureGradient operator /(TemperatureDelta left, Length right) - { - return TemperatureGradient.FromKelvinsPerMeter(left.Kelvins / right.Meters); - } - - /// Get from times . - public static SpecificEnergy operator *(SpecificEntropy specificEntropy, TemperatureDelta temperatureDelta) - { - return SpecificEnergy.FromJoulesPerKilogram(specificEntropy.JoulesPerKilogramKelvin * temperatureDelta.Kelvins); - } - - /// Get from times . - public static SpecificEnergy operator *(TemperatureDelta temperatureDelta, SpecificEntropy specificEntropy) - { - return specificEntropy * temperatureDelta; - } - - /// Get from times . - public static Energy operator *(Entropy entropy, TemperatureDelta temperatureDelta) - { - return Energy.FromJoules(entropy.JoulesPerKelvin * temperatureDelta.Kelvins); - } - - /// Get from times . - public static Energy operator *(TemperatureDelta temperatureDelta, Entropy entropy) - { - return Energy.FromJoules(entropy.JoulesPerKelvin * temperatureDelta.Kelvins); - } - - /// Get a scalar from a multiplied by a . - public static double operator *(TemperatureDelta temperatureDelta, CoefficientOfThermalExpansion cte) - { - return temperatureDelta.Kelvins * cte.PerKelvin; - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/TemperatureGradient.extra.cs b/UnitsNet/CustomCode/Quantities/TemperatureGradient.extra.cs deleted file mode 100644 index c6d5d087c7..0000000000 --- a/UnitsNet/CustomCode/Quantities/TemperatureGradient.extra.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct TemperatureGradient - { - /// Get from divided by . - public static Length operator /(TemperatureDelta left, TemperatureGradient right) - { - return Length.FromKilometers(left.Kelvins / right.DegreesCelciusPerKilometer); - } - - /// Get from times . - public static TemperatureDelta operator *(Length left, TemperatureGradient right) => right * left; - - /// Get from times . - public static TemperatureDelta operator *(TemperatureGradient left, Length right) - { - return TemperatureDelta.FromDegreesCelsius(left.DegreesCelciusPerKilometer * right.Kilometers); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/Torque.extra.cs b/UnitsNet/CustomCode/Quantities/Torque.extra.cs deleted file mode 100644 index 26bd4f551b..0000000000 --- a/UnitsNet/CustomCode/Quantities/Torque.extra.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -namespace UnitsNet -{ - public partial struct Torque - { - /// Get from times . - public static Force operator /(Torque torque, Length length) - { - return Force.FromNewtons(torque.NewtonMeters / length.Meters); - } - - /// Get from times . - public static Length operator /(Torque torque, Force force) - { - return Length.FromMeters(torque.NewtonMeters / force.Newtons); - } - - /// Get from times . - public static RotationalStiffness operator /(Torque torque, Angle angle) - { - return RotationalStiffness.FromNewtonMetersPerRadian(torque.NewtonMeters / angle.Radians); - } - - /// Get from times . - public static Angle operator /(Torque torque, RotationalStiffness rotationalStiffness) - { - return Angle.FromRadians(torque.NewtonMeters / rotationalStiffness.NewtonMetersPerRadian); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/Volume.extra.cs b/UnitsNet/CustomCode/Quantities/Volume.extra.cs deleted file mode 100644 index aab43915a4..0000000000 --- a/UnitsNet/CustomCode/Quantities/Volume.extra.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct Volume - { - /// Get from divided by . - public static Area operator /(Volume volume, Length length) - { - return Area.FromSquareMeters(volume.CubicMeters / length.Meters); - } - - /// Get from divided by . - public static Length operator /(Volume volume, Area area) - { - return Length.FromMeters(volume.CubicMeters / area.SquareMeters); - } - - /// Get from divided by . - public static VolumeFlow operator /(Volume volume, Duration duration) - { - return VolumeFlow.FromCubicMetersPerSecond(volume.CubicMeters / duration.Seconds); - } - - /// Get from divided by . - public static VolumeFlow operator /(Volume volume, TimeSpan timeSpan) - { - return VolumeFlow.FromCubicMetersPerSecond(volume.CubicMeters / timeSpan.TotalSeconds); - } - - /// Get from divided by . - public static TimeSpan operator /(Volume volume, VolumeFlow volumeFlow) - { - return TimeSpan.FromSeconds(volume.CubicMeters / volumeFlow.CubicMetersPerSecond); - } - } -} diff --git a/UnitsNet/CustomCode/Quantities/VolumeConcentration.extra.cs b/UnitsNet/CustomCode/Quantities/VolumeConcentration.extra.cs index fed1b0ca30..205acf77e3 100644 --- a/UnitsNet/CustomCode/Quantities/VolumeConcentration.extra.cs +++ b/UnitsNet/CustomCode/Quantities/VolumeConcentration.extra.cs @@ -47,22 +47,5 @@ public static VolumeConcentration FromMolarity(Molarity molarity, Density compon } #endregion - - #region Operators - - /// Get from times the component . - public static MassConcentration operator *(VolumeConcentration volumeConcentration, Density componentDensity) - { - return MassConcentration.FromKilogramsPerCubicMeter(volumeConcentration.DecimalFractions * componentDensity.KilogramsPerCubicMeter); - } - - /// Get from times the component . - public static MassConcentration operator *(Density componentDensity, VolumeConcentration volumeConcentration) - { - return MassConcentration.FromKilogramsPerCubicMeter(volumeConcentration.DecimalFractions * componentDensity.KilogramsPerCubicMeter); - } - - #endregion - } } diff --git a/UnitsNet/CustomCode/Quantities/VolumeFlow.extra.cs b/UnitsNet/CustomCode/Quantities/VolumeFlow.extra.cs deleted file mode 100644 index 51e71e8180..0000000000 --- a/UnitsNet/CustomCode/Quantities/VolumeFlow.extra.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Licensed under MIT No Attribution, see LICENSE file at the root. -// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. - -using System; - -namespace UnitsNet -{ - public partial struct VolumeFlow - { - /// Get from times . - public static Volume operator *(VolumeFlow volumeFlow, TimeSpan timeSpan) - { - return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * timeSpan.TotalSeconds); - } - - /// Get from times . - public static Volume operator *(VolumeFlow volumeFlow, Duration duration) - { - return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * duration.Seconds); - } - - /// Get from divided by . - public static Speed operator /(VolumeFlow volumeFlow, Area area) - { - return Speed.FromMetersPerSecond(volumeFlow.CubicMetersPerSecond / area.SquareMeters); - } - - /// Get from divided by . - public static Area operator /(VolumeFlow volumeFlow, Speed speed) - { - return Area.FromSquareMeters(volumeFlow.CubicMetersPerSecond / speed.MetersPerSecond); - } - - /// Get from times . - public static MassFlow operator *(VolumeFlow volumeFlow, Density density) - { - return MassFlow.FromKilogramsPerSecond(volumeFlow.CubicMetersPerSecond * density.KilogramsPerCubicMeter); - } - - /// Get from times . - public static MassFlow operator *(Density density, VolumeFlow volumeFlow) - { - return MassFlow.FromKilogramsPerSecond(volumeFlow.CubicMetersPerSecond * density.KilogramsPerCubicMeter); - } - } -} diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index ba700ce0a6..33ea7fac3d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.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,14 @@ namespace UnitsNet [DataContract] public readonly partial struct Acceleration : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IMultiplyOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -664,6 +675,52 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Accel #endregion + #region Relational Operators + + /// Get from * . + public static Force operator *(Acceleration acceleration, Mass mass) + { + return Force.FromNewtons(acceleration.MetersPerSecondSquared * mass.Kilograms); + } + + /// Get from * . + public static SpecificWeight operator *(Acceleration acceleration, Density density) + { + return SpecificWeight.FromNewtonsPerCubicMeter(acceleration.MetersPerSecondSquared * density.KilogramsPerCubicMeter); + } + + /// Get from * . + public static Speed operator *(Acceleration acceleration, Duration duration) + { + return Speed.FromMetersPerSecond(acceleration.MetersPerSecondSquared * duration.Seconds); + } + + /// Get from / . + public static Jerk operator /(Acceleration acceleration, Duration duration) + { + return Jerk.FromMetersPerSecondCubed(acceleration.MetersPerSecondSquared / duration.Seconds); + } + + /// Get from * . + public static Speed operator *(Acceleration acceleration, TimeSpan timeSpan) + { + return Speed.FromMetersPerSecond(acceleration.MetersPerSecondSquared * timeSpan.TotalSeconds); + } + + /// Get from * . + public static Speed operator *(TimeSpan timeSpan, Acceleration acceleration) + { + 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 /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 7c428ebd06..3dff1d8f94 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.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,11 @@ namespace UnitsNet [DataContract] public readonly partial struct AmountOfSubstance : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -718,6 +726,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Amoun #endregion + #region Relational Operators + + /// Get from * . + public static Mass operator *(AmountOfSubstance amountOfSubstance, MolarMass molarMass) + { + return Mass.FromGrams(amountOfSubstance.Moles * molarMass.GramsPerMole); + } + + /// Get from / . + public static Molarity operator /(AmountOfSubstance amountOfSubstance, Volume volume) + { + return Molarity.FromMolesPerCubicMeter(amountOfSubstance.Moles / volume.CubicMeters); + } + + /// Get from / . + public static Volume operator /(AmountOfSubstance amountOfSubstance, Molarity molarity) + { + return Volume.FromCubicMeters(amountOfSubstance.Moles / molarity.MolesPerCubicMeter); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index e1e19da154..5e0e731b3a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.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,11 @@ namespace UnitsNet [DataContract] public readonly partial struct Angle : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -700,6 +708,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Angle #endregion + #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 RotationalSpeed operator /(Angle angle, TimeSpan timeSpan) + { + return RotationalSpeed.FromRadiansPerSecond(angle.Radians / timeSpan.TotalSeconds); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 6c0b4d2bb2..5003390fc0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.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,20 @@ namespace UnitsNet [DataContract] public readonly partial struct Area : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -664,6 +681,89 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaU #endregion + #region Relational Operators + + /// Get from * . + public static Force operator *(Area area, Pressure pressure) + { + return Force.FromNewtons(area.SquareMeters * pressure.Pascals); + } + + /// Get from * . + public static ForcePerLength operator *(Area area, SpecificWeight specificWeight) + { + return ForcePerLength.FromNewtonsPerMeter(area.SquareMeters * specificWeight.NewtonsPerCubicMeter); + } + + /// Get from * . + public static LinearDensity operator *(Area area, Density density) + { + return LinearDensity.FromKilogramsPerMeter(area.SquareMeters * density.KilogramsPerCubicMeter); + } + + /// Get from * . + public static LuminousIntensity operator *(Area area, Luminance luminance) + { + return LuminousIntensity.FromCandela(area.SquareMeters * luminance.CandelasPerSquareMeter); + } + + /// Get from * . + public static Mass operator *(Area area, AreaDensity areaDensity) + { + return Mass.FromKilograms(area.SquareMeters * areaDensity.KilogramsPerSquareMeter); + } + + /// Get from * . + public static MassFlow operator *(Area area, MassFlux massFlux) + { + return MassFlow.FromGramsPerSecond(area.SquareMeters * massFlux.GramsPerSecondPerSquareMeter); + } + + /// Get from * . + public static Power operator *(Area area, HeatFlux heatFlux) + { + return Power.FromWatts(area.SquareMeters * heatFlux.WattsPerSquareMeter); + } + + /// Get from * . + public static Ratio operator *(Area area, ReciprocalArea reciprocalArea) + { + return Ratio.FromDecimalFractions(area.SquareMeters * reciprocalArea.InverseSquareMeters); + } + + /// Get from * . + public static Torque operator *(Area area, ForcePerLength forcePerLength) + { + return Torque.FromNewtonMeters(area.SquareMeters * forcePerLength.NewtonsPerMeter); + } + + /// Get from * . + public static Volume operator *(Area area, Length length) + { + return Volume.FromCubicMeters(area.SquareMeters * length.Meters); + } + + /// Get from * . + public static VolumeFlow operator *(Area area, Speed speed) + { + return VolumeFlow.FromCubicMetersPerSecond(area.SquareMeters * speed.MetersPerSecond); + } + + /// Get from / . + public static Length operator /(Area area, Length length) + { + return Length.FromMeters(area.SquareMeters / length.Meters); + } + + /// Calculates the inverse of this quantity. + /// The corresponding inverse quantity, . + public ReciprocalArea Inverse() + { + return SquareMeters == 0.0 ? ReciprocalArea.Zero : ReciprocalArea.FromInverseSquareMeters(1 / SquareMeters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index b1413377f3..29ad148ae0 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,9 @@ namespace UnitsNet [DataContract] public readonly partial struct AreaDensity : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -466,6 +472,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaD #endregion + #region Relational Operators + + /// Get from * . + public static Mass operator *(AreaDensity areaDensity, Area area) + { + return Mass.FromKilograms(areaDensity.KilogramsPerSquareMeter * area.SquareMeters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 5e99d19640..a120b4caf0 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,9 @@ namespace UnitsNet [DataContract] public readonly partial struct AreaMomentOfInertia : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -520,6 +526,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out AreaM #endregion + #region Relational Operators + + /// Get from / . + public static Volume operator /(AreaMomentOfInertia areaMomentOfInertia, Length length) + { + return Volume.FromCubicMeters(areaMomentOfInertia.MetersToTheFourth / length.Meters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index 9d44e789dd..aba75815ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.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 BrakeSpecificFuelConsumption : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -466,6 +473,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Brake #endregion + #region Relational Operators + + /// Get from * . + public static MassFlow operator *(BrakeSpecificFuelConsumption brakeSpecificFuelConsumption, Power power) + { + return MassFlow.FromKilogramsPerSecond(brakeSpecificFuelConsumption.KilogramsPerJoule * (double)power.Watts); + } + + /// Get from * . + public static double operator *(BrakeSpecificFuelConsumption brakeSpecificFuelConsumption, SpecificEnergy specificEnergy) + { + return brakeSpecificFuelConsumption.KilogramsPerJoule * specificEnergy.JoulesPerKilogram; + } + + /// Get from / . + public static SpecificEnergy operator /(double value, BrakeSpecificFuelConsumption brakeSpecificFuelConsumption) + { + return SpecificEnergy.FromJoulesPerKilogram(value / brakeSpecificFuelConsumption.KilogramsPerJoule); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs index fb3f68cec8..f54b257578 100644 --- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,9 @@ namespace UnitsNet [DataContract] public readonly partial struct CoefficientOfThermalExpansion : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -580,6 +586,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Coeff #endregion + #region Relational Operators + + /// Get from * . + public static double operator *(CoefficientOfThermalExpansion coefficientOfThermalExpansion, TemperatureDelta temperatureDelta) + { + return coefficientOfThermalExpansion.PerKelvin * temperatureDelta.Kelvins; + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 82c1a71798..4c7ee1be3c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.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; @@ -41,6 +44,15 @@ namespace UnitsNet [DataContract] public readonly partial struct Density : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -1387,6 +1399,52 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Densi #endregion + #region Relational Operators + + /// Get from * . + public static DynamicViscosity operator *(Density density, KinematicViscosity kinematicViscosity) + { + return DynamicViscosity.FromNewtonSecondsPerMeterSquared(density.KilogramsPerCubicMeter * kinematicViscosity.SquareMetersPerSecond); + } + + /// Get from * . + public static LinearDensity operator *(Density density, Area area) + { + return LinearDensity.FromKilogramsPerMeter(density.KilogramsPerCubicMeter * area.SquareMeters); + } + + /// Get from * . + public static Mass operator *(Density density, Volume volume) + { + return Mass.FromKilograms(density.KilogramsPerCubicMeter * volume.CubicMeters); + } + + /// Get from * . + public static MassConcentration operator *(Density density, VolumeConcentration volumeConcentration) + { + return MassConcentration.FromKilogramsPerCubicMeter(density.KilogramsPerCubicMeter * volumeConcentration.DecimalFractions); + } + + /// Get from * . + public static MassFlow operator *(Density density, VolumeFlow volumeFlow) + { + return MassFlow.FromKilogramsPerSecond(density.KilogramsPerCubicMeter * volumeFlow.CubicMetersPerSecond); + } + + /// Get from * . + public static MassFlux operator *(Density density, Speed speed) + { + return MassFlux.FromKilogramsPerSecondPerSquareMeter(density.KilogramsPerCubicMeter * speed.MetersPerSecond); + } + + /// Get from * . + public static SpecificWeight operator *(Density density, Acceleration acceleration) + { + return SpecificWeight.FromNewtonsPerCubicMeter(density.KilogramsPerCubicMeter * acceleration.MetersPerSecondSquared); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index b7d437df45..3d4ae1465e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.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,21 @@ namespace UnitsNet [DataContract] public readonly partial struct Duration : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -610,6 +628,88 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Durat #endregion + #region Relational Operators + + /// Get from * . + public static AmountOfSubstance operator *(Duration duration, MolarFlow molarFlow) + { + return AmountOfSubstance.FromKilomoles(duration.Seconds * molarFlow.KilomolesPerSecond); + } + + /// Get from * . + public static Angle operator *(Duration duration, RotationalSpeed rotationalSpeed) + { + return Angle.FromRadians(duration.Seconds * rotationalSpeed.RadiansPerSecond); + } + + /// Get from * . + public static Area operator *(Duration duration, KinematicViscosity kinematicViscosity) + { + return Area.FromSquareMeters(duration.Seconds * kinematicViscosity.SquareMetersPerSecond); + } + + /// Get from * . + public static ElectricCharge operator *(Duration duration, ElectricCurrent electricCurrent) + { + return ElectricCharge.FromAmpereHours(duration.Hours * electricCurrent.Amperes); + } + + /// Get from * . + public static ElectricCurrent operator *(Duration duration, ElectricCurrentGradient electricCurrentGradient) + { + return ElectricCurrent.FromAmperes(duration.Seconds * electricCurrentGradient.AmperesPerSecond); + } + + /// Get from * . + public static Energy operator *(Duration duration, Power power) + { + return Energy.FromJoules(duration.Seconds * (double)power.Watts); + } + + /// Get from * . + public static Force operator *(Duration duration, ForceChangeRate forceChangeRate) + { + return Force.FromNewtons(duration.Seconds * forceChangeRate.NewtonsPerSecond); + } + + /// Get from * . + public static Length operator *(Duration duration, Speed speed) + { + return Length.FromMeters(duration.Seconds * speed.MetersPerSecond); + } + + /// Get from * . + public static Mass operator *(Duration duration, MassFlow massFlow) + { + return Mass.FromKilograms(duration.Seconds * massFlow.KilogramsPerSecond); + } + + /// Get from * . + public static Pressure operator *(Duration duration, PressureChangeRate pressureChangeRate) + { + return Pressure.FromPascals(duration.Seconds * pressureChangeRate.PascalsPerSecond); + } + + /// Get from * . + public static Speed operator *(Duration duration, Acceleration acceleration) + { + return Speed.FromMetersPerSecond(duration.Seconds * acceleration.MetersPerSecondSquared); + } + + /// Get from * . + public static TemperatureDelta operator *(Duration duration, TemperatureChangeRate temperatureChangeRate) + { + return TemperatureDelta.FromDegreesCelsius(duration.Seconds * temperatureChangeRate.DegreesCelsiusPerSecond); + } + + /// Get from * . + public static Volume operator *(Duration duration, VolumeFlow volumeFlow) + { + return Volume.FromCubicMeters(duration.Seconds * volumeFlow.CubicMetersPerSecond); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 8b9fec91e9..595cbeaad1 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.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; @@ -41,6 +44,9 @@ namespace UnitsNet [DataContract] public readonly partial struct DynamicViscosity : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -595,6 +601,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Dynam #endregion + #region Relational Operators + + /// Get from / . + public static KinematicViscosity operator /(DynamicViscosity dynamicViscosity, Density density) + { + return KinematicViscosity.FromSquareMetersPerSecond(dynamicViscosity.NewtonSecondsPerMeterSquared / density.KilogramsPerCubicMeter); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index 7882ac8960..aa67329563 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.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; @@ -41,6 +44,12 @@ namespace UnitsNet [DataContract] public readonly partial struct ElectricCharge : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -613,6 +622,34 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect #endregion + #region Relational Operators + + /// Get from * . + public static Energy operator *(ElectricCharge electricCharge, ElectricPotential electricPotential) + { + return Energy.FromJoules(electricCharge.Coulombs * electricPotential.Volts); + } + + /// Get from / . + public static Duration operator /(ElectricCharge electricCharge, ElectricCurrent electricCurrent) + { + return Duration.FromHours(electricCharge.AmpereHours / electricCurrent.Amperes); + } + + /// Get from / . + public static ElectricCurrent operator /(ElectricCharge electricCharge, Duration duration) + { + return ElectricCurrent.FromAmperes(electricCharge.AmpereHours / duration.Hours); + } + + /// Get from / . + public static ElectricCurrent operator /(ElectricCharge electricCharge, TimeSpan timeSpan) + { + return ElectricCurrent.FromAmperes(electricCharge.AmpereHours / timeSpan.TotalHours); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index 09df006af7..deb46b99fd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -523,6 +523,17 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect #endregion + #region Relational Operators + + /// Calculates the inverse of this quantity. + /// The corresponding inverse quantity, . + public ElectricResistivity Inverse() + { + return SiemensPerMeter == 0.0 ? ElectricResistivity.Zero : ElectricResistivity.FromOhmMeters(1 / SiemensPerMeter); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index 80e95ee4ba..163fea165d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.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,14 @@ namespace UnitsNet [DataContract] public readonly partial struct ElectricCurrent : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IMultiplyOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -574,6 +585,52 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect #endregion + #region Relational Operators + + /// Get from * . + public static ElectricCharge operator *(ElectricCurrent electricCurrent, Duration duration) + { + return ElectricCharge.FromAmpereHours(electricCurrent.Amperes * duration.Hours); + } + + /// Get from * . + public static ElectricPotential operator *(ElectricCurrent electricCurrent, ElectricResistance electricResistance) + { + return ElectricPotential.FromVolts(electricCurrent.Amperes * electricResistance.Ohms); + } + + /// Get from * . + public static Power operator *(ElectricCurrent electricCurrent, ElectricPotential electricPotential) + { + 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 ElectricCharge operator *(ElectricCurrent electricCurrent, TimeSpan timeSpan) + { + return ElectricCharge.FromAmpereHours(electricCurrent.Amperes * timeSpan.TotalHours); + } + + /// Get from * . + public static ElectricCharge operator *(TimeSpan timeSpan, ElectricCurrent electricCurrent) + { + return ElectricCharge.FromAmpereHours(timeSpan.TotalHours * electricCurrent.Amperes); + } + + /// Get from / . + public static ElectricCurrentGradient operator /(ElectricCurrent electricCurrent, TimeSpan timeSpan) + { + return ElectricCurrentGradient.FromAmperesPerSecond(electricCurrent.Amperes / timeSpan.TotalSeconds); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index 044d4ad6d7..7617d04940 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.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 ElectricCurrentGradient : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -538,6 +545,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect #endregion + #region Relational Operators + + /// Get from * . + public static ElectricCurrent operator *(ElectricCurrentGradient electricCurrentGradient, Duration duration) + { + return ElectricCurrent.FromAmperes(electricCurrentGradient.AmperesPerSecond * duration.Seconds); + } + + /// Get from * . + public static ElectricCurrent operator *(ElectricCurrentGradient electricCurrentGradient, TimeSpan timeSpan) + { + return ElectricCurrent.FromAmperes(electricCurrentGradient.AmperesPerSecond * timeSpan.TotalSeconds); + } + + /// Get from * . + public static ElectricCurrent operator *(TimeSpan timeSpan, ElectricCurrentGradient electricCurrentGradient) + { + return ElectricCurrent.FromAmperes(timeSpan.TotalSeconds * electricCurrentGradient.AmperesPerSecond); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index bf4fd44d3f..fb726fae96 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.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,12 @@ namespace UnitsNet [DataContract] public readonly partial struct ElectricPotential : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -520,6 +529,34 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect #endregion + #region Relational Operators + + /// Get from * . + public static Energy operator *(ElectricPotential electricPotential, ElectricCharge electricCharge) + { + return Energy.FromJoules(electricPotential.Volts * electricCharge.Coulombs); + } + + /// Get from * . + public static Power operator *(ElectricPotential electricPotential, ElectricCurrent electricCurrent) + { + 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 /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index b91c8e0b72..c1b4e12e8e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,9 @@ namespace UnitsNet [DataContract] public readonly partial struct ElectricResistance : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -538,6 +544,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect #endregion + #region Relational Operators + + /// Get from * . + public static ElectricPotential operator *(ElectricResistance electricResistance, ElectricCurrent electricCurrent) + { + return ElectricPotential.FromVolts(electricResistance.Ohms * electricCurrent.Amperes); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 3332a834ad..89193b7021 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -667,6 +667,17 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Elect #endregion + #region Relational Operators + + /// Calculates the inverse of this quantity. + /// The corresponding inverse quantity, . + public ElectricConductivity Inverse() + { + return OhmMeters == 0.0 ? ElectricConductivity.Zero : ElectricConductivity.FromSiemensPerMeter(1 / OhmMeters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index 151a2621ee..3d35b68077 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.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,18 @@ namespace UnitsNet [DataContract] public readonly partial struct Energy : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -1132,6 +1147,70 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Energ #endregion + #region Relational Operators + + /// Get from * . + public static Power operator *(Energy energy, Frequency frequency) + { + return Power.FromWatts(energy.Joules * frequency.PerSecond); + } + + /// 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) + { + return ElectricCharge.FromCoulombs(energy.Joules / electricPotential.Volts); + } + + /// Get from / . + public static ElectricPotential operator /(Energy energy, ElectricCharge electricCharge) + { + 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, Duration duration) + { + return Power.FromWatts(energy.Joules / duration.Seconds); + } + + /// Get from / . + public static SpecificEnergy operator /(Energy energy, Mass mass) + { + return SpecificEnergy.FromJoulesPerKilogram(energy.Joules / mass.Kilograms); + } + + /// Get from / . + public static TemperatureDelta operator /(Energy energy, Entropy entropy) + { + return TemperatureDelta.FromKelvins(energy.Joules / entropy.JoulesPerKelvin); + } + + /// Get from / . + public static Power operator /(Energy energy, TimeSpan timeSpan) + { + return Power.FromWatts(energy.Joules / timeSpan.TotalSeconds); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs index 6c9cebbdc1..26b61f515a 100644 --- a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,9 @@ namespace UnitsNet [DataContract] public readonly partial struct EnergyDensity : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -628,6 +634,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Energ #endregion + #region Relational Operators + + /// Get from * . + public static Energy operator *(EnergyDensity energyDensity, Volume volume) + { + return Energy.FromJoules(energyDensity.JoulesPerCubicMeter * volume.CubicMeters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index df5ec29e4d..310a82e47f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.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 Entropy : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -538,6 +545,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Entro #endregion + #region Relational Operators + + /// Get from * . + public static Energy operator *(Entropy entropy, TemperatureDelta temperatureDelta) + { + return Energy.FromJoules(entropy.JoulesPerKelvin * temperatureDelta.Kelvins); + } + + /// Get from / . + public static SpecificEntropy operator /(Entropy entropy, Mass mass) + { + return SpecificEntropy.FromJoulesPerKilogramKelvin(entropy.JoulesPerKelvin / mass.Kilograms); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index fe8fa8ae48..27371e1f77 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.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,18 @@ namespace UnitsNet [DataContract] public readonly partial struct Force : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -682,6 +697,70 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force #endregion + #region Relational Operators + + /// Get from * . + public static ForcePerLength operator *(Force force, ReciprocalLength reciprocalLength) + { + return ForcePerLength.FromNewtonsPerMeter(force.Newtons * reciprocalLength.InverseMeters); + } + + /// Get from * . + public static Power operator *(Force force, Speed speed) + { + return Power.FromWatts(force.Newtons * speed.MetersPerSecond); + } + + /// Get from * . + public static Pressure operator *(Force force, ReciprocalArea reciprocalArea) + { + return Pressure.FromNewtonsPerSquareMeter(force.Newtons * reciprocalArea.InverseSquareMeters); + } + + /// Get from * . + public static Torque operator *(Force force, Length length) + { + return Torque.FromNewtonMeters(force.Newtons * length.Meters); + } + + /// Get from / . + public static Acceleration operator /(Force force, Mass mass) + { + return Acceleration.FromMetersPerSecondSquared(force.Newtons / mass.Kilograms); + } + + /// Get from / . + public static Duration operator /(Force force, ForceChangeRate forceChangeRate) + { + return Duration.FromSeconds(force.Newtons / forceChangeRate.NewtonsPerSecond); + } + + /// Get from / . + public static ForcePerLength operator /(Force force, Length length) + { + return ForcePerLength.FromNewtonsPerMeter(force.Newtons / length.Meters); + } + + /// Get from / . + public static Length operator /(Force force, ForcePerLength forcePerLength) + { + return Length.FromMeters(force.Newtons / forcePerLength.NewtonsPerMeter); + } + + /// Get from / . + public static Mass operator /(Force force, Acceleration acceleration) + { + return Mass.FromKilograms(force.Newtons / acceleration.MetersPerSecondSquared); + } + + /// Get from / . + public static Pressure operator /(Force force, Area area) + { + return Pressure.FromPascals(force.Newtons / area.SquareMeters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index ed92f8f384..a6e1e5b012 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.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 ForceChangeRate : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -682,6 +689,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force #endregion + #region Relational Operators + + /// Get from * . + public static Force operator *(ForceChangeRate forceChangeRate, Duration duration) + { + return Force.FromNewtons(forceChangeRate.NewtonsPerSecond * duration.Seconds); + } + + /// Get from * . + public static Force operator *(ForceChangeRate forceChangeRate, TimeSpan timeSpan) + { + return Force.FromNewtons(forceChangeRate.NewtonsPerSecond * timeSpan.TotalSeconds); + } + + /// Get from * . + public static Force operator *(TimeSpan timeSpan, ForceChangeRate forceChangeRate) + { + return Force.FromNewtons(timeSpan.TotalSeconds * forceChangeRate.NewtonsPerSecond); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index 73654c7222..00f56faf78 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.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,13 @@ namespace UnitsNet [DataContract] public readonly partial struct ForcePerLength : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -1096,6 +1106,40 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Force #endregion + #region Relational Operators + + /// Get from * . + public static Force operator *(ForcePerLength forcePerLength, Length length) + { + return Force.FromNewtons(forcePerLength.NewtonsPerMeter * length.Meters); + } + + /// 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); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index 70b75a26cb..424ad268cb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,9 @@ namespace UnitsNet [DataContract] public readonly partial struct Frequency : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -646,6 +652,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Frequ #endregion + #region Relational Operators + + /// Get from * . + public static Power operator *(Frequency frequency, Energy energy) + { + return Power.FromWatts(frequency.PerSecond * energy.Joules); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index d0e2dac5e2..52133329b8 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,9 @@ namespace UnitsNet [DataContract] public readonly partial struct HeatFlux : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -736,6 +742,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out HeatF #endregion + #region Relational Operators + + /// Get from * . + public static Power operator *(HeatFlux heatFlux, Area area) + { + return Power.FromWatts(heatFlux.WattsPerSquareMeter * area.SquareMeters); + } + + #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 b278c98a98..71eed52ba8 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.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; @@ -41,6 +44,12 @@ namespace UnitsNet [DataContract] public readonly partial struct KinematicViscosity : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -577,6 +586,40 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Kinem #endregion + #region Relational Operators + + /// Get from * . + public static Area operator *(KinematicViscosity kinematicViscosity, Duration duration) + { + return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * duration.Seconds); + } + + /// Get from * . + public static DynamicViscosity operator *(KinematicViscosity kinematicViscosity, Density density) + { + return DynamicViscosity.FromNewtonSecondsPerMeterSquared(kinematicViscosity.SquareMetersPerSecond * density.KilogramsPerCubicMeter); + } + + /// Get from / . + public static Speed operator /(KinematicViscosity kinematicViscosity, Length length) + { + return Speed.FromMetersPerSecond(kinematicViscosity.SquareMetersPerSecond / length.Meters); + } + + /// Get from * . + public static Area operator *(KinematicViscosity kinematicViscosity, TimeSpan timeSpan) + { + return Area.FromSquareMeters(kinematicViscosity.SquareMetersPerSecond * timeSpan.TotalSeconds); + } + + /// Get from * . + public static Area operator *(TimeSpan timeSpan, KinematicViscosity kinematicViscosity) + { + return Area.FromSquareMeters(timeSpan.TotalSeconds * kinematicViscosity.SquareMetersPerSecond); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index 8eef185ba5..d275b0af98 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.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,20 @@ namespace UnitsNet [DataContract] public readonly partial struct Length : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -1150,6 +1167,89 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lengt #endregion + #region Relational Operators + + /// Get from * . + public static Area operator *(Length left, Length right) + { + return Area.FromSquareMeters(left.Meters * right.Meters); + } + + /// Get from * . + public static Force operator *(Length length, ForcePerLength forcePerLength) + { + return Force.FromNewtons(length.Meters * forcePerLength.NewtonsPerMeter); + } + + /// Get from * . + public static KinematicViscosity operator *(Length length, Speed speed) + { + return KinematicViscosity.FromSquareMetersPerSecond(length.Meters * speed.MetersPerSecond); + } + + /// Get from * . + public static Mass operator *(Length length, LinearDensity linearDensity) + { + return Mass.FromKilograms(length.Meters * linearDensity.KilogramsPerMeter); + } + + /// Get from * . + public static Pressure operator *(Length length, SpecificWeight specificWeight) + { + return Pressure.FromPascals(length.Meters * specificWeight.NewtonsPerCubicMeter); + } + + /// Get from * . + public static RotationalStiffness operator *(Length length, RotationalStiffnessPerLength rotationalStiffnessPerLength) + { + return RotationalStiffness.FromNewtonMetersPerRadian(length.Meters * rotationalStiffnessPerLength.NewtonMetersPerRadianPerMeter); + } + + /// 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) + { + 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 Duration operator /(Length length, Speed speed) + { + return Duration.FromSeconds(length.Meters / speed.MetersPerSecond); + } + + /// Get from / . + public static Speed operator /(Length length, Duration duration) + { + return Speed.FromMetersPerSecond(length.Meters / duration.Seconds); + } + + /// 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 Speed operator /(Length length, TimeSpan timeSpan) + { + return Speed.FromMetersPerSecond(length.Meters / timeSpan.TotalSeconds); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index f5c9f76ec8..31279733ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.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; @@ -41,6 +44,11 @@ namespace UnitsNet [DataContract] public readonly partial struct LinearDensity : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -667,6 +675,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Linea #endregion + #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) + { + return Area.FromSquareMeters(linearDensity.KilogramsPerMeter / density.KilogramsPerCubicMeter); + } + + /// Get from / . + public static Density operator /(LinearDensity linearDensity, Area area) + { + return Density.FromKilogramsPerCubicMeter(linearDensity.KilogramsPerMeter / area.SquareMeters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs index de6be7a16f..879d452115 100644 --- a/UnitsNet/GeneratedCode/Quantities/Luminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Luminance.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; @@ -41,6 +44,9 @@ namespace UnitsNet [DataContract] public readonly partial struct Luminance : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -595,6 +601,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lumin #endregion + #region Relational Operators + + /// Get from * . + public static LuminousIntensity operator *(Luminance luminance, Area area) + { + return LuminousIntensity.FromCandela(luminance.CandelasPerSquareMeter * area.SquareMeters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index f01aba9310..09735d275e 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.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; @@ -41,6 +44,10 @@ namespace UnitsNet [DataContract] public readonly partial struct LuminousIntensity : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -433,6 +440,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Lumin #endregion + #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); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index fc866ba991..11f25f2b51 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.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,23 @@ namespace UnitsNet [DataContract] public readonly partial struct Mass : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -898,6 +918,100 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassU #endregion + #region Relational Operators + + /// Get from * . + public static Energy operator *(Mass mass, SpecificEnergy specificEnergy) + { + return Energy.FromJoules(mass.Kilograms * specificEnergy.JoulesPerKilogram); + } + + /// Get from * . + public static Entropy operator *(Mass mass, SpecificEntropy specificEntropy) + { + return Entropy.FromJoulesPerKelvin(mass.Kilograms * specificEntropy.JoulesPerKilogramKelvin); + } + + /// Get from * . + public static Force operator *(Mass mass, Acceleration acceleration) + { + return Force.FromNewtons(mass.Kilograms * acceleration.MetersPerSecondSquared); + } + + /// Get from * . + public static Mass operator *(Mass mass, MassFraction massFraction) + { + return Mass.FromKilograms(mass.Kilograms * massFraction.DecimalFractions); + } + + /// Get from * . + public static Volume operator *(Mass mass, SpecificVolume specificVolume) + { + return Volume.FromCubicMeters(mass.Kilograms * specificVolume.CubicMetersPerKilogram); + } + + /// 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) + { + return Density.FromKilogramsPerCubicMeter(mass.Kilograms / volume.CubicMeters); + } + + /// Get from / . + public static Length operator /(Mass mass, LinearDensity linearDensity) + { + return Length.FromMeters(mass.Kilograms / linearDensity.KilogramsPerMeter); + } + + /// Get from / . + public static LinearDensity operator /(Mass mass, Length length) + { + return LinearDensity.FromKilogramsPerMeter(mass.Kilograms / length.Meters); + } + + /// Get from / . + public static Mass operator /(Mass mass, MassFraction massFraction) + { + return Mass.FromKilograms(mass.Kilograms / massFraction.DecimalFractions); + } + + /// Get from / . + public static MassFlow operator /(Mass mass, Duration duration) + { + return MassFlow.FromKilogramsPerSecond(mass.Kilograms / duration.Seconds); + } + + /// Get from / . + public static Volume operator /(Mass mass, Density density) + { + return Volume.FromCubicMeters(mass.Kilograms / density.KilogramsPerCubicMeter); + } + + /// Get from / . + public static MassFlow operator /(Mass mass, TimeSpan timeSpan) + { + return MassFlow.FromKilogramsPerSecond(mass.Kilograms / timeSpan.TotalSeconds); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs index aabfd7f1d6..090cec7288 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassConcentration.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; @@ -41,6 +44,11 @@ namespace UnitsNet [DataContract] public readonly partial struct MassConcentration : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -1297,6 +1305,28 @@ 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 726589a06d..b59c39042d 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.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,17 @@ namespace UnitsNet [DataContract] public readonly partial struct MassFlow : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -1006,6 +1020,70 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassF #endregion + #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); + } + + /// Get from / . + public static BrakeSpecificFuelConsumption operator /(MassFlow massFlow, Power power) + { + return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(massFlow.KilogramsPerSecond / (double)power.Watts); + } + + /// Get from / . + public static Density operator /(MassFlow massFlow, VolumeFlow volumeFlow) + { + return Density.FromKilogramsPerCubicMeter(massFlow.KilogramsPerSecond / volumeFlow.CubicMetersPerSecond); + } + + /// Get from / . + public static MassFlux operator /(MassFlow massFlow, Area area) + { + return MassFlux.FromKilogramsPerSecondPerSquareMeter(massFlow.KilogramsPerSecond / area.SquareMeters); + } + + /// Get from / . + public static Power operator /(MassFlow massFlow, BrakeSpecificFuelConsumption brakeSpecificFuelConsumption) + { + return Power.FromWatts(massFlow.KilogramsPerSecond / brakeSpecificFuelConsumption.KilogramsPerJoule); + } + + /// Get from / . + public static VolumeFlow operator /(MassFlow massFlow, Density density) + { + return VolumeFlow.FromCubicMetersPerSecond(massFlow.KilogramsPerSecond / density.KilogramsPerCubicMeter); + } + + /// Get from * . + public static Mass operator *(MassFlow massFlow, TimeSpan timeSpan) + { + return Mass.FromKilograms(massFlow.KilogramsPerSecond * timeSpan.TotalSeconds); + } + + /// Get from * . + public static Mass operator *(TimeSpan timeSpan, MassFlow massFlow) + { + return Mass.FromKilograms(timeSpan.TotalSeconds * massFlow.KilogramsPerSecond); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index 2feb33ed5b..209141241e 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.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,11 @@ namespace UnitsNet [DataContract] public readonly partial struct MassFlux : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -628,6 +636,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out MassF #endregion + #region Relational Operators + + /// Get from * . + public static MassFlow operator *(MassFlux massFlux, Area area) + { + return MassFlow.FromGramsPerSecond(massFlux.GramsPerSecondPerSquareMeter * area.SquareMeters); + } + + /// Get from / . + public static Density operator /(MassFlux massFlux, Speed speed) + { + return Density.FromKilogramsPerCubicMeter(massFlux.KilogramsPerSecondPerSquareMeter / speed.MetersPerSecond); + } + + /// Get from / . + public static Speed operator /(MassFlux massFlux, Density density) + { + return Speed.FromMetersPerSecond(massFlux.KilogramsPerSecondPerSquareMeter / density.KilogramsPerCubicMeter); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs index 074b9bd8fa..3095de01bf 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFraction.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFraction.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; @@ -41,6 +44,9 @@ namespace UnitsNet [DataContract] public readonly partial struct MassFraction : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -847,6 +853,16 @@ 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 ce9a381c2e..6a66d0c379 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarFlow.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,12 @@ namespace UnitsNet [DataContract] public readonly partial struct MolarFlow : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -574,6 +583,40 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar #endregion + #region Relational Operators + + /// Get from * . + public static AmountOfSubstance operator *(MolarFlow molarFlow, Duration duration) + { + return AmountOfSubstance.FromKilomoles(molarFlow.KilomolesPerSecond * duration.Seconds); + } + + /// Get from * . + public static MassFlow operator *(MolarFlow molarFlow, MolarMass molarMass) + { + return MassFlow.FromKilogramsPerSecond(molarFlow.KilomolesPerSecond * molarMass.KilogramsPerKilomole); + } + + /// Get from / . + public static VolumeFlow operator /(MolarFlow molarFlow, Molarity molarity) + { + return VolumeFlow.FromCubicMetersPerSecond(molarFlow.MolesPerSecond / molarity.MolesPerCubicMeter); + } + + /// Get from * . + public static AmountOfSubstance operator *(MolarFlow molarFlow, TimeSpan timeSpan) + { + return AmountOfSubstance.FromKilomoles(molarFlow.KilomolesPerSecond * timeSpan.TotalSeconds); + } + + /// Get from * . + public static AmountOfSubstance operator *(TimeSpan timeSpan, MolarFlow molarFlow) + { + return AmountOfSubstance.FromKilomoles(timeSpan.TotalSeconds * molarFlow.KilomolesPerSecond); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 8b72eb0323..3e29004ac2 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.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,11 @@ namespace UnitsNet [DataContract] public readonly partial struct MolarMass : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -646,6 +654,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar #endregion + #region Relational Operators + + /// Get from * . + public static Mass operator *(MolarMass molarMass, AmountOfSubstance amountOfSubstance) + { + return Mass.FromGrams(molarMass.GramsPerMole * amountOfSubstance.Moles); + } + + /// Get from * . + public static MassConcentration operator *(MolarMass molarMass, Molarity molarity) + { + return MassConcentration.FromGramsPerCubicMeter(molarMass.GramsPerMole * molarity.MolesPerCubicMeter); + } + + /// Get from * . + public static MassFlow operator *(MolarMass molarMass, MolarFlow molarFlow) + { + return MassFlow.FromKilogramsPerSecond(molarMass.KilogramsPerKilomole * molarFlow.KilomolesPerSecond); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 4814b4fdac..478de5bb67 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.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; @@ -41,6 +44,10 @@ namespace UnitsNet [DataContract] public readonly partial struct Molarity : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -613,6 +620,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Molar #endregion + #region Relational Operators + + /// Get from * . + public static MassConcentration operator *(Molarity molarity, MolarMass molarMass) + { + return MassConcentration.FromGramsPerCubicMeter(molarity.MolesPerCubicMeter * molarMass.GramsPerMole); + } + + /// Get from * . + public static Molarity operator *(Molarity molarity, VolumeConcentration volumeConcentration) + { + return Molarity.FromMolesPerCubicMeter(molarity.MolesPerCubicMeter * volumeConcentration.DecimalFractions); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index 199ef43506..f512771fa5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.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,20 @@ namespace UnitsNet [DataContract] public readonly partial struct Power : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IMultiplyOperators, +#endif IDecimalQuantity, IComparable, IComparable, @@ -881,6 +898,88 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Power #endregion + #region Relational Operators + + /// Get from * . + public static Energy operator *(Power power, Duration duration) + { + return Energy.FromJoules((double)power.Watts * duration.Seconds); + } + + /// Get from * . + public static MassFlow operator *(Power power, BrakeSpecificFuelConsumption brakeSpecificFuelConsumption) + { + return MassFlow.FromKilogramsPerSecond((double)power.Watts * brakeSpecificFuelConsumption.KilogramsPerJoule); + } + + /// Get from / . + public static Area operator /(Power power, HeatFlux heatFlux) + { + return Area.FromSquareMeters((double)power.Watts / heatFlux.WattsPerSquareMeter); + } + + /// Get from / . + public static ElectricCurrent operator /(Power power, ElectricPotential electricPotential) + { + return ElectricCurrent.FromAmperes((double)power.Watts / electricPotential.Volts); + } + + /// Get from / . + public static ElectricPotential operator /(Power power, ElectricCurrent electricCurrent) + { + return ElectricPotential.FromVolts((double)power.Watts / electricCurrent.Amperes); + } + + /// Get from / . + public static Force operator /(Power power, Speed speed) + { + return Force.FromNewtons((double)power.Watts / speed.MetersPerSecond); + } + + /// Get from / . + public static HeatFlux operator /(Power power, Area area) + { + return HeatFlux.FromWattsPerSquareMeter((double)power.Watts / area.SquareMeters); + } + + /// 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 / . + public static SpecificEnergy operator /(Power power, MassFlow massFlow) + { + return SpecificEnergy.FromJoulesPerKilogram((double)power.Watts / massFlow.KilogramsPerSecond); + } + + /// Get from / . + public static Torque operator /(Power power, RotationalSpeed rotationalSpeed) + { + return Torque.FromNewtonMeters((double)power.Watts / rotationalSpeed.RadiansPerSecond); + } + + /// Get from * . + public static Energy operator *(Power power, TimeSpan timeSpan) + { + return Energy.FromJoules((double)power.Watts * timeSpan.TotalSeconds); + } + + /// Get from * . + public static Energy operator *(TimeSpan timeSpan, Power power) + { + return Energy.FromJoules(timeSpan.TotalSeconds * (double)power.Watts); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index 25078e7698..777d8c544d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.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,15 @@ namespace UnitsNet [DataContract] public readonly partial struct Pressure : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -1294,6 +1306,52 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Press #endregion + #region Relational Operators + + /// Get from * . + public static Force operator *(Pressure pressure, Area area) + { + return Force.FromNewtons(pressure.Pascals * area.SquareMeters); + } + + /// Get from / . + public static Force operator /(Pressure pressure, ReciprocalArea reciprocalArea) + { + return Force.FromNewtons(pressure.Pascals / 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); + } + + /// Get from / . + public static PressureChangeRate operator /(Pressure pressure, Duration duration) + { + return PressureChangeRate.FromPascalsPerSecond(pressure.Pascals / duration.Seconds); + } + + /// Get from / . + public static SpecificWeight operator /(Pressure pressure, Length length) + { + return SpecificWeight.FromNewtonsPerCubicMeter(pressure.Pascals / length.Meters); + } + + /// Get from / . + public static PressureChangeRate operator /(Pressure pressure, TimeSpan timeSpan) + { + return PressureChangeRate.FromPascalsPerSecond(pressure.Pascals / timeSpan.TotalSeconds); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index 9eba1a7ad0..a2a19ffac1 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.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 PressureChangeRate : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -736,6 +743,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Press #endregion + #region Relational Operators + + /// Get from * . + public static Pressure operator *(PressureChangeRate pressureChangeRate, Duration duration) + { + return Pressure.FromPascals(pressureChangeRate.PascalsPerSecond * duration.Seconds); + } + + /// Get from * . + public static Pressure operator *(PressureChangeRate pressureChangeRate, TimeSpan timeSpan) + { + return Pressure.FromPascals(pressureChangeRate.PascalsPerSecond * timeSpan.TotalSeconds); + } + + /// Get from * . + public static Pressure operator *(TimeSpan timeSpan, PressureChangeRate pressureChangeRate) + { + return Pressure.FromPascals(timeSpan.TotalSeconds * pressureChangeRate.PascalsPerSecond); + } + + #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 83edb0b0f8..8ec80b305d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalArea.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; @@ -41,6 +44,11 @@ namespace UnitsNet [DataContract] public readonly partial struct ReciprocalArea : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -613,6 +621,35 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Recip #endregion + #region Relational Operators + + /// Get from * . + public static Pressure operator *(ReciprocalArea reciprocalArea, Force force) + { + return Pressure.FromNewtonsPerSquareMeter(reciprocalArea.InverseSquareMeters * force.Newtons); + } + + /// Get from * . + public static Ratio operator *(ReciprocalArea reciprocalArea, Area area) + { + return Ratio.FromDecimalFractions(reciprocalArea.InverseSquareMeters * area.SquareMeters); + } + + /// Get from / . + public static ReciprocalLength operator /(ReciprocalArea reciprocalArea, ReciprocalLength reciprocalLength) + { + return ReciprocalLength.FromInverseMeters(reciprocalArea.InverseSquareMeters / reciprocalLength.InverseMeters); + } + + /// Calculates the inverse of this quantity. + /// The corresponding inverse quantity, . + public Area Inverse() + { + return InverseSquareMeters == 0.0 ? Area.Zero : Area.FromSquareMeters(1 / InverseSquareMeters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs index 5757b2e3dc..c123675b37 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReciprocalLength.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; @@ -41,6 +44,12 @@ namespace UnitsNet [DataContract] public readonly partial struct ReciprocalLength : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -595,6 +604,41 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Recip #endregion + #region Relational Operators + + /// Get from * . + public static ForcePerLength operator *(ReciprocalLength reciprocalLength, Force force) + { + return ForcePerLength.FromNewtonsPerMeter(reciprocalLength.InverseMeters * force.Newtons); + } + + /// Get from * . + public static Pressure operator *(ReciprocalLength reciprocalLength, ForcePerLength forcePerLength) + { + return Pressure.FromNewtonsPerSquareMeter(reciprocalLength.InverseMeters * forcePerLength.NewtonsPerMeter); + } + + /// Get from * . + public static ReciprocalArea operator *(ReciprocalLength left, ReciprocalLength right) + { + return ReciprocalArea.FromInverseSquareMeters(left.InverseMeters * right.InverseMeters); + } + + /// Get from / . + public static Length operator /(ReciprocalLength reciprocalLength, ReciprocalArea reciprocalArea) + { + return Length.FromMeters(reciprocalLength.InverseMeters / reciprocalArea.InverseSquareMeters); + } + + /// Calculates the inverse of this quantity. + /// The corresponding inverse quantity, . + public Length Inverse() + { + return InverseMeters == 0.0 ? Length.Zero : Length.FromMeters(1 / InverseMeters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 3262386093..8501363750 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.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 RotationalSpeed : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -646,6 +653,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Rotat #endregion + #region Relational Operators + + /// Get from * . + public static Angle operator *(RotationalSpeed rotationalSpeed, Duration duration) + { + return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * duration.Seconds); + } + + /// Get from * . + public static Angle operator *(RotationalSpeed rotationalSpeed, TimeSpan timeSpan) + { + return Angle.FromRadians(rotationalSpeed.RadiansPerSecond * timeSpan.TotalSeconds); + } + + /// Get from * . + public static Angle operator *(TimeSpan timeSpan, RotationalSpeed rotationalSpeed) + { + return Angle.FromRadians(timeSpan.TotalSeconds * rotationalSpeed.RadiansPerSecond); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 819a43022b..461dbedf6a 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.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,11 @@ namespace UnitsNet [DataContract] public readonly partial struct RotationalStiffness : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -1006,6 +1014,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Rotat #endregion + #region Relational Operators + + /// Get from * . + public static Torque operator *(RotationalStiffness rotationalStiffness, Angle angle) + { + return Torque.FromNewtonMeters(rotationalStiffness.NewtonMetersPerRadian * angle.Radians); + } + + /// Get from / . + public static Length operator /(RotationalStiffness rotationalStiffness, RotationalStiffnessPerLength rotationalStiffnessPerLength) + { + return Length.FromMeters(rotationalStiffness.NewtonMetersPerRadian / rotationalStiffnessPerLength.NewtonMetersPerRadianPerMeter); + } + + /// Get from / . + public static RotationalStiffnessPerLength operator /(RotationalStiffness rotationalStiffness, Length length) + { + return RotationalStiffnessPerLength.FromNewtonMetersPerRadianPerMeter(rotationalStiffness.NewtonMetersPerRadian / length.Meters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 23a1cdafd5..e5a6418615 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,9 @@ namespace UnitsNet [DataContract] public readonly partial struct RotationalStiffnessPerLength : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -502,6 +508,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Rotat #endregion + #region Relational Operators + + /// Get from * . + public static RotationalStiffness operator *(RotationalStiffnessPerLength rotationalStiffnessPerLength, Length length) + { + return RotationalStiffness.FromNewtonMetersPerRadian(rotationalStiffnessPerLength.NewtonMetersPerRadianPerMeter * length.Meters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index ca1e69f93b..ccc80b1a3c 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.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; @@ -41,6 +44,12 @@ namespace UnitsNet [DataContract] public readonly partial struct SpecificEnergy : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -955,6 +964,40 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci #endregion + #region Relational Operators + + /// Get from * . + public static Energy operator *(SpecificEnergy specificEnergy, Mass mass) + { + return Energy.FromJoules(specificEnergy.JoulesPerKilogram * mass.Kilograms); + } + + /// Get from * . + public static Power operator *(SpecificEnergy specificEnergy, MassFlow massFlow) + { + return Power.FromWatts(specificEnergy.JoulesPerKilogram * massFlow.KilogramsPerSecond); + } + + /// Get from * . + public static double operator *(SpecificEnergy specificEnergy, BrakeSpecificFuelConsumption brakeSpecificFuelConsumption) + { + return specificEnergy.JoulesPerKilogram * brakeSpecificFuelConsumption.KilogramsPerJoule; + } + + /// Get from / . + public static BrakeSpecificFuelConsumption operator /(double value, SpecificEnergy specificEnergy) + { + return BrakeSpecificFuelConsumption.FromKilogramsPerJoule(value / specificEnergy.JoulesPerKilogram); + } + + /// Get from / . + public static SpecificEntropy operator /(SpecificEnergy specificEnergy, TemperatureDelta temperatureDelta) + { + return SpecificEntropy.FromJoulesPerKilogramKelvin(specificEnergy.JoulesPerKilogram / temperatureDelta.Kelvins); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index a60c421170..c358ed82be 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.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 SpecificEntropy : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -574,6 +581,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci #endregion + #region Relational Operators + + /// Get from * . + public static Entropy operator *(SpecificEntropy specificEntropy, Mass mass) + { + return Entropy.FromJoulesPerKelvin(specificEntropy.JoulesPerKilogramKelvin * mass.Kilograms); + } + + /// Get from * . + public static SpecificEnergy operator *(SpecificEntropy specificEntropy, TemperatureDelta temperatureDelta) + { + return SpecificEnergy.FromJoulesPerKilogram(specificEntropy.JoulesPerKilogramKelvin * temperatureDelta.Kelvins); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index 9cfef5e88e..f1291dd156 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,9 @@ namespace UnitsNet [DataContract] public readonly partial struct SpecificVolume : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -466,6 +472,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci #endregion + #region Relational Operators + + /// Get from * . + public static Volume operator *(SpecificVolume specificVolume, Mass mass) + { + return Volume.FromCubicMeters(specificVolume.CubicMetersPerKilogram * mass.Kilograms); + } + + /// Get from / . + public static Density operator /(double value, SpecificVolume specificVolume) + { + return Density.FromKilogramsPerCubicMeter(value / specificVolume.CubicMetersPerKilogram); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 8be1def8e8..320c13a18e 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.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; @@ -41,6 +44,12 @@ namespace UnitsNet [DataContract] public readonly partial struct SpecificWeight : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -721,6 +730,34 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speci #endregion + #region Relational Operators + + /// Get from * . + public static ForcePerLength operator *(SpecificWeight specificWeight, Area area) + { + return ForcePerLength.FromNewtonsPerMeter(specificWeight.NewtonsPerCubicMeter * area.SquareMeters); + } + + /// Get from * . + public static Pressure operator *(SpecificWeight specificWeight, Length length) + { + 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 /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 07767638d6..282a71426c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.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,18 @@ namespace UnitsNet [DataContract] public readonly partial struct Speed : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IMultiplyOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -1006,6 +1021,76 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Speed #endregion + #region Relational Operators + + /// 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) + { + return Length.FromMeters(speed.MetersPerSecond * duration.Seconds); + } + + /// Get from * . + public static MassFlux operator *(Speed speed, Density density) + { + 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 VolumeFlow operator *(Speed speed, Area area) + { + return VolumeFlow.FromCubicMetersPerSecond(speed.MetersPerSecond * area.SquareMeters); + } + + /// 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 Length operator *(Speed speed, TimeSpan timeSpan) + { + return Length.FromMeters(speed.MetersPerSecond * timeSpan.TotalSeconds); + } + + /// Get from * . + public static Length operator *(TimeSpan timeSpan, Speed 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 /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index f0d3ffeec0..788e9ecc32 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.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 TemperatureChangeRate : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -592,6 +599,28 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Tempe #endregion + #region Relational Operators + + /// Get from * . + public static TemperatureDelta operator *(TemperatureChangeRate temperatureChangeRate, Duration duration) + { + return TemperatureDelta.FromDegreesCelsius(temperatureChangeRate.DegreesCelsiusPerSecond * duration.Seconds); + } + + /// Get from * . + public static TemperatureDelta operator *(TemperatureChangeRate temperatureChangeRate, TimeSpan timeSpan) + { + return TemperatureDelta.FromDegreesCelsius(temperatureChangeRate.DegreesCelsiusPerSecond * timeSpan.TotalSeconds); + } + + /// Get from * . + public static TemperatureDelta operator *(TimeSpan timeSpan, TemperatureChangeRate temperatureChangeRate) + { + return TemperatureDelta.FromDegreesCelsius(timeSpan.TotalSeconds * temperatureChangeRate.DegreesCelsiusPerSecond); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index 00c73911da..f08deea4ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.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,13 @@ namespace UnitsNet [DataContract] public readonly partial struct TemperatureDelta : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -574,6 +584,40 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Tempe #endregion + #region Relational Operators + + /// Get from * . + public static Energy operator *(TemperatureDelta temperatureDelta, Entropy entropy) + { + return Energy.FromJoules(temperatureDelta.Kelvins * entropy.JoulesPerKelvin); + } + + /// Get from * . + public static SpecificEnergy operator *(TemperatureDelta temperatureDelta, SpecificEntropy specificEntropy) + { + return SpecificEnergy.FromJoulesPerKilogram(temperatureDelta.Kelvins * specificEntropy.JoulesPerKilogramKelvin); + } + + /// Get from * . + public static double operator *(TemperatureDelta temperatureDelta, CoefficientOfThermalExpansion coefficientOfThermalExpansion) + { + return temperatureDelta.Kelvins * coefficientOfThermalExpansion.PerKelvin; + } + + /// Get from / . + public static Length operator /(TemperatureDelta temperatureDelta, TemperatureGradient temperatureGradient) + { + return Length.FromKilometers(temperatureDelta.Kelvins / temperatureGradient.DegreesCelciusPerKilometer); + } + + /// Get from / . + public static TemperatureGradient operator /(TemperatureDelta temperatureDelta, Length length) + { + return TemperatureGradient.FromKelvinsPerMeter(temperatureDelta.Kelvins / length.Meters); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs index f62488e27f..181e98c115 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureGradient.g.cs @@ -21,6 +21,9 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +#if NET7_0_OR_GREATER +using System.Numerics; +#endif using System.Runtime.Serialization; using UnitsNet.InternalHelpers; using UnitsNet.Units; @@ -38,6 +41,9 @@ namespace UnitsNet [DataContract] public readonly partial struct TemperatureGradient : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -484,6 +490,16 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Tempe #endregion + #region Relational Operators + + /// Get from * . + public static TemperatureDelta operator *(TemperatureGradient temperatureGradient, Length length) + { + return TemperatureDelta.FromDegreesCelsius(temperatureGradient.DegreesCelciusPerKilometer * length.Kilometers); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index be55483305..7a4fd8c7af 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.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,12 @@ namespace UnitsNet [DataContract] public readonly partial struct Torque : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -862,6 +871,34 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Torqu #endregion + #region Relational Operators + + /// Get from / . + public static Angle operator /(Torque torque, RotationalStiffness rotationalStiffness) + { + return Angle.FromRadians(torque.NewtonMeters / rotationalStiffness.NewtonMetersPerRadian); + } + + /// Get from / . + public static Force operator /(Torque torque, Length length) + { + return Force.FromNewtons(torque.NewtonMeters / length.Meters); + } + + /// Get from / . + public static Length operator /(Torque torque, Force force) + { + return Length.FromMeters(torque.NewtonMeters / force.Newtons); + } + + /// Get from / . + public static RotationalStiffness operator /(Torque torque, Angle angle) + { + return RotationalStiffness.FromNewtonMetersPerRadian(torque.NewtonMeters / angle.Radians); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index df86322da8..b772d6c60c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.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,16 @@ namespace UnitsNet [DataContract] public readonly partial struct Volume : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, + IDivisionOperators, +#endif IComparable, IComparable, IConvertible, @@ -1384,6 +1397,58 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum #endregion + #region Relational Operators + + /// Get from * . + public static Energy operator *(Volume volume, EnergyDensity energyDensity) + { + return Energy.FromJoules(volume.CubicMeters * energyDensity.JoulesPerCubicMeter); + } + + /// Get from * . + public static Mass operator *(Volume volume, Density density) + { + return Mass.FromKilograms(volume.CubicMeters * density.KilogramsPerCubicMeter); + } + + /// Get from * . + public static Mass operator *(Volume volume, MassConcentration massConcentration) + { + return Mass.FromKilograms(volume.CubicMeters * massConcentration.KilogramsPerCubicMeter); + } + + /// Get from / . + public static Area operator /(Volume volume, Length length) + { + return Area.FromSquareMeters(volume.CubicMeters / length.Meters); + } + + /// Get from / . + public static Length operator /(Volume volume, Area area) + { + return Length.FromMeters(volume.CubicMeters / area.SquareMeters); + } + + /// Get from / . + public static TimeSpan operator /(Volume volume, VolumeFlow volumeFlow) + { + return TimeSpan.FromSeconds(volume.CubicMeters / volumeFlow.CubicMetersPerSecond); + } + + /// Get from / . + public static VolumeFlow operator /(Volume volume, Duration duration) + { + return VolumeFlow.FromCubicMetersPerSecond(volume.CubicMeters / duration.Seconds); + } + + /// Get from / . + public static VolumeFlow operator /(Volume volume, TimeSpan timeSpan) + { + return VolumeFlow.FromCubicMetersPerSecond(volume.CubicMeters / timeSpan.TotalSeconds); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs index 6233db1180..6f1fc9723f 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeConcentration.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; @@ -41,6 +44,10 @@ namespace UnitsNet [DataContract] public readonly partial struct VolumeConcentration : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -775,6 +782,22 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum #endregion + #region Relational Operators + + /// Get from * . + public static MassConcentration operator *(VolumeConcentration volumeConcentration, Density density) + { + return MassConcentration.FromKilogramsPerCubicMeter(volumeConcentration.DecimalFractions * density.KilogramsPerCubicMeter); + } + + /// Get from * . + public static Molarity operator *(VolumeConcentration volumeConcentration, Molarity molarity) + { + return Molarity.FromMolesPerCubicMeter(volumeConcentration.DecimalFractions * molarity.MolesPerCubicMeter); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to. diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index 0842666310..55aad10331 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.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,13 @@ namespace UnitsNet [DataContract] public readonly partial struct VolumeFlow : IArithmeticQuantity, +#if NET7_0_OR_GREATER + IMultiplyOperators, + IMultiplyOperators, + IDivisionOperators, + IDivisionOperators, + IMultiplyOperators, +#endif IComparable, IComparable, IConvertible, @@ -1618,6 +1628,46 @@ public static bool TryParseUnit(string str, IFormatProvider? provider, out Volum #endregion + #region Relational Operators + + /// Get from * . + public static MassFlow operator *(VolumeFlow volumeFlow, Density density) + { + return MassFlow.FromKilogramsPerSecond(volumeFlow.CubicMetersPerSecond * density.KilogramsPerCubicMeter); + } + + /// Get from * . + public static Volume operator *(VolumeFlow volumeFlow, Duration duration) + { + 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) + { + return Volume.FromCubicMeters(volumeFlow.CubicMetersPerSecond * timeSpan.TotalSeconds); + } + + /// Get from * . + public static Volume operator *(TimeSpan timeSpan, VolumeFlow volumeFlow) + { + return Volume.FromCubicMeters(timeSpan.TotalSeconds * volumeFlow.CubicMetersPerSecond); + } + + #endregion + #region Equality / IComparable /// Returns true if less or equal to.