diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.ConversionsGenerator/ConversionConstants.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.ConversionsGenerator/ConversionConstants.g.cs index b007a3e..accf11b 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.ConversionsGenerator/ConversionConstants.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.ConversionsGenerator/ConversionConstants.g.cs @@ -25,6 +25,9 @@ internal static class ConversionConstants{ /// Angstrom to meter conversion: 1e-10 m/Å (exact by definition) internal const double AngstromToMeters = 1e-10; + /// Nautical mile to meter conversion: 1852 m/nmi (exact by definition) + internal const double NauticalMileToMeters = 1852; + /// Pound mass to kilogram: 0.453592 kg/lb (exact) internal const double PoundMassToKilogram = 0.453592; @@ -37,12 +40,42 @@ internal static class ConversionConstants{ /// Metric ton to kilogram conversion: 1000 kg/t (exact by definition) internal const double TonToKilograms = 1000; + /// Stone to kilogram conversion: 6.35029318 kg/st (14 lb, exact) + internal const double StoneToKilograms = 6.35029318; + + /// Short ton to kilogram conversion: 907.18474 kg/ton (2000 lb, exact) + internal const double ShortTonToKilograms = 907.18474; + + /// Atomic mass unit to kilogram: 1.66053906660e-27 kg/u (2018 CODATA) + internal const double AtomicMassUnitToKilograms = 1.66053906660e-27; + /// Liter to cubic meter conversion: 0.001 m³/L (exact by definition) internal const double LiterToCubicMeters = 0.001; /// US gallon to cubic meter conversion: 0.003785411784 m³/gal (exact) internal const double GallonToCubicMeters = 0.003785411784; + /// Cubic centimeter to cubic meter: 1e-6 m³/cm³ (exact by definition) + internal const double CubicCentimeterToCubicMeters = 1e-6; + + /// Cubic foot to cubic meter: 0.028316846592 m³/ft³ (exact) + internal const double CubicFootToCubicMeters = 0.028316846592; + + /// Cubic inch to cubic meter: 1.6387064e-5 m³/in³ (exact) + internal const double CubicInchToCubicMeters = 1.6387064e-5; + + /// Imperial gallon to cubic meter: 0.00454609 m³/imp gal (exact by definition) + internal const double ImperialGallonToCubicMeters = 0.00454609; + + /// US liquid quart to cubic meter: 0.000946352946 m³/qt (exact) + internal const double USQuartToCubicMeters = 0.000946352946; + + /// US liquid pint to cubic meter: 0.000473176473 m³/pt (exact) + internal const double USPintToCubicMeters = 0.000473176473; + + /// US fluid ounce to cubic meter: 2.95735295625e-5 m³/fl oz (exact) + internal const double USFluidOunceToCubicMeters = 2.95735295625e-5; + /// Minute to second conversion: 60 s/min (exact) internal const double MinuteToSeconds = 60; @@ -55,18 +88,27 @@ internal static class ConversionConstants{ /// Year to second conversion: 31557600 s/year (365.25 days, exact) internal const double YearToSeconds = 31557600; + /// Week to second conversion: 604800 s/wk (exact) + internal const double WeekToSeconds = 604800; + /// Celsius to Kelvin temperature offset: 273.15 K (exact by definition) internal const double CelsiusToKelvinOffset = 273.15; - /// Fahrenheit degree scale factor: 9/5 = 1.8 (exact) - internal const double FahrenheitScale = 1.8; + /// Fahrenheit-to-Kelvin degree scale factor: 5/9 (exact) + internal const double FahrenheitScale = 0.5555555555555556; - /// Fahrenheit to Kelvin absolute offset: -459.67 K (exact) - internal const double FahrenheitToKelvinOffset = -459.67; + /// Fahrenheit to Kelvin affine offset: 459.67 × 5/9 ≈ 255.372 K (exact) + internal const double FahrenheitToKelvinOffset = 255.37222222222223; /// Degree to radian conversion: π/180 rad/° (exact) internal const double DegreeToRadians = 0.017453292519943295769236907684886127134428718885417254560971914401710091146034494436822415696345097379101040706699150667990539631694451077627806983; + /// Gradian to radian conversion: π/200 rad/grad (exact) + internal const double GradianToRadians = 0.015707963267948966; + + /// Revolution to radian conversion: 2π rad/rev (exact) + internal const double RevolutionToRadians = 6.283185307179586; + /// Calorie to joule conversion: 4.184 J/cal (exact, thermochemical calorie) internal const double CalorieToJoules = 4.184; @@ -79,6 +121,18 @@ internal static class ConversionConstants{ /// Electron volt to joule conversion: 1.602176634e-19 J/eV (exact, based on elementary charge) internal const double ElectronVoltToJoules = 1.602176634e-19; + /// Kilocalorie to joule conversion: 4184 J/kcal (exact, thermochemical) + internal const double KilocalorieToJoules = 4184; + + /// Watt-hour to joule conversion: 3600 J/Wh (exact) + internal const double WattHourToJoules = 3600; + + /// Erg to joule conversion: 1e-7 J/erg (exact by definition) + internal const double ErgToJoules = 1e-7; + + /// British thermal unit (IT) to joule conversion: 1055.05585262 J/BTU (exact) + internal const double BtuToJoules = 1055.05585262; + /// Bar to pascal conversion: 100000 Pa/bar (exact by definition) internal const double BarToPascals = 100000; @@ -88,6 +142,9 @@ internal static class ConversionConstants{ /// PSI to pascal conversion: 6894.757293168361 Pa/psi (exact) internal const double PsiToPascals = 6894.757293168361; + /// Torr to pascal conversion: 101325/760 ≈ 133.322 Pa/Torr (exact) + internal const double TorrToPascals = 133.32236842105263; + /// Square foot to square meter conversion: 0.09290304 m²/ft² (exact) internal const double SquareFootToSquareMeters = 0.09290304; @@ -97,12 +154,33 @@ internal static class ConversionConstants{ /// Barn to square meter conversion: 1e-28 m² (exact by definition) internal const double BarnToSquareMeters = 1e-28; + /// Square kilometer to square meter: 1e6 m²/km² (exact by definition) + internal const double SquareKilometerToSquareMeters = 1e6; + + /// Square centimeter to square meter: 1e-4 m²/cm² (exact by definition) + internal const double SquareCentimeterToSquareMeters = 1e-4; + + /// Square mile to square meter: 2589988.110336 m²/mi² (exact) + internal const double SquareMileToSquareMeters = 2589988.110336; + + /// Hectare to square meter: 10000 m²/ha (exact by definition) + internal const double HectareToSquareMeters = 10000; + + /// Acre to square meter: 4046.8564224 m²/ac (exact) + internal const double AcreToSquareMeters = 4046.8564224; + /// Kilometers per hour to meters per second conversion: 0.2777777777777778 m/s per km/h (exact) internal const double KilometersPerHourToMetersPerSecond = 0.2777777777777778; /// Miles per hour to meters per second conversion: 0.44704 m/s per mph (exact) internal const double MilesPerHourToMetersPerSecond = 0.44704; + /// Feet per second to meters per second: 0.3048 m/s per ft/s (exact) + internal const double FeetPerSecondToMetersPerSecond = 0.3048; + + /// Knot to meters per second: 1852/3600 ≈ 0.514444 m/s per kn (exact) + internal const double KnotToMetersPerSecond = 0.5144444444444445; + /// RPM to rad/s conversion: π/30 rad/s per rpm (exact) internal const double RevolutionsPerMinuteToRadiansPerSecond = 0.10471975511965977; @@ -112,6 +190,12 @@ internal static class ConversionConstants{ /// Molar to cubic meter concentration conversion: 1000.0 mol/m³ per mol/L (exact) internal const double MolarToCubicMeter = 1000.0; + /// Millimolar to mole per cubic meter: 1 mol/m³ per mM (exact) + internal const double MillimolarToMolePerCubicMeter = 1.0; + + /// Micromolar to mole per cubic meter: 0.001 mol/m³ per μM (exact) + internal const double MicromolarToMolePerCubicMeter = 0.001; + /// Stokes to square meter per second: 1e-4 m²/s per St (exact by definition) internal const double StokesToSquareMeterPerSecond = 1e-4; @@ -121,14 +205,68 @@ internal static class ConversionConstants{ /// Liter per second to cubic meter per second: 0.001 m³/s per L/s (exact by definition) internal const double LiterPerSecondToCubicMeterPerSecond = 0.001; + /// Centipoise to pascal second: 0.001 Pa·s per cP (exact by definition) + internal const double CentipoiseToPascalSecond = 0.001; + + /// Dyne per centimeter to newton per meter: 0.001 N/m per dyn/cm (exact) + internal const double DynePerCentimeterToNewtonPerMeter = 0.001; + + /// Gram per cubic centimeter to kilogram per cubic meter: 1000 kg/m³ per g/cm³ (exact) + internal const double GramPerCubicCentimeterToKilogramPerCubicMeter = 1000; + + /// Gram per liter to kilogram per cubic meter: 1 kg/m³ per g/L (exact) + internal const double GramPerLiterToKilogramPerCubicMeter = 1.0; + /// Gauss to Tesla: 1e-4 T per G (exact by definition) internal const double GaussToTesla = 1e-4; + /// Ampere-hour to coulomb conversion: 3600 C/Ah (exact) + internal const double AmpereHourToCoulombs = 3600; + /// Gram per mole to kilogram per mole: 0.001 kg/mol per g/mol (exact by definition) internal const double GramPerMoleToKilogramPerMole = 0.001; /// Kilojoule per mole to joule per mole: 1000 J/mol per kJ/mol (exact by definition) internal const double KilojoulePerMoleToJoulePerMole = 1000; + /// Calorie per mole to joule per mole: 4.184 J/mol per cal/mol (exact, thermochemical) + internal const double CaloriePerMoleToJoulePerMole = 4.184; + + /// Enzyme unit (1 μmol/min) to katal: 1/6e7 ≈ 1.6667e-8 kat/U (exact) + internal const double EnzymeUnitToKatals = 1.6666666666666667e-8; + + /// Standard gravity to meters per second squared: 9.80665 m/s² per g (exact by definition) + internal const double StandardGravityToMetersPerSecondSquared = 9.80665; + + /// Dyne to newton conversion: 1e-5 N/dyn (exact by definition) + internal const double DyneToNewtons = 1e-5; + + /// Pound-force to newton conversion: 4.4482216152605 N/lbf (exact) + internal const double PoundForceToNewtons = 4.4482216152605; + + /// Curie to becquerel conversion: 3.7e10 Bq/Ci (exact by definition) + internal const double CurieToBecquerels = 3.7e10; + + /// Rad to gray conversion: 0.01 Gy/rad (exact by definition) + internal const double RadToGrays = 0.01; + + /// Rem to sievert conversion: 0.01 Sv/rem (exact by definition) + internal const double RemToSieverts = 0.01; + + /// Roentgen to coulomb per kilogram: 2.58e-4 C/kg per R (exact by definition) + internal const double RoentgenToCoulombsPerKilogram = 2.58e-4; + + /// Foot-candle to lux conversion: 1/0.09290304 ≈ 10.7639 lx/fc (exact) + internal const double FootCandleToLux = 10.763910416709722; + + /// Parts per million to ratio: 1e-6 (exact by definition) + internal const double PartsPerMillionToRatio = 1e-6; + + /// Parts per billion to ratio: 1e-9 (exact by definition) + internal const double PartsPerBillionToRatio = 1e-9; + + /// Percent by weight to mass-fraction ratio: 0.01 (exact by definition) + internal const double PercentByWeightToRatio = 0.01; + }; diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.PhysicalConstantsGenerator/PhysicalConstants.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.PhysicalConstantsGenerator/PhysicalConstants.g.cs index f2bd10d..01327fe 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.PhysicalConstantsGenerator/PhysicalConstants.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.PhysicalConstantsGenerator/PhysicalConstants.g.cs @@ -15,6 +15,24 @@ namespace ktsu.Semantics.Quantities; /// public static class PhysicalConstants{ + /// + /// The physics of sound and vibration, including wave propagation, acoustic properties, sound intensity, frequency analysis, and audio-related measurements + /// + public static class Acoustics{ + /// Reference sound intensity: 1 × 10⁻¹² W/m² (threshold of hearing) + public static readonly PreciseNumber ReferenceSoundIntensity = PreciseNumber.Parse("1e-12", CultureInfo.InvariantCulture); + + /// Reference sound power: 1 × 10⁻¹² W + public static readonly PreciseNumber ReferenceSoundPower = PreciseNumber.Parse("1e-12", CultureInfo.InvariantCulture); + + /// Reference sound pressure: 20 × 10⁻⁶ Pa (threshold of hearing) + public static readonly PreciseNumber ReferenceSoundPressure = PreciseNumber.Parse("20e-6", CultureInfo.InvariantCulture); + + /// Sabine reverberation constant: 0.161 s/m + public static readonly PreciseNumber SabineConstant = PreciseNumber.Parse("0.161", CultureInfo.InvariantCulture); + + }; + /// /// Rotational motion and angular quantities, including angular velocity, angular acceleration, torque, and moment of inertia /// @@ -63,6 +81,18 @@ public static class ClassicalMechanics{ }; + /// + /// The study of fluids (liquids and gases) in motion and at rest, including fluid properties, flow dynamics, viscosity, pressure, and fluid-structure interactions + /// + public static class FluidMechanics{ + /// Standard air density at 15°C and 1 atm: 1.225 kg/m³ (ISO 2533) + public static readonly PreciseNumber StandardAirDensity = PreciseNumber.Parse("1.225", CultureInfo.InvariantCulture); + + /// Water surface tension at 20°C: 0.0728 N/m (NIST) + public static readonly PreciseNumber WaterSurfaceTension = PreciseNumber.Parse("0.0728", CultureInfo.InvariantCulture); + + }; + /// /// Basic physical quantities and constants that form the foundation of all other physics domains, including fundamental units like length, mass, time, and universal constants /// @@ -96,6 +126,27 @@ public static class Fundamental{ }; + /// + /// The study of atomic nuclei, radioactivity, nuclear reactions, decay processes, and radiation interactions with matter + /// + public static class NuclearPhysics{ + /// Atomic mass unit: 1.66053906660 × 10⁻²⁷ kg (2018 CODATA) + public static readonly PreciseNumber AtomicMassUnit = PreciseNumber.Parse("1.66053906660e-27", CultureInfo.InvariantCulture); + + /// Nuclear magneton: 5.0507837461 × 10⁻²⁷ J/T (2018 CODATA) + public static readonly PreciseNumber NuclearMagneton = PreciseNumber.Parse("5.0507837461e-27", CultureInfo.InvariantCulture); + + }; + + /// + /// The physics of light and optical phenomena, including electromagnetic radiation, photometry, illumination, optical properties, and light-matter interactions + /// + public static class Optics{ + /// Luminous efficacy of monochromatic radiation at 540 THz: 683 lm/W (exact, SI defining constant) + public static readonly PreciseNumber LuminousEfficacy = PreciseNumber.Parse("683.0", CultureInfo.InvariantCulture); + + }; + /// /// The physics of heat, temperature, and energy transfer, including thermal properties, heat capacity, entropy, and thermodynamic processes /// @@ -119,51 +170,69 @@ public static class Thermodynamics{ /// public static class Generic{ /// Gets absolute zero in celsius: 273.15 k (exact by definition) as type T. - public static T AbsoluteZeroInCelsius() where T : struct, INumber => T.CreateChecked(Thermodynamics.AbsoluteZeroInCelsius); + public static T AbsoluteZeroInCelsius() where T : struct, INumber => Thermodynamics.AbsoluteZeroInCelsius.To(); +/// Gets atomic mass unit: 1.66053906660 × 10⁻²⁷ kg (2018 codata) as type T. + public static T AtomicMassUnit() where T : struct, INumber => NuclearPhysics.AtomicMassUnit.To(); /// Gets avogadro's number: 6.02214076 × 10²³ entities/mol (exact, si defining constant) as type T. - public static T AvogadroNumber() where T : struct, INumber => T.CreateChecked(Fundamental.AvogadroNumber); + public static T AvogadroNumber() where T : struct, INumber => Fundamental.AvogadroNumber.To(); /// Gets boltzmann constant: 1.380649 × 10⁻²³ j/k (exact, si defining constant) as type T. - public static T BoltzmannConstant() where T : struct, INumber => T.CreateChecked(Fundamental.BoltzmannConstant); + public static T BoltzmannConstant() where T : struct, INumber => Fundamental.BoltzmannConstant.To(); /// Gets degrees per radian: 180/π ≈ 57.29577951308232 as type T. - public static T DegreesPerRadian() where T : struct, INumber => T.CreateChecked(AngularMechanics.DegreesPerRadian); + public static T DegreesPerRadian() where T : struct, INumber => AngularMechanics.DegreesPerRadian.To(); /// Gets elementary charge: 1.602176634 × 10⁻¹⁹ c (exact, si defining constant) as type T. - public static T ElementaryCharge() where T : struct, INumber => T.CreateChecked(Fundamental.ElementaryCharge); + public static T ElementaryCharge() where T : struct, INumber => Fundamental.ElementaryCharge.To(); /// Gets fine structure constant: 7.2973525693 × 10⁻³ (dimensionless, 2018 codata) as type T. - public static T FineStructureConstant() where T : struct, INumber => T.CreateChecked(Fundamental.FineStructureConstant); + public static T FineStructureConstant() where T : struct, INumber => Fundamental.FineStructureConstant.To(); /// Gets gas constant: 8.31446261815324 j/(mol·k) (exact, derived from avogadro and boltzmann constants) as type T. - public static T GasConstant() where T : struct, INumber => T.CreateChecked(Chemistry.GasConstant); + public static T GasConstant() where T : struct, INumber => Chemistry.GasConstant.To(); /// Gets gravitational constant: 6.67430 × 10⁻¹¹ m³/(kg⋅s²) (2018 codata) as type T. - public static T GravitationalConstant() where T : struct, INumber => T.CreateChecked(Fundamental.GravitationalConstant); + public static T GravitationalConstant() where T : struct, INumber => Fundamental.GravitationalConstant.To(); /// Gets natural logarithm of 2: 0.6931471805599453 as type T. - public static T Ln2() where T : struct, INumber => T.CreateChecked(Chemistry.Ln2); + public static T Ln2() where T : struct, INumber => Chemistry.Ln2.To(); +/// Gets luminous efficacy of monochromatic radiation at 540 thz: 683 lm/w (exact, si defining constant) as type T. + public static T LuminousEfficacy() where T : struct, INumber => Optics.LuminousEfficacy.To(); /// Gets molar volume of ideal gas at stp: 22.413969545014137 l/mol (calculated from r*t/p at 273.15k, 101325pa) as type T. - public static T MolarVolumeSTP() where T : struct, INumber => T.CreateChecked(Chemistry.MolarVolumeSTP); + public static T MolarVolumeSTP() where T : struct, INumber => Chemistry.MolarVolumeSTP.To(); /// Gets neutral ph value at 25°c: 7.0 as type T. - public static T NeutralPH() where T : struct, INumber => T.CreateChecked(Chemistry.NeutralPH); + public static T NeutralPH() where T : struct, INumber => Chemistry.NeutralPH.To(); +/// Gets nuclear magneton: 5.0507837461 × 10⁻²⁷ j/t (2018 codata) as type T. + public static T NuclearMagneton() where T : struct, INumber => NuclearPhysics.NuclearMagneton.To(); /// Gets magnetic permeability of free space: 4π × 10⁻⁷ h/m (exact by definition) as type T. - public static T PermeabilityOfFreeSpace() where T : struct, INumber => T.CreateChecked(Fundamental.PermeabilityOfFreeSpace); + public static T PermeabilityOfFreeSpace() where T : struct, INumber => Fundamental.PermeabilityOfFreeSpace.To(); /// Gets electric permittivity of free space: 8.8541878128 × 10⁻¹² f/m (exact, derived) as type T. - public static T PermittivityOfFreeSpace() where T : struct, INumber => T.CreateChecked(Fundamental.PermittivityOfFreeSpace); + public static T PermittivityOfFreeSpace() where T : struct, INumber => Fundamental.PermittivityOfFreeSpace.To(); /// Gets planck constant: 6.62607015 × 10⁻³⁴ j·s (exact, si defining constant) as type T. - public static T PlanckConstant() where T : struct, INumber => T.CreateChecked(Fundamental.PlanckConstant); + public static T PlanckConstant() where T : struct, INumber => Fundamental.PlanckConstant.To(); /// Gets radians per degree: π/180 ≈ 0.017453292519943295 as type T. - public static T RadiansPerDegree() where T : struct, INumber => T.CreateChecked(AngularMechanics.RadiansPerDegree); + public static T RadiansPerDegree() where T : struct, INumber => AngularMechanics.RadiansPerDegree.To(); +/// Gets reference sound intensity: 1 × 10⁻¹² w/m² (threshold of hearing) as type T. + public static T ReferenceSoundIntensity() where T : struct, INumber => Acoustics.ReferenceSoundIntensity.To(); +/// Gets reference sound power: 1 × 10⁻¹² w as type T. + public static T ReferenceSoundPower() where T : struct, INumber => Acoustics.ReferenceSoundPower.To(); +/// Gets reference sound pressure: 20 × 10⁻⁶ pa (threshold of hearing) as type T. + public static T ReferenceSoundPressure() where T : struct, INumber => Acoustics.ReferenceSoundPressure.To(); +/// Gets sabine reverberation constant: 0.161 s/m as type T. + public static T SabineConstant() where T : struct, INumber => Acoustics.SabineConstant.To(); /// Gets speed of light in vacuum: 299,792,458 m/s (exact, si defining constant) as type T. - public static T SpeedOfLight() where T : struct, INumber => T.CreateChecked(Fundamental.SpeedOfLight); + public static T SpeedOfLight() where T : struct, INumber => Fundamental.SpeedOfLight.To(); +/// Gets standard air density at 15°c and 1 atm: 1.225 kg/m³ (iso 2533) as type T. + public static T StandardAirDensity() where T : struct, INumber => FluidMechanics.StandardAirDensity.To(); /// Gets standard atmospheric pressure: 101,325 pa (exact by definition) as type T. - public static T StandardAtmosphericPressure() where T : struct, INumber => T.CreateChecked(ClassicalMechanics.StandardAtmosphericPressure); + public static T StandardAtmosphericPressure() where T : struct, INumber => ClassicalMechanics.StandardAtmosphericPressure.To(); /// Gets standard gravitational acceleration: 9.80665 m/s² (exact by definition) as type T. - public static T StandardGravity() where T : struct, INumber => T.CreateChecked(ClassicalMechanics.StandardGravity); + public static T StandardGravity() where T : struct, INumber => ClassicalMechanics.StandardGravity.To(); /// Gets standard temperature (stp): 273.15 k (0°c) as type T. - public static T StandardTemperature() where T : struct, INumber => T.CreateChecked(Thermodynamics.StandardTemperature); + public static T StandardTemperature() where T : struct, INumber => Thermodynamics.StandardTemperature.To(); /// Gets 2π - full rotation in radians: 6.283185307179586 as type T. - public static T TwoPi() where T : struct, INumber => T.CreateChecked(AngularMechanics.TwoPi); + public static T TwoPi() where T : struct, INumber => AngularMechanics.TwoPi.To(); /// Gets water boiling point at 1 atm: 373.15 k (100°c) as type T. - public static T WaterBoilingPoint() where T : struct, INumber => T.CreateChecked(Thermodynamics.WaterBoilingPoint); + public static T WaterBoilingPoint() where T : struct, INumber => Thermodynamics.WaterBoilingPoint.To(); /// Gets water ion product (kw) at 25°c: 1.0 × 10⁻¹⁴ (pkw = 14.0) as type T. - public static T WaterIonProduct() where T : struct, INumber => T.CreateChecked(Chemistry.WaterIonProduct); + public static T WaterIonProduct() where T : struct, INumber => Chemistry.WaterIonProduct.To(); +/// Gets water surface tension at 20°c: 0.0728 n/m (nist) as type T. + public static T WaterSurfaceTension() where T : struct, INumber => FluidMechanics.WaterSurfaceTension.To(); /// Gets water triple point: 273.16 k (exact by definition) as type T. - public static T WaterTriplePoint() where T : struct, INumber => T.CreateChecked(Thermodynamics.WaterTriplePoint); + public static T WaterTriplePoint() where T : struct, INumber => Thermodynamics.WaterTriplePoint.To(); }; }; diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AbsorbedDose.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AbsorbedDose.g.cs index c64f718..4c6bdb9 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AbsorbedDose.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AbsorbedDose.g.cs @@ -27,6 +27,13 @@ public record AbsorbedDose : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static AbsorbedDose FromGrays(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Rad. + /// + /// The value in Rad. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static AbsorbedDose FromRads(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.RadToGrays)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-AbsorbedDose unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Acceleration1D.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Acceleration1D.g.cs index e796dc0..79a72d0 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Acceleration1D.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Acceleration1D.g.cs @@ -26,6 +26,12 @@ public record Acceleration1D : PhysicalQuantity, T>, IVecto /// The value in MetersPerSecondSquared. /// A new instance. public static Acceleration1D FromMetersPerSecondSquared(T value) => Create(value); +/// + /// Creates a new from a value in StandardGravity. + /// + /// The value in StandardGravity. + /// A new instance. + public static Acceleration1D FromStandardGravity(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.StandardGravityToMetersPerSecondSquared))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Acceleration unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AccelerationMagnitude.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AccelerationMagnitude.g.cs index 611f74c..d047cf9 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AccelerationMagnitude.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AccelerationMagnitude.g.cs @@ -27,6 +27,13 @@ public record AccelerationMagnitude : PhysicalQuantityA new instance. /// Thrown when the resulting magnitude would be negative. public static AccelerationMagnitude FromMetersPerSecondSquared(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in StandardGravity. + /// + /// The value in StandardGravity. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static AccelerationMagnitude FromStandardGravity(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.StandardGravityToMetersPerSecondSquared)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Acceleration unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ActivationEnergy.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ActivationEnergy.g.cs index 561c5d9..7eb88f3 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ActivationEnergy.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ActivationEnergy.g.cs @@ -35,6 +35,13 @@ public record ActivationEnergy : PhysicalQuantity, T>, IV /// A new ActivationEnergy instance. /// Thrown when the resulting magnitude would be negative. public static ActivationEnergy FromKilojoulePerMole(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilojoulePerMoleToJoulePerMole)), nameof(value))); +/// + /// Creates a new ActivationEnergy from a value in CaloriePerMole. + /// + /// The value in CaloriePerMole. + /// A new ActivationEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static ActivationEnergy FromCaloriesPerMole(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CaloriePerMoleToJoulePerMole)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-MolarEnergy unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Airspeed.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Airspeed.g.cs index 7f916e4..4e23973 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Airspeed.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Airspeed.g.cs @@ -42,6 +42,20 @@ public record Airspeed : PhysicalQuantity, T>, IVector0A new Airspeed instance. /// Thrown when the resulting magnitude would be negative. public static Airspeed FromMilesPerHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MilesPerHourToMetersPerSecond)), nameof(value))); +/// + /// Creates a new Airspeed from a value in FeetPerSecond. + /// + /// The value in FeetPerSecond. + /// A new Airspeed instance. + /// Thrown when the resulting magnitude would be negative. + public static Airspeed FromFeetPerSecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetPerSecondToMetersPerSecond)), nameof(value))); +/// + /// Creates a new Airspeed from a value in Knot. + /// + /// The value in Knot. + /// A new Airspeed instance. + /// Thrown when the resulting magnitude would be negative. + public static Airspeed FromKnots(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KnotToMetersPerSecond)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Velocity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Altitude.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Altitude.g.cs index 817ec29..821fb8b 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Altitude.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Altitude.g.cs @@ -98,6 +98,13 @@ public record Altitude : PhysicalQuantity, T>, IVector0A new Altitude instance. /// Thrown when the resulting magnitude would be negative. public static Altitude FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); +/// + /// Creates a new Altitude from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new Altitude instance. + /// Thrown when the resulting magnitude would be negative. + public static Altitude FromNauticalMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AmountOfSubstance.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AmountOfSubstance.g.cs index 00d6f87..30f4040 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AmountOfSubstance.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AmountOfSubstance.g.cs @@ -27,6 +27,20 @@ public record AmountOfSubstance : PhysicalQuantity, T>, /// A new instance. /// Thrown when the resulting magnitude would be negative. public static AmountOfSubstance FromMoles(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Kilomole. + /// + /// The value in Kilomole. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static AmountOfSubstance FromKilomoles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new from a value in Millimole. + /// + /// The value in Millimole. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static AmountOfSubstance FromMillimoles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-AmountOfSubstance unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Angle.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Angle.g.cs index d778edd..c3845b5 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Angle.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Angle.g.cs @@ -34,6 +34,27 @@ public record Angle : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Angle FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); +/// + /// Creates a new from a value in Gradian. + /// + /// The value in Gradian. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Angle FromGradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians)), nameof(value))); +/// + /// Creates a new from a value in Revolution. + /// + /// The value in Revolution. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Angle FromRevolutions(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians)), nameof(value))); +/// + /// Creates a new from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Angle FromMilliradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-AngularDisplacement unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ApertureAngle.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ApertureAngle.g.cs index 51dc7a0..f1988a2 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ApertureAngle.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ApertureAngle.g.cs @@ -35,6 +35,27 @@ public record ApertureAngle : PhysicalQuantity, T>, IVector0 /// A new ApertureAngle instance. /// Thrown when the resulting magnitude would be negative. public static ApertureAngle FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); +/// + /// Creates a new ApertureAngle from a value in Gradian. + /// + /// The value in Gradian. + /// A new ApertureAngle instance. + /// Thrown when the resulting magnitude would be negative. + public static ApertureAngle FromGradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians)), nameof(value))); +/// + /// Creates a new ApertureAngle from a value in Revolution. + /// + /// The value in Revolution. + /// A new ApertureAngle instance. + /// Thrown when the resulting magnitude would be negative. + public static ApertureAngle FromRevolutions(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians)), nameof(value))); +/// + /// Creates a new ApertureAngle from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new ApertureAngle instance. + /// Thrown when the resulting magnitude would be negative. + public static ApertureAngle FromMilliradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-AngularDisplacement unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Area.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Area.g.cs index 5460bf6..26ffd39 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Area.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Area.g.cs @@ -27,6 +27,20 @@ public record Area : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Area FromSquareMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in SquareKilometer. + /// + /// The value in SquareKilometer. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Area FromSquareKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareKilometerToSquareMeters)), nameof(value))); +/// + /// Creates a new from a value in SquareCentimeter. + /// + /// The value in SquareCentimeter. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Area FromSquareCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareCentimeterToSquareMeters)), nameof(value))); /// /// Creates a new from a value in SquareFoot. /// @@ -41,6 +55,27 @@ public record Area : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Area FromSquareInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareInchToSquareMeters)), nameof(value))); +/// + /// Creates a new from a value in SquareMile. + /// + /// The value in SquareMile. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Area FromSquareMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareMileToSquareMeters)), nameof(value))); +/// + /// Creates a new from a value in Hectare. + /// + /// The value in Hectare. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Area FromHectares(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HectareToSquareMeters)), nameof(value))); +/// + /// Creates a new from a value in Acre. + /// + /// The value in Acre. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Area FromAcres(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AcreToSquareMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Area unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AtmosphericPressure.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AtmosphericPressure.g.cs index ba46e30..3197da1 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AtmosphericPressure.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AtmosphericPressure.g.cs @@ -28,6 +28,13 @@ public record AtmosphericPressure : PhysicalQuantity, /// A new AtmosphericPressure instance. /// Thrown when the resulting magnitude would be negative. public static AtmosphericPressure FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new AtmosphericPressure from a value in Kilopascal. + /// + /// The value in Kilopascal. + /// A new AtmosphericPressure instance. + /// Thrown when the resulting magnitude would be negative. + public static AtmosphericPressure FromKilopascals(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new AtmosphericPressure from a value in Bar. /// @@ -49,6 +56,13 @@ public record AtmosphericPressure : PhysicalQuantity, /// A new AtmosphericPressure instance. /// Thrown when the resulting magnitude would be negative. public static AtmosphericPressure FromPsi(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PsiToPascals)), nameof(value))); +/// + /// Creates a new AtmosphericPressure from a value in Torr. + /// + /// The value in Torr. + /// A new AtmosphericPressure instance. + /// Thrown when the resulting magnitude would be negative. + public static AtmosphericPressure FromTorr(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.TorrToPascals)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Pressure unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AtomicMass.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AtomicMass.g.cs index 328bcfa..75e1186 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AtomicMass.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/AtomicMass.g.cs @@ -56,6 +56,27 @@ public record AtomicMass : PhysicalQuantity, T>, IVector0A new AtomicMass instance. /// Thrown when the resulting magnitude would be negative. public static AtomicMass FromOunces(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.OunceToKilograms)), nameof(value))); +/// + /// Creates a new AtomicMass from a value in Stone. + /// + /// The value in Stone. + /// A new AtomicMass instance. + /// Thrown when the resulting magnitude would be negative. + public static AtomicMass FromStone(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.StoneToKilograms)), nameof(value))); +/// + /// Creates a new AtomicMass from a value in ShortTon. + /// + /// The value in ShortTon. + /// A new AtomicMass instance. + /// Thrown when the resulting magnitude would be negative. + public static AtomicMass FromShortTons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ShortTonToKilograms)), nameof(value))); +/// + /// Creates a new AtomicMass from a value in AtomicMassUnit. + /// + /// The value in AtomicMassUnit. + /// A new AtomicMass instance. + /// Thrown when the resulting magnitude would be negative. + public static AtomicMass FromAtomicMassUnits(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtomicMassUnitToKilograms)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Mass unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Bandwidth.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Bandwidth.g.cs index 271c3d9..0581ace 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Bandwidth.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Bandwidth.g.cs @@ -28,6 +28,20 @@ public record Bandwidth : PhysicalQuantity, T>, IVector0A new Bandwidth instance. /// Thrown when the resulting magnitude would be negative. public static Bandwidth FromHertz(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Bandwidth from a value in Kilohertz. + /// + /// The value in Kilohertz. + /// A new Bandwidth instance. + /// Thrown when the resulting magnitude would be negative. + public static Bandwidth FromKilohertz(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new Bandwidth from a value in Megahertz. + /// + /// The value in Megahertz. + /// A new Bandwidth instance. + /// Thrown when the resulting magnitude would be negative. + public static Bandwidth FromMegahertz(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Mega)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Frequency unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Bearing.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Bearing.g.cs index c631da2..beb14c5 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Bearing.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Bearing.g.cs @@ -33,6 +33,24 @@ public record Bearing : PhysicalQuantity, T>, IVector1, /// The value in Degree. /// A new Bearing instance. public static Bearing FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); +/// + /// Creates a new Bearing from a value in Gradian. + /// + /// The value in Gradian. + /// A new Bearing instance. + public static Bearing FromGradians(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians))); +/// + /// Creates a new Bearing from a value in Revolution. + /// + /// The value in Revolution. + /// A new Bearing instance. + public static Bearing FromRevolutions(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians))); +/// + /// Creates a new Bearing from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new Bearing instance. + public static Bearing FromMilliradians(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Milli))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-AngularDisplacement unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/BulkModulus.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/BulkModulus.g.cs index 9b3e22c..8b6a759 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/BulkModulus.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/BulkModulus.g.cs @@ -28,6 +28,13 @@ public record BulkModulus : PhysicalQuantity, T>, IVector0A new BulkModulus instance. /// Thrown when the resulting magnitude would be negative. public static BulkModulus FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new BulkModulus from a value in Kilopascal. + /// + /// The value in Kilopascal. + /// A new BulkModulus instance. + /// Thrown when the resulting magnitude would be negative. + public static BulkModulus FromKilopascals(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new BulkModulus from a value in Bar. /// @@ -49,6 +56,13 @@ public record BulkModulus : PhysicalQuantity, T>, IVector0A new BulkModulus instance. /// Thrown when the resulting magnitude would be negative. public static BulkModulus FromPsi(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PsiToPascals)), nameof(value))); +/// + /// Creates a new BulkModulus from a value in Torr. + /// + /// The value in Torr. + /// A new BulkModulus instance. + /// Thrown when the resulting magnitude would be negative. + public static BulkModulus FromTorr(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.TorrToPascals)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Pressure unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Capacitance.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Capacitance.g.cs index 7861fdf..919aa15 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Capacitance.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Capacitance.g.cs @@ -27,6 +27,27 @@ public record Capacitance : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static Capacitance FromFarads(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Microfarad. + /// + /// The value in Microfarad. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Capacitance FromMicrofarads(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); +/// + /// Creates a new from a value in Nanofarad. + /// + /// The value in Nanofarad. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Capacitance FromNanofarads(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); +/// + /// Creates a new from a value in Picofarad. + /// + /// The value in Picofarad. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Capacitance FromPicofarads(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Pico)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-ElectricCapacitance unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Capacity.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Capacity.g.cs index b9dbd28..799bd55 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Capacity.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Capacity.g.cs @@ -42,6 +42,27 @@ public record Capacity : PhysicalQuantity, T>, IVector0A new Capacity instance. /// Thrown when the resulting magnitude would be negative. public static Capacity FromMilliliters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); +/// + /// Creates a new Capacity from a value in CubicCentimeter. + /// + /// The value in CubicCentimeter. + /// A new Capacity instance. + /// Thrown when the resulting magnitude would be negative. + public static Capacity FromCubicCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CubicCentimeterToCubicMeters)), nameof(value))); +/// + /// Creates a new Capacity from a value in CubicFoot. + /// + /// The value in CubicFoot. + /// A new Capacity instance. + /// Thrown when the resulting magnitude would be negative. + public static Capacity FromCubicFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CubicFootToCubicMeters)), nameof(value))); +/// + /// Creates a new Capacity from a value in CubicInch. + /// + /// The value in CubicInch. + /// A new Capacity instance. + /// Thrown when the resulting magnitude would be negative. + public static Capacity FromCubicInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CubicInchToCubicMeters)), nameof(value))); /// /// Creates a new Capacity from a value in Gallon. /// @@ -49,6 +70,34 @@ public record Capacity : PhysicalQuantity, T>, IVector0A new Capacity instance. /// Thrown when the resulting magnitude would be negative. public static Capacity FromGallons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GallonToCubicMeters)), nameof(value))); +/// + /// Creates a new Capacity from a value in ImperialGallon. + /// + /// The value in ImperialGallon. + /// A new Capacity instance. + /// Thrown when the resulting magnitude would be negative. + public static Capacity FromImperialGallons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ImperialGallonToCubicMeters)), nameof(value))); +/// + /// Creates a new Capacity from a value in USQuart. + /// + /// The value in USQuart. + /// A new Capacity instance. + /// Thrown when the resulting magnitude would be negative. + public static Capacity FromUSQuarts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.USQuartToCubicMeters)), nameof(value))); +/// + /// Creates a new Capacity from a value in USPint. + /// + /// The value in USPint. + /// A new Capacity instance. + /// Thrown when the resulting magnitude would be negative. + public static Capacity FromUSPints(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.USPintToCubicMeters)), nameof(value))); +/// + /// Creates a new Capacity from a value in USFluidOunce. + /// + /// The value in USFluidOunce. + /// A new Capacity instance. + /// Thrown when the resulting magnitude would be negative. + public static Capacity FromUSFluidOunces(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.USFluidOunceToCubicMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Volume unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CatalyticActivity.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CatalyticActivity.g.cs index 9e26ef6..94a26a4 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CatalyticActivity.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CatalyticActivity.g.cs @@ -27,6 +27,13 @@ public record CatalyticActivity : PhysicalQuantity, T>, /// A new instance. /// Thrown when the resulting magnitude would be negative. public static CatalyticActivity FromKatals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in EnzymeUnit. + /// + /// The value in EnzymeUnit. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static CatalyticActivity FromEnzymeUnits(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.EnzymeUnitToKatals)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-CatalyticActivity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Charge.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Charge.g.cs index a127ee9..cc1773b 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Charge.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Charge.g.cs @@ -26,6 +26,12 @@ public record Charge : PhysicalQuantity, T>, IVector1, T> /// The value in Coulomb. /// A new instance. public static Charge FromCoulombs(T value) => Create(value); +/// + /// Creates a new from a value in AmpereHour. + /// + /// The value in AmpereHour. + /// A new instance. + public static Charge FromAmpereHours(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.AmpereHourToCoulombs))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-ElectricCharge unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ChargeMagnitude.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ChargeMagnitude.g.cs index c9926c0..a9d5acd 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ChargeMagnitude.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ChargeMagnitude.g.cs @@ -27,6 +27,13 @@ public record ChargeMagnitude : PhysicalQuantity, T>, IVec /// A new instance. /// Thrown when the resulting magnitude would be negative. public static ChargeMagnitude FromCoulombs(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in AmpereHour. + /// + /// The value in AmpereHour. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static ChargeMagnitude FromAmpereHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AmpereHourToCoulombs)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-ElectricCharge unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ClockSpeed.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ClockSpeed.g.cs index c1ba1aa..c727420 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ClockSpeed.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ClockSpeed.g.cs @@ -28,6 +28,20 @@ public record ClockSpeed : PhysicalQuantity, T>, IVector0A new ClockSpeed instance. /// Thrown when the resulting magnitude would be negative. public static ClockSpeed FromHertz(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new ClockSpeed from a value in Kilohertz. + /// + /// The value in Kilohertz. + /// A new ClockSpeed instance. + /// Thrown when the resulting magnitude would be negative. + public static ClockSpeed FromKilohertz(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new ClockSpeed from a value in Megahertz. + /// + /// The value in Megahertz. + /// A new ClockSpeed instance. + /// Thrown when the resulting magnitude would be negative. + public static ClockSpeed FromMegahertz(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Mega)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Frequency unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Concentration.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Concentration.g.cs index 9098816..5f62773 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Concentration.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Concentration.g.cs @@ -27,6 +27,20 @@ public record Concentration : PhysicalQuantity, T>, IVector0 /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Concentration FromMolars(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Millimolar. + /// + /// The value in Millimolar. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Concentration FromMillimolars(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MillimolarToMolePerCubicMeter)), nameof(value))); +/// + /// Creates a new from a value in Micromolar. + /// + /// The value in Micromolar. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Concentration FromMicromolars(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MicromolarToMolePerCubicMeter)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Concentration unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CrossSectionalArea.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CrossSectionalArea.g.cs index ca073c0..9021aea 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CrossSectionalArea.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CrossSectionalArea.g.cs @@ -28,6 +28,20 @@ public record CrossSectionalArea : PhysicalQuantity, T> /// A new CrossSectionalArea instance. /// Thrown when the resulting magnitude would be negative. public static CrossSectionalArea FromSquareMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new CrossSectionalArea from a value in SquareKilometer. + /// + /// The value in SquareKilometer. + /// A new CrossSectionalArea instance. + /// Thrown when the resulting magnitude would be negative. + public static CrossSectionalArea FromSquareKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareKilometerToSquareMeters)), nameof(value))); +/// + /// Creates a new CrossSectionalArea from a value in SquareCentimeter. + /// + /// The value in SquareCentimeter. + /// A new CrossSectionalArea instance. + /// Thrown when the resulting magnitude would be negative. + public static CrossSectionalArea FromSquareCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareCentimeterToSquareMeters)), nameof(value))); /// /// Creates a new CrossSectionalArea from a value in SquareFoot. /// @@ -42,6 +56,27 @@ public record CrossSectionalArea : PhysicalQuantity, T> /// A new CrossSectionalArea instance. /// Thrown when the resulting magnitude would be negative. public static CrossSectionalArea FromSquareInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareInchToSquareMeters)), nameof(value))); +/// + /// Creates a new CrossSectionalArea from a value in SquareMile. + /// + /// The value in SquareMile. + /// A new CrossSectionalArea instance. + /// Thrown when the resulting magnitude would be negative. + public static CrossSectionalArea FromSquareMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareMileToSquareMeters)), nameof(value))); +/// + /// Creates a new CrossSectionalArea from a value in Hectare. + /// + /// The value in Hectare. + /// A new CrossSectionalArea instance. + /// Thrown when the resulting magnitude would be negative. + public static CrossSectionalArea FromHectares(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HectareToSquareMeters)), nameof(value))); +/// + /// Creates a new CrossSectionalArea from a value in Acre. + /// + /// The value in Acre. + /// A new CrossSectionalArea instance. + /// Thrown when the resulting magnitude would be negative. + public static CrossSectionalArea FromAcres(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AcreToSquareMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Area unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Current1D.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Current1D.g.cs index 0a278e5..9663e49 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Current1D.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Current1D.g.cs @@ -26,6 +26,18 @@ public record Current1D : PhysicalQuantity, T>, IVector1The value in Ampere. /// A new instance. public static Current1D FromAmperes(T value) => Create(value); +/// + /// Creates a new from a value in Milliampere. + /// + /// The value in Milliampere. + /// A new instance. + public static Current1D FromMilliamperes(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Milli))); +/// + /// Creates a new from a value in Kiloampere. + /// + /// The value in Kiloampere. + /// A new instance. + public static Current1D FromKiloamperes(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Kilo))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-ElectricCurrent unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CurrentMagnitude.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CurrentMagnitude.g.cs index 775d99c..7046e87 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CurrentMagnitude.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/CurrentMagnitude.g.cs @@ -27,6 +27,20 @@ public record CurrentMagnitude : PhysicalQuantity, T>, IV /// A new instance. /// Thrown when the resulting magnitude would be negative. public static CurrentMagnitude FromAmperes(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Milliampere. + /// + /// The value in Milliampere. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static CurrentMagnitude FromMilliamperes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); +/// + /// Creates a new from a value in Kiloampere. + /// + /// The value in Kiloampere. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static CurrentMagnitude FromKiloamperes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-ElectricCurrent unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/DecayTime.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/DecayTime.g.cs index 0322d30..6fdcf20 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/DecayTime.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/DecayTime.g.cs @@ -70,6 +70,20 @@ public record DecayTime : PhysicalQuantity, T>, IVector0A new DecayTime instance. /// Thrown when the resulting magnitude would be negative. public static DecayTime FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); +/// + /// Creates a new DecayTime from a value in Week. + /// + /// The value in Week. + /// A new DecayTime instance. + /// Thrown when the resulting magnitude would be negative. + public static DecayTime FromWeeks(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.WeekToSeconds)), nameof(value))); +/// + /// Creates a new DecayTime from a value in Nanosecond. + /// + /// The value in Nanosecond. + /// A new DecayTime instance. + /// Thrown when the resulting magnitude would be negative. + public static DecayTime FromNanoseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Time unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Density.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Density.g.cs index 86e4074..62a68aa 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Density.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Density.g.cs @@ -27,6 +27,20 @@ public record Density : PhysicalQuantity, T>, IVector0, /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Density FromKilogramPerCubicMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in GramPerCubicCentimeter. + /// + /// The value in GramPerCubicCentimeter. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Density FromGramPerCubicCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GramPerCubicCentimeterToKilogramPerCubicMeter)), nameof(value))); +/// + /// Creates a new from a value in GramPerLiter. + /// + /// The value in GramPerLiter. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Density FromGramPerLiter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GramPerLiterToKilogramPerCubicMeter)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Density unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Depth.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Depth.g.cs index 21bf275..907eb87 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Depth.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Depth.g.cs @@ -98,6 +98,13 @@ public record Depth : PhysicalQuantity, T>, IVector0, T> /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. public static Depth FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); +/// + /// Creates a new Depth from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new Depth instance. + /// Thrown when the resulting magnitude would be negative. + public static Depth FromNauticalMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Diameter.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Diameter.g.cs index 2cd94ea..33608c4 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Diameter.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Diameter.g.cs @@ -98,6 +98,13 @@ public record Diameter : PhysicalQuantity, T>, IVector0A new Diameter instance. /// Thrown when the resulting magnitude would be negative. public static Diameter FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); +/// + /// Creates a new Diameter from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new Diameter instance. + /// Thrown when the resulting magnitude would be negative. + public static Diameter FromNauticalMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Displacement1D.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Displacement1D.g.cs index 58b3324..8829882 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Displacement1D.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Displacement1D.g.cs @@ -86,6 +86,12 @@ public record Displacement1D : PhysicalQuantity, T>, IVecto /// The value in Mile. /// A new instance. public static Displacement1D FromMiles(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.MileToMeters))); +/// + /// Creates a new from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new instance. + public static Displacement1D FromNauticalMiles(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Distance.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Distance.g.cs index 1901fcf..227d71b 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Distance.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Distance.g.cs @@ -98,6 +98,13 @@ public record Distance : PhysicalQuantity, T>, IVector0A new Distance instance. /// Thrown when the resulting magnitude would be negative. public static Distance FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); +/// + /// Creates a new Distance from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new Distance instance. + /// Thrown when the resulting magnitude would be negative. + public static Distance FromNauticalMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Drag.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Drag.g.cs index e1b3fed..d8c147e 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Drag.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Drag.g.cs @@ -28,6 +28,27 @@ public record Drag : PhysicalQuantity, T>, IVector0, T> /// A new Drag instance. /// Thrown when the resulting magnitude would be negative. public static Drag FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Drag from a value in Kilonewton. + /// + /// The value in Kilonewton. + /// A new Drag instance. + /// Thrown when the resulting magnitude would be negative. + public static Drag FromKilonewtons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new Drag from a value in Dyne. + /// + /// The value in Dyne. + /// A new Drag instance. + /// Thrown when the resulting magnitude would be negative. + public static Drag FromDynes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DyneToNewtons)), nameof(value))); +/// + /// Creates a new Drag from a value in PoundForce. + /// + /// The value in PoundForce. + /// A new Drag instance. + /// Thrown when the resulting magnitude would be negative. + public static Drag FromPoundsForce(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundForceToNewtons)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Force unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Duration.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Duration.g.cs index 32e9cd4..da77e83 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Duration.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Duration.g.cs @@ -69,6 +69,20 @@ public record Duration : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static Duration FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); +/// + /// Creates a new from a value in Week. + /// + /// The value in Week. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Duration FromWeeks(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.WeekToSeconds)), nameof(value))); +/// + /// Creates a new from a value in Nanosecond. + /// + /// The value in Nanosecond. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Duration FromNanoseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Time unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/DynamicViscosity.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/DynamicViscosity.g.cs index a56d7a6..f670bbb 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/DynamicViscosity.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/DynamicViscosity.g.cs @@ -34,6 +34,13 @@ public record DynamicViscosity : PhysicalQuantity, T>, IV /// A new instance. /// Thrown when the resulting magnitude would be negative. public static DynamicViscosity FromPoise(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoiseToPascalSecond)), nameof(value))); +/// + /// Creates a new from a value in Centipoise. + /// + /// The value in Centipoise. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static DynamicViscosity FromCentipoise(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CentipoiseToPascalSecond)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-DynamicViscosity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EMF.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EMF.g.cs index 7ac2c54..5d05252 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EMF.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EMF.g.cs @@ -28,6 +28,13 @@ public record EMF : PhysicalQuantity, T>, IVector0, T> /// A new EMF instance. /// Thrown when the resulting magnitude would be negative. public static EMF FromVolts(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new EMF from a value in Kilovolt. + /// + /// The value in Kilovolt. + /// A new EMF instance. + /// Thrown when the resulting magnitude would be negative. + public static EMF FromKilovolts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-ElectricPotential unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Energy.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Energy.g.cs index 5b8043b..0a3a58a 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Energy.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Energy.g.cs @@ -27,6 +27,13 @@ public record Energy : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Energy FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Kilojoule. + /// + /// The value in Kilojoule. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Energy FromKilojoules(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new from a value in ElectronVolt. /// @@ -41,6 +48,13 @@ public record Energy : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Energy FromCalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); +/// + /// Creates a new from a value in Kilocalorie. + /// + /// The value in Kilocalorie. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Energy FromKilocalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilocalorieToJoules)), nameof(value))); /// /// Creates a new from a value in KilowattHour. /// @@ -48,6 +62,27 @@ public record Energy : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Energy FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); +/// + /// Creates a new from a value in WattHour. + /// + /// The value in WattHour. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Energy FromWattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.WattHourToJoules)), nameof(value))); +/// + /// Creates a new from a value in Erg. + /// + /// The value in Erg. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Energy FromErgs(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ErgToJoules)), nameof(value))); +/// + /// Creates a new from a value in Btu. + /// + /// The value in Btu. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Energy FromBtus(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BtuToJoules)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Energy unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EnzymeActivity.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EnzymeActivity.g.cs index 5fabeb5..265bced 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EnzymeActivity.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EnzymeActivity.g.cs @@ -28,6 +28,13 @@ public record EnzymeActivity : PhysicalQuantity, T>, IVecto /// A new EnzymeActivity instance. /// Thrown when the resulting magnitude would be negative. public static EnzymeActivity FromKatals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new EnzymeActivity from a value in EnzymeUnit. + /// + /// The value in EnzymeUnit. + /// A new EnzymeActivity instance. + /// Thrown when the resulting magnitude would be negative. + public static EnzymeActivity FromEnzymeUnits(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.EnzymeUnitToKatals)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-CatalyticActivity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EquivalentDose.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EquivalentDose.g.cs index a162216..5c48468 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EquivalentDose.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/EquivalentDose.g.cs @@ -27,6 +27,13 @@ public record EquivalentDose : PhysicalQuantity, T>, IVecto /// A new instance. /// Thrown when the resulting magnitude would be negative. public static EquivalentDose FromSieverts(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Rem. + /// + /// The value in Rem. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static EquivalentDose FromRems(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.RemToSieverts)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-EquivalentDose unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Exposure.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Exposure.g.cs index 016b97a..65e2f0c 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Exposure.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Exposure.g.cs @@ -27,6 +27,13 @@ public record Exposure : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static Exposure FromCoulombPerKilogram(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Roentgen. + /// + /// The value in Roentgen. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Exposure FromRoentgens(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.RoentgenToCoulombsPerKilogram)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Exposure unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/FieldOfView.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/FieldOfView.g.cs index 143baf5..0d201c1 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/FieldOfView.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/FieldOfView.g.cs @@ -35,6 +35,27 @@ public record FieldOfView : PhysicalQuantity, T>, IVector0A new FieldOfView instance. /// Thrown when the resulting magnitude would be negative. public static FieldOfView FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); +/// + /// Creates a new FieldOfView from a value in Gradian. + /// + /// The value in Gradian. + /// A new FieldOfView instance. + /// Thrown when the resulting magnitude would be negative. + public static FieldOfView FromGradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians)), nameof(value))); +/// + /// Creates a new FieldOfView from a value in Revolution. + /// + /// The value in Revolution. + /// A new FieldOfView instance. + /// Thrown when the resulting magnitude would be negative. + public static FieldOfView FromRevolutions(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians)), nameof(value))); +/// + /// Creates a new FieldOfView from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new FieldOfView instance. + /// Thrown when the resulting magnitude would be negative. + public static FieldOfView FromMilliradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-AngularDisplacement unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/FlowSpeed.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/FlowSpeed.g.cs index 9bbb83a..abae302 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/FlowSpeed.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/FlowSpeed.g.cs @@ -42,6 +42,20 @@ public record FlowSpeed : PhysicalQuantity, T>, IVector0A new FlowSpeed instance. /// Thrown when the resulting magnitude would be negative. public static FlowSpeed FromMilesPerHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MilesPerHourToMetersPerSecond)), nameof(value))); +/// + /// Creates a new FlowSpeed from a value in FeetPerSecond. + /// + /// The value in FeetPerSecond. + /// A new FlowSpeed instance. + /// Thrown when the resulting magnitude would be negative. + public static FlowSpeed FromFeetPerSecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetPerSecondToMetersPerSecond)), nameof(value))); +/// + /// Creates a new FlowSpeed from a value in Knot. + /// + /// The value in Knot. + /// A new FlowSpeed instance. + /// Thrown when the resulting magnitude would be negative. + public static FlowSpeed FromKnots(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KnotToMetersPerSecond)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Velocity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Force1D.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Force1D.g.cs index f06a064..04ad596 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Force1D.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Force1D.g.cs @@ -26,6 +26,24 @@ public record Force1D : PhysicalQuantity, T>, IVector1, /// The value in Newton. /// A new instance. public static Force1D FromNewtons(T value) => Create(value); +/// + /// Creates a new from a value in Kilonewton. + /// + /// The value in Kilonewton. + /// A new instance. + public static Force1D FromKilonewtons(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Kilo))); +/// + /// Creates a new from a value in Dyne. + /// + /// The value in Dyne. + /// A new instance. + public static Force1D FromDynes(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DyneToNewtons))); +/// + /// Creates a new from a value in PoundForce. + /// + /// The value in PoundForce. + /// A new instance. + public static Force1D FromPoundsForce(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.PoundForceToNewtons))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Force unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ForceMagnitude.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ForceMagnitude.g.cs index f35f0c6..07fe794 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ForceMagnitude.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ForceMagnitude.g.cs @@ -27,6 +27,27 @@ public record ForceMagnitude : PhysicalQuantity, T>, IVecto /// A new instance. /// Thrown when the resulting magnitude would be negative. public static ForceMagnitude FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Kilonewton. + /// + /// The value in Kilonewton. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static ForceMagnitude FromKilonewtons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new from a value in Dyne. + /// + /// The value in Dyne. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static ForceMagnitude FromDynes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DyneToNewtons)), nameof(value))); +/// + /// Creates a new from a value in PoundForce. + /// + /// The value in PoundForce. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static ForceMagnitude FromPoundsForce(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundForceToNewtons)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Force unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Frequency.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Frequency.g.cs index 2fcdc32..79ad8d4 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Frequency.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Frequency.g.cs @@ -27,6 +27,20 @@ public record Frequency : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static Frequency FromHertz(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Kilohertz. + /// + /// The value in Kilohertz. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Frequency FromKilohertz(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new from a value in Megahertz. + /// + /// The value in Megahertz. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Frequency FromMegahertz(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Mega)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Frequency unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Friction.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Friction.g.cs index 389b8a0..5735a19 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Friction.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Friction.g.cs @@ -28,6 +28,27 @@ public record Friction : PhysicalQuantity, T>, IVector0A new Friction instance. /// Thrown when the resulting magnitude would be negative. public static Friction FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Friction from a value in Kilonewton. + /// + /// The value in Kilonewton. + /// A new Friction instance. + /// Thrown when the resulting magnitude would be negative. + public static Friction FromKilonewtons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new Friction from a value in Dyne. + /// + /// The value in Dyne. + /// A new Friction instance. + /// Thrown when the resulting magnitude would be negative. + public static Friction FromDynes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DyneToNewtons)), nameof(value))); +/// + /// Creates a new Friction from a value in PoundForce. + /// + /// The value in PoundForce. + /// A new Friction instance. + /// Thrown when the resulting magnitude would be negative. + public static Friction FromPoundsForce(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundForceToNewtons)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Force unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GaugePressure.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GaugePressure.g.cs index cfe6c02..cd8e158 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GaugePressure.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GaugePressure.g.cs @@ -28,6 +28,13 @@ public record GaugePressure : PhysicalQuantity, T>, IVector0 /// A new GaugePressure instance. /// Thrown when the resulting magnitude would be negative. public static GaugePressure FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new GaugePressure from a value in Kilopascal. + /// + /// The value in Kilopascal. + /// A new GaugePressure instance. + /// Thrown when the resulting magnitude would be negative. + public static GaugePressure FromKilopascals(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new GaugePressure from a value in Bar. /// @@ -49,6 +56,13 @@ public record GaugePressure : PhysicalQuantity, T>, IVector0 /// A new GaugePressure instance. /// Thrown when the resulting magnitude would be negative. public static GaugePressure FromPsi(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PsiToPascals)), nameof(value))); +/// + /// Creates a new GaugePressure from a value in Torr. + /// + /// The value in Torr. + /// A new GaugePressure instance. + /// Thrown when the resulting magnitude would be negative. + public static GaugePressure FromTorr(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.TorrToPascals)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Pressure unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GravitationalAcceleration.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GravitationalAcceleration.g.cs index e0a114c..9f4943e 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GravitationalAcceleration.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GravitationalAcceleration.g.cs @@ -28,6 +28,13 @@ public record GravitationalAcceleration : PhysicalQuantityA new GravitationalAcceleration instance. /// Thrown when the resulting magnitude would be negative. public static GravitationalAcceleration FromMetersPerSecondSquared(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new GravitationalAcceleration from a value in StandardGravity. + /// + /// The value in StandardGravity. + /// A new GravitationalAcceleration instance. + /// Thrown when the resulting magnitude would be negative. + public static GravitationalAcceleration FromStandardGravity(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.StandardGravityToMetersPerSecondSquared)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Acceleration unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GroundSpeed.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GroundSpeed.g.cs index db6fd17..905fba5 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GroundSpeed.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GroundSpeed.g.cs @@ -42,6 +42,20 @@ public record GroundSpeed : PhysicalQuantity, T>, IVector0A new GroundSpeed instance. /// Thrown when the resulting magnitude would be negative. public static GroundSpeed FromMilesPerHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MilesPerHourToMetersPerSecond)), nameof(value))); +/// + /// Creates a new GroundSpeed from a value in FeetPerSecond. + /// + /// The value in FeetPerSecond. + /// A new GroundSpeed instance. + /// Thrown when the resulting magnitude would be negative. + public static GroundSpeed FromFeetPerSecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetPerSecondToMetersPerSecond)), nameof(value))); +/// + /// Creates a new GroundSpeed from a value in Knot. + /// + /// The value in Knot. + /// A new GroundSpeed instance. + /// Thrown when the resulting magnitude would be negative. + public static GroundSpeed FromKnots(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KnotToMetersPerSecond)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Velocity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GroupVelocity.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GroupVelocity.g.cs index 7ddc8bc..6409a8a 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GroupVelocity.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/GroupVelocity.g.cs @@ -42,6 +42,20 @@ public record GroupVelocity : PhysicalQuantity, T>, IVector0 /// A new GroupVelocity instance. /// Thrown when the resulting magnitude would be negative. public static GroupVelocity FromMilesPerHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MilesPerHourToMetersPerSecond)), nameof(value))); +/// + /// Creates a new GroupVelocity from a value in FeetPerSecond. + /// + /// The value in FeetPerSecond. + /// A new GroupVelocity instance. + /// Thrown when the resulting magnitude would be negative. + public static GroupVelocity FromFeetPerSecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetPerSecondToMetersPerSecond)), nameof(value))); +/// + /// Creates a new GroupVelocity from a value in Knot. + /// + /// The value in Knot. + /// A new GroupVelocity instance. + /// Thrown when the resulting magnitude would be negative. + public static GroupVelocity FromKnots(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KnotToMetersPerSecond)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Velocity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/HalfLife.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/HalfLife.g.cs index 5e3de2d..2262792 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/HalfLife.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/HalfLife.g.cs @@ -70,6 +70,20 @@ public record HalfLife : PhysicalQuantity, T>, IVector0A new HalfLife instance. /// Thrown when the resulting magnitude would be negative. public static HalfLife FromYears(T value) => Create(Vector0Guards.EnsurePositive((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); +/// + /// Creates a new HalfLife from a value in Week. + /// + /// The value in Week. + /// A new HalfLife instance. + /// Thrown when the resulting magnitude would be negative. + public static HalfLife FromWeeks(T value) => Create(Vector0Guards.EnsurePositive((value * T.CreateChecked(Units.ConversionConstants.WeekToSeconds)), nameof(value))); +/// + /// Creates a new HalfLife from a value in Nanosecond. + /// + /// The value in Nanosecond. + /// A new HalfLife instance. + /// Thrown when the resulting magnitude would be negative. + public static HalfLife FromNanoseconds(T value) => Create(Vector0Guards.EnsurePositive((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Time unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Heading.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Heading.g.cs index 2cd4a0a..a033666 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Heading.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Heading.g.cs @@ -33,6 +33,24 @@ public record Heading : PhysicalQuantity, T>, IVector1, /// The value in Degree. /// A new Heading instance. public static Heading FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); +/// + /// Creates a new Heading from a value in Gradian. + /// + /// The value in Gradian. + /// A new Heading instance. + public static Heading FromGradians(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians))); +/// + /// Creates a new Heading from a value in Revolution. + /// + /// The value in Revolution. + /// A new Heading instance. + public static Heading FromRevolutions(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians))); +/// + /// Creates a new Heading from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new Heading instance. + public static Heading FromMilliradians(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Milli))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-AngularDisplacement unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Heat.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Heat.g.cs index dd064f4..0e6de41 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Heat.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Heat.g.cs @@ -28,6 +28,13 @@ public record Heat : PhysicalQuantity, T>, IVector0, T> /// A new Heat instance. /// Thrown when the resulting magnitude would be negative. public static Heat FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Heat from a value in Kilojoule. + /// + /// The value in Kilojoule. + /// A new Heat instance. + /// Thrown when the resulting magnitude would be negative. + public static Heat FromKilojoules(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Heat from a value in ElectronVolt. /// @@ -42,6 +49,13 @@ public record Heat : PhysicalQuantity, T>, IVector0, T> /// A new Heat instance. /// Thrown when the resulting magnitude would be negative. public static Heat FromCalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); +/// + /// Creates a new Heat from a value in Kilocalorie. + /// + /// The value in Kilocalorie. + /// A new Heat instance. + /// Thrown when the resulting magnitude would be negative. + public static Heat FromKilocalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilocalorieToJoules)), nameof(value))); /// /// Creates a new Heat from a value in KilowattHour. /// @@ -49,6 +63,27 @@ public record Heat : PhysicalQuantity, T>, IVector0, T> /// A new Heat instance. /// Thrown when the resulting magnitude would be negative. public static Heat FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); +/// + /// Creates a new Heat from a value in WattHour. + /// + /// The value in WattHour. + /// A new Heat instance. + /// Thrown when the resulting magnitude would be negative. + public static Heat FromWattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.WattHourToJoules)), nameof(value))); +/// + /// Creates a new Heat from a value in Erg. + /// + /// The value in Erg. + /// A new Heat instance. + /// Thrown when the resulting magnitude would be negative. + public static Heat FromErgs(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ErgToJoules)), nameof(value))); +/// + /// Creates a new Heat from a value in Btu. + /// + /// The value in Btu. + /// A new Heat instance. + /// Thrown when the resulting magnitude would be negative. + public static Heat FromBtus(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BtuToJoules)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Energy unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/HeatFlowRate.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/HeatFlowRate.g.cs index 08f971f..24304dc 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/HeatFlowRate.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/HeatFlowRate.g.cs @@ -28,6 +28,20 @@ public record HeatFlowRate : PhysicalQuantity, T>, IVector0A new HeatFlowRate instance. /// Thrown when the resulting magnitude would be negative. public static HeatFlowRate FromWatts(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new HeatFlowRate from a value in Kilowatt. + /// + /// The value in Kilowatt. + /// A new HeatFlowRate instance. + /// Thrown when the resulting magnitude would be negative. + public static HeatFlowRate FromKilowatts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new HeatFlowRate from a value in Megawatt. + /// + /// The value in Megawatt. + /// A new HeatFlowRate instance. + /// Thrown when the resulting magnitude would be negative. + public static HeatFlowRate FromMegawatts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Mega)), nameof(value))); /// /// Creates a new HeatFlowRate from a value in Horsepower. /// diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Height.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Height.g.cs index 429e320..63b8e7a 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Height.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Height.g.cs @@ -98,6 +98,13 @@ public record Height : PhysicalQuantity, T>, IVector0, T> /// A new Height instance. /// Thrown when the resulting magnitude would be negative. public static Height FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); +/// + /// Creates a new Height from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new Height instance. + /// Thrown when the resulting magnitude would be negative. + public static Height FromNauticalMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Illuminance.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Illuminance.g.cs index 84dc6c8..ed8cf00 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Illuminance.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Illuminance.g.cs @@ -27,6 +27,13 @@ public record Illuminance : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static Illuminance FromLux(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in FootCandle. + /// + /// The value in FootCandle. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Illuminance FromFootCandles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FootCandleToLux)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Illuminance unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/KineticEnergy.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/KineticEnergy.g.cs index 031bf80..9e0540d 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/KineticEnergy.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/KineticEnergy.g.cs @@ -28,6 +28,13 @@ public record KineticEnergy : PhysicalQuantity, T>, IVector0 /// A new KineticEnergy instance. /// Thrown when the resulting magnitude would be negative. public static KineticEnergy FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new KineticEnergy from a value in Kilojoule. + /// + /// The value in Kilojoule. + /// A new KineticEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static KineticEnergy FromKilojoules(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new KineticEnergy from a value in ElectronVolt. /// @@ -42,6 +49,13 @@ public record KineticEnergy : PhysicalQuantity, T>, IVector0 /// A new KineticEnergy instance. /// Thrown when the resulting magnitude would be negative. public static KineticEnergy FromCalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); +/// + /// Creates a new KineticEnergy from a value in Kilocalorie. + /// + /// The value in Kilocalorie. + /// A new KineticEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static KineticEnergy FromKilocalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilocalorieToJoules)), nameof(value))); /// /// Creates a new KineticEnergy from a value in KilowattHour. /// @@ -49,6 +63,27 @@ public record KineticEnergy : PhysicalQuantity, T>, IVector0 /// A new KineticEnergy instance. /// Thrown when the resulting magnitude would be negative. public static KineticEnergy FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); +/// + /// Creates a new KineticEnergy from a value in WattHour. + /// + /// The value in WattHour. + /// A new KineticEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static KineticEnergy FromWattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.WattHourToJoules)), nameof(value))); +/// + /// Creates a new KineticEnergy from a value in Erg. + /// + /// The value in Erg. + /// A new KineticEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static KineticEnergy FromErgs(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ErgToJoules)), nameof(value))); +/// + /// Creates a new KineticEnergy from a value in Btu. + /// + /// The value in Btu. + /// A new KineticEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static KineticEnergy FromBtus(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BtuToJoules)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Energy unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Latency.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Latency.g.cs index ab6128a..44eface 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Latency.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Latency.g.cs @@ -70,6 +70,20 @@ public record Latency : PhysicalQuantity, T>, IVector0, /// A new Latency instance. /// Thrown when the resulting magnitude would be negative. public static Latency FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); +/// + /// Creates a new Latency from a value in Week. + /// + /// The value in Week. + /// A new Latency instance. + /// Thrown when the resulting magnitude would be negative. + public static Latency FromWeeks(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.WeekToSeconds)), nameof(value))); +/// + /// Creates a new Latency from a value in Nanosecond. + /// + /// The value in Nanosecond. + /// A new Latency instance. + /// Thrown when the resulting magnitude would be negative. + public static Latency FromNanoseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Time unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Length.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Length.g.cs index 6b08450..a02f347 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Length.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Length.g.cs @@ -97,6 +97,13 @@ public record Length : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Length FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); +/// + /// Creates a new from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Length FromNauticalMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Lift.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Lift.g.cs index af95a15..5ae3dff 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Lift.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Lift.g.cs @@ -28,6 +28,27 @@ public record Lift : PhysicalQuantity, T>, IVector0, T> /// A new Lift instance. /// Thrown when the resulting magnitude would be negative. public static Lift FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Lift from a value in Kilonewton. + /// + /// The value in Kilonewton. + /// A new Lift instance. + /// Thrown when the resulting magnitude would be negative. + public static Lift FromKilonewtons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new Lift from a value in Dyne. + /// + /// The value in Dyne. + /// A new Lift instance. + /// Thrown when the resulting magnitude would be negative. + public static Lift FromDynes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DyneToNewtons)), nameof(value))); +/// + /// Creates a new Lift from a value in PoundForce. + /// + /// The value in PoundForce. + /// A new Lift instance. + /// Thrown when the resulting magnitude would be negative. + public static Lift FromPoundsForce(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundForceToNewtons)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Force unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Luminance.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Luminance.g.cs index 10af37c..0d23b64 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Luminance.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Luminance.g.cs @@ -28,6 +28,13 @@ public record Luminance : PhysicalQuantity, T>, IVector0A new Luminance instance. /// Thrown when the resulting magnitude would be negative. public static Luminance FromLux(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Luminance from a value in FootCandle. + /// + /// The value in FootCandle. + /// A new Luminance instance. + /// Thrown when the resulting magnitude would be negative. + public static Luminance FromFootCandles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FootCandleToLux)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Illuminance unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/LuminousIntensity.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/LuminousIntensity.g.cs index 64b3f56..e3819fc 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/LuminousIntensity.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/LuminousIntensity.g.cs @@ -27,6 +27,13 @@ public record LuminousIntensity : PhysicalQuantity, T>, /// A new instance. /// Thrown when the resulting magnitude would be negative. public static LuminousIntensity FromCandelas(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Millicandela. + /// + /// The value in Millicandela. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static LuminousIntensity FromMillicandelas(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-LuminousIntensity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MachNumber.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MachNumber.g.cs index df509b4..8a63ddf 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MachNumber.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MachNumber.g.cs @@ -42,6 +42,48 @@ public record MachNumber : PhysicalQuantity, T>, IVector0A new MachNumber instance. /// Thrown when the resulting magnitude would be negative. public static MachNumber FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); +/// + /// Creates a new MachNumber from a value in Gradian. + /// + /// The value in Gradian. + /// A new MachNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static MachNumber FromGradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians)), nameof(value))); +/// + /// Creates a new MachNumber from a value in Revolution. + /// + /// The value in Revolution. + /// A new MachNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static MachNumber FromRevolutions(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians)), nameof(value))); +/// + /// Creates a new MachNumber from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new MachNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static MachNumber FromMilliradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); +/// + /// Creates a new MachNumber from a value in PartsPerMillion. + /// + /// The value in PartsPerMillion. + /// A new MachNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static MachNumber FromPartsPerMillion(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PartsPerMillionToRatio)), nameof(value))); +/// + /// Creates a new MachNumber from a value in PartsPerBillion. + /// + /// The value in PartsPerBillion. + /// A new MachNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static MachNumber FromPartsPerBillion(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PartsPerBillionToRatio)), nameof(value))); +/// + /// Creates a new MachNumber from a value in PercentByWeight. + /// + /// The value in PercentByWeight. + /// A new MachNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static MachNumber FromPercentByWeight(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PercentByWeightToRatio)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Dimensionless unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Mass.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Mass.g.cs index dcdfacf..c9354b2 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Mass.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Mass.g.cs @@ -55,6 +55,27 @@ public record Mass : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Mass FromOunces(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.OunceToKilograms)), nameof(value))); +/// + /// Creates a new from a value in Stone. + /// + /// The value in Stone. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Mass FromStone(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.StoneToKilograms)), nameof(value))); +/// + /// Creates a new from a value in ShortTon. + /// + /// The value in ShortTon. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Mass FromShortTons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ShortTonToKilograms)), nameof(value))); +/// + /// Creates a new from a value in AtomicMassUnit. + /// + /// The value in AtomicMassUnit. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Mass FromAtomicMassUnits(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtomicMassUnitToKilograms)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Mass unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarEnergy.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarEnergy.g.cs index 602ceee..446e76a 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarEnergy.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarEnergy.g.cs @@ -34,6 +34,13 @@ public record MolarEnergy : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static MolarEnergy FromKilojoulePerMole(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilojoulePerMoleToJoulePerMole)), nameof(value))); +/// + /// Creates a new from a value in CaloriePerMole. + /// + /// The value in CaloriePerMole. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static MolarEnergy FromCaloriesPerMole(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CaloriePerMoleToJoulePerMole)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-MolarEnergy unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarEnthalpy.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarEnthalpy.g.cs index f3f3550..9756bec 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarEnthalpy.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarEnthalpy.g.cs @@ -35,6 +35,13 @@ public record MolarEnthalpy : PhysicalQuantity, T>, IVector0 /// A new MolarEnthalpy instance. /// Thrown when the resulting magnitude would be negative. public static MolarEnthalpy FromKilojoulePerMole(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilojoulePerMoleToJoulePerMole)), nameof(value))); +/// + /// Creates a new MolarEnthalpy from a value in CaloriePerMole. + /// + /// The value in CaloriePerMole. + /// A new MolarEnthalpy instance. + /// Thrown when the resulting magnitude would be negative. + public static MolarEnthalpy FromCaloriesPerMole(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CaloriePerMoleToJoulePerMole)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-MolarEnergy unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarMass.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarMass.g.cs index 90e4717..2dd2806 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarMass.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MolarMass.g.cs @@ -34,6 +34,13 @@ public record MolarMass : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static MolarMass FromGramPerMole(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GramPerMoleToKilogramPerMole)), nameof(value))); +/// + /// Creates a new from a value in Dalton. + /// + /// The value in Dalton. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static MolarMass FromDaltons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GramPerMoleToKilogramPerMole)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-MolarMass unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/NormalForce.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/NormalForce.g.cs index 4e68827..27a15ac 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/NormalForce.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/NormalForce.g.cs @@ -28,6 +28,27 @@ public record NormalForce : PhysicalQuantity, T>, IVector0A new NormalForce instance. /// Thrown when the resulting magnitude would be negative. public static NormalForce FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new NormalForce from a value in Kilonewton. + /// + /// The value in Kilonewton. + /// A new NormalForce instance. + /// Thrown when the resulting magnitude would be negative. + public static NormalForce FromKilonewtons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new NormalForce from a value in Dyne. + /// + /// The value in Dyne. + /// A new NormalForce instance. + /// Thrown when the resulting magnitude would be negative. + public static NormalForce FromDynes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DyneToNewtons)), nameof(value))); +/// + /// Creates a new NormalForce from a value in PoundForce. + /// + /// The value in PoundForce. + /// A new NormalForce instance. + /// Thrown when the resulting magnitude would be negative. + public static NormalForce FromPoundsForce(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundForceToNewtons)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Force unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Offset.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Offset.g.cs index fbfc581..3f32c18 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Offset.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Offset.g.cs @@ -87,6 +87,12 @@ public record Offset : PhysicalQuantity, T>, IVector1, T> /// The value in Mile. /// A new Offset instance. public static Offset FromMiles(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.MileToMeters))); +/// + /// Creates a new Offset from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new Offset instance. + public static Offset FromNauticalMiles(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Perimeter.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Perimeter.g.cs index f2ea46f..f417f75 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Perimeter.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Perimeter.g.cs @@ -98,6 +98,13 @@ public record Perimeter : PhysicalQuantity, T>, IVector0A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. public static Perimeter FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); +/// + /// Creates a new Perimeter from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new Perimeter instance. + /// Thrown when the resulting magnitude would be negative. + public static Perimeter FromNauticalMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Period.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Period.g.cs index daf48d2..16fc31b 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Period.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Period.g.cs @@ -70,6 +70,20 @@ public record Period : PhysicalQuantity, T>, IVector0, T> /// A new Period instance. /// Thrown when the resulting magnitude would be negative. public static Period FromYears(T value) => Create(Vector0Guards.EnsurePositive((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); +/// + /// Creates a new Period from a value in Week. + /// + /// The value in Week. + /// A new Period instance. + /// Thrown when the resulting magnitude would be negative. + public static Period FromWeeks(T value) => Create(Vector0Guards.EnsurePositive((value * T.CreateChecked(Units.ConversionConstants.WeekToSeconds)), nameof(value))); +/// + /// Creates a new Period from a value in Nanosecond. + /// + /// The value in Nanosecond. + /// A new Period instance. + /// Thrown when the resulting magnitude would be negative. + public static Period FromNanoseconds(T value) => Create(Vector0Guards.EnsurePositive((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Time unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Phase.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Phase.g.cs index 178c309..8fa4652 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Phase.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Phase.g.cs @@ -33,6 +33,24 @@ public record Phase : PhysicalQuantity, T>, IVector1, T> /// The value in Degree. /// A new Phase instance. public static Phase FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); +/// + /// Creates a new Phase from a value in Gradian. + /// + /// The value in Gradian. + /// A new Phase instance. + public static Phase FromGradians(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians))); +/// + /// Creates a new Phase from a value in Revolution. + /// + /// The value in Revolution. + /// A new Phase instance. + public static Phase FromRevolutions(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians))); +/// + /// Creates a new Phase from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new Phase instance. + public static Phase FromMilliradians(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Milli))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-AngularDisplacement unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/PhaseVelocity.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/PhaseVelocity.g.cs index f62f7b3..deaa823 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/PhaseVelocity.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/PhaseVelocity.g.cs @@ -42,6 +42,20 @@ public record PhaseVelocity : PhysicalQuantity, T>, IVector0 /// A new PhaseVelocity instance. /// Thrown when the resulting magnitude would be negative. public static PhaseVelocity FromMilesPerHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MilesPerHourToMetersPerSecond)), nameof(value))); +/// + /// Creates a new PhaseVelocity from a value in FeetPerSecond. + /// + /// The value in FeetPerSecond. + /// A new PhaseVelocity instance. + /// Thrown when the resulting magnitude would be negative. + public static PhaseVelocity FromFeetPerSecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetPerSecondToMetersPerSecond)), nameof(value))); +/// + /// Creates a new PhaseVelocity from a value in Knot. + /// + /// The value in Knot. + /// A new PhaseVelocity instance. + /// Thrown when the resulting magnitude would be negative. + public static PhaseVelocity FromKnots(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KnotToMetersPerSecond)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Velocity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Pitch.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Pitch.g.cs index 79a55dc..be03bfb 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Pitch.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Pitch.g.cs @@ -28,6 +28,20 @@ public record Pitch : PhysicalQuantity, T>, IVector0, T> /// A new Pitch instance. /// Thrown when the resulting magnitude would be negative. public static Pitch FromHertz(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Pitch from a value in Kilohertz. + /// + /// The value in Kilohertz. + /// A new Pitch instance. + /// Thrown when the resulting magnitude would be negative. + public static Pitch FromKilohertz(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new Pitch from a value in Megahertz. + /// + /// The value in Megahertz. + /// A new Pitch instance. + /// Thrown when the resulting magnitude would be negative. + public static Pitch FromMegahertz(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Mega)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Frequency unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/PotentialEnergy.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/PotentialEnergy.g.cs index 9387003..7810300 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/PotentialEnergy.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/PotentialEnergy.g.cs @@ -28,6 +28,13 @@ public record PotentialEnergy : PhysicalQuantity, T>, IVec /// A new PotentialEnergy instance. /// Thrown when the resulting magnitude would be negative. public static PotentialEnergy FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new PotentialEnergy from a value in Kilojoule. + /// + /// The value in Kilojoule. + /// A new PotentialEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static PotentialEnergy FromKilojoules(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new PotentialEnergy from a value in ElectronVolt. /// @@ -42,6 +49,13 @@ public record PotentialEnergy : PhysicalQuantity, T>, IVec /// A new PotentialEnergy instance. /// Thrown when the resulting magnitude would be negative. public static PotentialEnergy FromCalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); +/// + /// Creates a new PotentialEnergy from a value in Kilocalorie. + /// + /// The value in Kilocalorie. + /// A new PotentialEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static PotentialEnergy FromKilocalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilocalorieToJoules)), nameof(value))); /// /// Creates a new PotentialEnergy from a value in KilowattHour. /// @@ -49,6 +63,27 @@ public record PotentialEnergy : PhysicalQuantity, T>, IVec /// A new PotentialEnergy instance. /// Thrown when the resulting magnitude would be negative. public static PotentialEnergy FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); +/// + /// Creates a new PotentialEnergy from a value in WattHour. + /// + /// The value in WattHour. + /// A new PotentialEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static PotentialEnergy FromWattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.WattHourToJoules)), nameof(value))); +/// + /// Creates a new PotentialEnergy from a value in Erg. + /// + /// The value in Erg. + /// A new PotentialEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static PotentialEnergy FromErgs(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ErgToJoules)), nameof(value))); +/// + /// Creates a new PotentialEnergy from a value in Btu. + /// + /// The value in Btu. + /// A new PotentialEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static PotentialEnergy FromBtus(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BtuToJoules)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Energy unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Power.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Power.g.cs index cf0da9e..3529e5d 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Power.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Power.g.cs @@ -27,6 +27,20 @@ public record Power : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Power FromWatts(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Kilowatt. + /// + /// The value in Kilowatt. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Power FromKilowatts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new from a value in Megawatt. + /// + /// The value in Megawatt. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Power FromMegawatts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Mega)), nameof(value))); /// /// Creates a new from a value in Horsepower. /// diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Pressure.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Pressure.g.cs index 8fc1a30..817010c 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Pressure.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Pressure.g.cs @@ -27,6 +27,13 @@ public record Pressure : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static Pressure FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Kilopascal. + /// + /// The value in Kilopascal. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Pressure FromKilopascals(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new from a value in Bar. /// @@ -48,6 +55,13 @@ public record Pressure : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static Pressure FromPsi(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PsiToPascals)), nameof(value))); +/// + /// Creates a new from a value in Torr. + /// + /// The value in Torr. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Pressure FromTorr(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.TorrToPascals)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Pressure unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/RadioactiveActivity.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/RadioactiveActivity.g.cs index f2ce1b2..5c391e5 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/RadioactiveActivity.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/RadioactiveActivity.g.cs @@ -27,6 +27,13 @@ public record RadioactiveActivity : PhysicalQuantity, /// A new instance. /// Thrown when the resulting magnitude would be negative. public static RadioactiveActivity FromBecquerels(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Curie. + /// + /// The value in Curie. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static RadioactiveActivity FromCuries(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CurieToBecquerels)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-RadioactiveActivity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Radius.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Radius.g.cs index 5d6f462..93528e2 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Radius.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Radius.g.cs @@ -98,6 +98,13 @@ public record Radius : PhysicalQuantity, T>, IVector0, T> /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. public static Radius FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); +/// + /// Creates a new Radius from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new Radius instance. + /// Thrown when the resulting magnitude would be negative. + public static Radius FromNauticalMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Ratio.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Ratio.g.cs index 635e9ac..7817d8b 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Ratio.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Ratio.g.cs @@ -41,6 +41,48 @@ public record Ratio : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Ratio FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); +/// + /// Creates a new from a value in Gradian. + /// + /// The value in Gradian. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Ratio FromGradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians)), nameof(value))); +/// + /// Creates a new from a value in Revolution. + /// + /// The value in Revolution. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Ratio FromRevolutions(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians)), nameof(value))); +/// + /// Creates a new from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Ratio FromMilliradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); +/// + /// Creates a new from a value in PartsPerMillion. + /// + /// The value in PartsPerMillion. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Ratio FromPartsPerMillion(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PartsPerMillionToRatio)), nameof(value))); +/// + /// Creates a new from a value in PartsPerBillion. + /// + /// The value in PartsPerBillion. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Ratio FromPartsPerBillion(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PartsPerBillionToRatio)), nameof(value))); +/// + /// Creates a new from a value in PercentByWeight. + /// + /// The value in PercentByWeight. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Ratio FromPercentByWeight(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PercentByWeightToRatio)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Dimensionless unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/RefractiveIndex.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/RefractiveIndex.g.cs index 7e4d73b..7eba31c 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/RefractiveIndex.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/RefractiveIndex.g.cs @@ -42,6 +42,48 @@ public record RefractiveIndex : PhysicalQuantity, T>, IVec /// A new RefractiveIndex instance. /// Thrown when the resulting magnitude would be negative. public static RefractiveIndex FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); +/// + /// Creates a new RefractiveIndex from a value in Gradian. + /// + /// The value in Gradian. + /// A new RefractiveIndex instance. + /// Thrown when the resulting magnitude would be negative. + public static RefractiveIndex FromGradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians)), nameof(value))); +/// + /// Creates a new RefractiveIndex from a value in Revolution. + /// + /// The value in Revolution. + /// A new RefractiveIndex instance. + /// Thrown when the resulting magnitude would be negative. + public static RefractiveIndex FromRevolutions(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians)), nameof(value))); +/// + /// Creates a new RefractiveIndex from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new RefractiveIndex instance. + /// Thrown when the resulting magnitude would be negative. + public static RefractiveIndex FromMilliradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); +/// + /// Creates a new RefractiveIndex from a value in PartsPerMillion. + /// + /// The value in PartsPerMillion. + /// A new RefractiveIndex instance. + /// Thrown when the resulting magnitude would be negative. + public static RefractiveIndex FromPartsPerMillion(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PartsPerMillionToRatio)), nameof(value))); +/// + /// Creates a new RefractiveIndex from a value in PartsPerBillion. + /// + /// The value in PartsPerBillion. + /// A new RefractiveIndex instance. + /// Thrown when the resulting magnitude would be negative. + public static RefractiveIndex FromPartsPerBillion(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PartsPerBillionToRatio)), nameof(value))); +/// + /// Creates a new RefractiveIndex from a value in PercentByWeight. + /// + /// The value in PercentByWeight. + /// A new RefractiveIndex instance. + /// Thrown when the resulting magnitude would be negative. + public static RefractiveIndex FromPercentByWeight(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PercentByWeightToRatio)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Dimensionless unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Resistance.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Resistance.g.cs index 786ee82..016a24d 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Resistance.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Resistance.g.cs @@ -27,6 +27,20 @@ public record Resistance : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static Resistance FromOhms(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Kilohm. + /// + /// The value in Kilohm. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Resistance FromKilohms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new from a value in Megohm. + /// + /// The value in Megohm. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Resistance FromMegohms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Mega)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-ElectricResistance unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ReverberationTime.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ReverberationTime.g.cs index c5fb6ca..c29d424 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ReverberationTime.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ReverberationTime.g.cs @@ -70,6 +70,20 @@ public record ReverberationTime : PhysicalQuantity, T>, /// A new ReverberationTime instance. /// Thrown when the resulting magnitude would be negative. public static ReverberationTime FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); +/// + /// Creates a new ReverberationTime from a value in Week. + /// + /// The value in Week. + /// A new ReverberationTime instance. + /// Thrown when the resulting magnitude would be negative. + public static ReverberationTime FromWeeks(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.WeekToSeconds)), nameof(value))); +/// + /// Creates a new ReverberationTime from a value in Nanosecond. + /// + /// The value in Nanosecond. + /// A new ReverberationTime instance. + /// Thrown when the resulting magnitude would be negative. + public static ReverberationTime FromNanoseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Time unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ReynoldsNumber.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ReynoldsNumber.g.cs index a22f013..e61e24c 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ReynoldsNumber.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ReynoldsNumber.g.cs @@ -42,6 +42,48 @@ public record ReynoldsNumber : PhysicalQuantity, T>, IVecto /// A new ReynoldsNumber instance. /// Thrown when the resulting magnitude would be negative. public static ReynoldsNumber FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); +/// + /// Creates a new ReynoldsNumber from a value in Gradian. + /// + /// The value in Gradian. + /// A new ReynoldsNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static ReynoldsNumber FromGradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians)), nameof(value))); +/// + /// Creates a new ReynoldsNumber from a value in Revolution. + /// + /// The value in Revolution. + /// A new ReynoldsNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static ReynoldsNumber FromRevolutions(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians)), nameof(value))); +/// + /// Creates a new ReynoldsNumber from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new ReynoldsNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static ReynoldsNumber FromMilliradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); +/// + /// Creates a new ReynoldsNumber from a value in PartsPerMillion. + /// + /// The value in PartsPerMillion. + /// A new ReynoldsNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static ReynoldsNumber FromPartsPerMillion(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PartsPerMillionToRatio)), nameof(value))); +/// + /// Creates a new ReynoldsNumber from a value in PartsPerBillion. + /// + /// The value in PartsPerBillion. + /// A new ReynoldsNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static ReynoldsNumber FromPartsPerBillion(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PartsPerBillionToRatio)), nameof(value))); +/// + /// Creates a new ReynoldsNumber from a value in PercentByWeight. + /// + /// The value in PercentByWeight. + /// A new ReynoldsNumber instance. + /// Thrown when the resulting magnitude would be negative. + public static ReynoldsNumber FromPercentByWeight(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PercentByWeightToRatio)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Dimensionless unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Rotation.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Rotation.g.cs index c54803f..cc92100 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Rotation.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Rotation.g.cs @@ -33,6 +33,24 @@ public record Rotation : PhysicalQuantity, T>, IVector1The value in Degree. /// A new Rotation instance. public static Rotation FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); +/// + /// Creates a new Rotation from a value in Gradian. + /// + /// The value in Gradian. + /// A new Rotation instance. + public static Rotation FromGradians(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians))); +/// + /// Creates a new Rotation from a value in Revolution. + /// + /// The value in Revolution. + /// A new Rotation instance. + public static Rotation FromRevolutions(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians))); +/// + /// Creates a new Rotation from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new Rotation instance. + public static Rotation FromMilliradians(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Milli))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-AngularDisplacement unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SamplingRate.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SamplingRate.g.cs index 21786fd..6508961 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SamplingRate.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SamplingRate.g.cs @@ -28,6 +28,20 @@ public record SamplingRate : PhysicalQuantity, T>, IVector0A new SamplingRate instance. /// Thrown when the resulting magnitude would be negative. public static SamplingRate FromHertz(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new SamplingRate from a value in Kilohertz. + /// + /// The value in Kilohertz. + /// A new SamplingRate instance. + /// Thrown when the resulting magnitude would be negative. + public static SamplingRate FromKilohertz(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new SamplingRate from a value in Megahertz. + /// + /// The value in Megahertz. + /// A new SamplingRate instance. + /// Thrown when the resulting magnitude would be negative. + public static SamplingRate FromMegahertz(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Mega)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Frequency unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ShearModulus.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ShearModulus.g.cs index e4412a6..b17649e 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ShearModulus.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ShearModulus.g.cs @@ -28,6 +28,13 @@ public record ShearModulus : PhysicalQuantity, T>, IVector0A new ShearModulus instance. /// Thrown when the resulting magnitude would be negative. public static ShearModulus FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new ShearModulus from a value in Kilopascal. + /// + /// The value in Kilopascal. + /// A new ShearModulus instance. + /// Thrown when the resulting magnitude would be negative. + public static ShearModulus FromKilopascals(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new ShearModulus from a value in Bar. /// @@ -49,6 +56,13 @@ public record ShearModulus : PhysicalQuantity, T>, IVector0A new ShearModulus instance. /// Thrown when the resulting magnitude would be negative. public static ShearModulus FromPsi(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PsiToPascals)), nameof(value))); +/// + /// Creates a new ShearModulus from a value in Torr. + /// + /// The value in Torr. + /// A new ShearModulus instance. + /// Thrown when the resulting magnitude would be negative. + public static ShearModulus FromTorr(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.TorrToPascals)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Pressure unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SignedAngle.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SignedAngle.g.cs index 8b1b60d..0d68dd0 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SignedAngle.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SignedAngle.g.cs @@ -32,6 +32,24 @@ public record SignedAngle : PhysicalQuantity, T>, IVector1The value in Degree. /// A new instance. public static SignedAngle FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); +/// + /// Creates a new from a value in Gradian. + /// + /// The value in Gradian. + /// A new instance. + public static SignedAngle FromGradians(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians))); +/// + /// Creates a new from a value in Revolution. + /// + /// The value in Revolution. + /// A new instance. + public static SignedAngle FromRevolutions(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians))); +/// + /// Creates a new from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new instance. + public static SignedAngle FromMilliradians(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Milli))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-AngularDisplacement unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SignedRatio.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SignedRatio.g.cs index e6dbc67..2bd088c 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SignedRatio.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SignedRatio.g.cs @@ -38,6 +38,42 @@ public record SignedRatio : PhysicalQuantity, T>, IVector1The value in Degree. /// A new instance. public static SignedRatio FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); +/// + /// Creates a new from a value in Gradian. + /// + /// The value in Gradian. + /// A new instance. + public static SignedRatio FromGradians(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians))); +/// + /// Creates a new from a value in Revolution. + /// + /// The value in Revolution. + /// A new instance. + public static SignedRatio FromRevolutions(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians))); +/// + /// Creates a new from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new instance. + public static SignedRatio FromMilliradians(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Milli))); +/// + /// Creates a new from a value in PartsPerMillion. + /// + /// The value in PartsPerMillion. + /// A new instance. + public static SignedRatio FromPartsPerMillion(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.PartsPerMillionToRatio))); +/// + /// Creates a new from a value in PartsPerBillion. + /// + /// The value in PartsPerBillion. + /// A new instance. + public static SignedRatio FromPartsPerBillion(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.PartsPerBillionToRatio))); +/// + /// Creates a new from a value in PercentByWeight. + /// + /// The value in PercentByWeight. + /// A new instance. + public static SignedRatio FromPercentByWeight(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.PercentByWeightToRatio))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Dimensionless unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SoundSpeed.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SoundSpeed.g.cs index ef75770..1a13ec7 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SoundSpeed.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SoundSpeed.g.cs @@ -42,6 +42,20 @@ public record SoundSpeed : PhysicalQuantity, T>, IVector0A new SoundSpeed instance. /// Thrown when the resulting magnitude would be negative. public static SoundSpeed FromMilesPerHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MilesPerHourToMetersPerSecond)), nameof(value))); +/// + /// Creates a new SoundSpeed from a value in FeetPerSecond. + /// + /// The value in FeetPerSecond. + /// A new SoundSpeed instance. + /// Thrown when the resulting magnitude would be negative. + public static SoundSpeed FromFeetPerSecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetPerSecondToMetersPerSecond)), nameof(value))); +/// + /// Creates a new SoundSpeed from a value in Knot. + /// + /// The value in Knot. + /// A new SoundSpeed instance. + /// Thrown when the resulting magnitude would be negative. + public static SoundSpeed FromKnots(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KnotToMetersPerSecond)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Velocity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SpecificGravity.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SpecificGravity.g.cs index 6083bf7..89eafc2 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SpecificGravity.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SpecificGravity.g.cs @@ -42,6 +42,48 @@ public record SpecificGravity : PhysicalQuantity, T>, IVec /// A new SpecificGravity instance. /// Thrown when the resulting magnitude would be negative. public static SpecificGravity FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); +/// + /// Creates a new SpecificGravity from a value in Gradian. + /// + /// The value in Gradian. + /// A new SpecificGravity instance. + /// Thrown when the resulting magnitude would be negative. + public static SpecificGravity FromGradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GradianToRadians)), nameof(value))); +/// + /// Creates a new SpecificGravity from a value in Revolution. + /// + /// The value in Revolution. + /// A new SpecificGravity instance. + /// Thrown when the resulting magnitude would be negative. + public static SpecificGravity FromRevolutions(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.RevolutionToRadians)), nameof(value))); +/// + /// Creates a new SpecificGravity from a value in Milliradian. + /// + /// The value in Milliradian. + /// A new SpecificGravity instance. + /// Thrown when the resulting magnitude would be negative. + public static SpecificGravity FromMilliradians(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); +/// + /// Creates a new SpecificGravity from a value in PartsPerMillion. + /// + /// The value in PartsPerMillion. + /// A new SpecificGravity instance. + /// Thrown when the resulting magnitude would be negative. + public static SpecificGravity FromPartsPerMillion(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PartsPerMillionToRatio)), nameof(value))); +/// + /// Creates a new SpecificGravity from a value in PartsPerBillion. + /// + /// The value in PartsPerBillion. + /// A new SpecificGravity instance. + /// Thrown when the resulting magnitude would be negative. + public static SpecificGravity FromPartsPerBillion(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PartsPerBillionToRatio)), nameof(value))); +/// + /// Creates a new SpecificGravity from a value in PercentByWeight. + /// + /// The value in PercentByWeight. + /// A new SpecificGravity instance. + /// Thrown when the resulting magnitude would be negative. + public static SpecificGravity FromPercentByWeight(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PercentByWeightToRatio)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Dimensionless unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Speed.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Speed.g.cs index 45f7aee..0135ff6 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Speed.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Speed.g.cs @@ -41,6 +41,20 @@ public record Speed : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Speed FromMilesPerHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MilesPerHourToMetersPerSecond)), nameof(value))); +/// + /// Creates a new from a value in FeetPerSecond. + /// + /// The value in FeetPerSecond. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Speed FromFeetPerSecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetPerSecondToMetersPerSecond)), nameof(value))); +/// + /// Creates a new from a value in Knot. + /// + /// The value in Knot. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Speed FromKnots(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KnotToMetersPerSecond)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Velocity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Stress.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Stress.g.cs index e8b0b1e..1cc9f43 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Stress.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Stress.g.cs @@ -28,6 +28,13 @@ public record Stress : PhysicalQuantity, T>, IVector0, T> /// A new Stress instance. /// Thrown when the resulting magnitude would be negative. public static Stress FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Stress from a value in Kilopascal. + /// + /// The value in Kilopascal. + /// A new Stress instance. + /// Thrown when the resulting magnitude would be negative. + public static Stress FromKilopascals(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Stress from a value in Bar. /// @@ -49,6 +56,13 @@ public record Stress : PhysicalQuantity, T>, IVector0, T> /// A new Stress instance. /// Thrown when the resulting magnitude would be negative. public static Stress FromPsi(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PsiToPascals)), nameof(value))); +/// + /// Creates a new Stress from a value in Torr. + /// + /// The value in Torr. + /// A new Stress instance. + /// Thrown when the resulting magnitude would be negative. + public static Stress FromTorr(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.TorrToPascals)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Pressure unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SurfaceArea.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SurfaceArea.g.cs index e1fe539..c9ef42b 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SurfaceArea.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SurfaceArea.g.cs @@ -28,6 +28,20 @@ public record SurfaceArea : PhysicalQuantity, T>, IVector0A new SurfaceArea instance. /// Thrown when the resulting magnitude would be negative. public static SurfaceArea FromSquareMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new SurfaceArea from a value in SquareKilometer. + /// + /// The value in SquareKilometer. + /// A new SurfaceArea instance. + /// Thrown when the resulting magnitude would be negative. + public static SurfaceArea FromSquareKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareKilometerToSquareMeters)), nameof(value))); +/// + /// Creates a new SurfaceArea from a value in SquareCentimeter. + /// + /// The value in SquareCentimeter. + /// A new SurfaceArea instance. + /// Thrown when the resulting magnitude would be negative. + public static SurfaceArea FromSquareCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareCentimeterToSquareMeters)), nameof(value))); /// /// Creates a new SurfaceArea from a value in SquareFoot. /// @@ -42,6 +56,27 @@ public record SurfaceArea : PhysicalQuantity, T>, IVector0A new SurfaceArea instance. /// Thrown when the resulting magnitude would be negative. public static SurfaceArea FromSquareInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareInchToSquareMeters)), nameof(value))); +/// + /// Creates a new SurfaceArea from a value in SquareMile. + /// + /// The value in SquareMile. + /// A new SurfaceArea instance. + /// Thrown when the resulting magnitude would be negative. + public static SurfaceArea FromSquareMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareMileToSquareMeters)), nameof(value))); +/// + /// Creates a new SurfaceArea from a value in Hectare. + /// + /// The value in Hectare. + /// A new SurfaceArea instance. + /// Thrown when the resulting magnitude would be negative. + public static SurfaceArea FromHectares(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HectareToSquareMeters)), nameof(value))); +/// + /// Creates a new SurfaceArea from a value in Acre. + /// + /// The value in Acre. + /// A new SurfaceArea instance. + /// Thrown when the resulting magnitude would be negative. + public static SurfaceArea FromAcres(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AcreToSquareMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Area unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SurfaceTension.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SurfaceTension.g.cs index 5195a50..65bab1d 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SurfaceTension.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/SurfaceTension.g.cs @@ -27,6 +27,13 @@ public record SurfaceTension : PhysicalQuantity, T>, IVecto /// A new instance. /// Thrown when the resulting magnitude would be negative. public static SurfaceTension FromNewtonPerMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in DynePerCentimeter. + /// + /// The value in DynePerCentimeter. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static SurfaceTension FromDynePerCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DynePerCentimeterToNewtonPerMeter)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-SurfaceTension unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Temperature.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Temperature.g.cs index 642c8d5..f89d168 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Temperature.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Temperature.g.cs @@ -41,6 +41,13 @@ public record Temperature : PhysicalQuantity, T>, IVector0A new instance. /// Thrown when the resulting magnitude would be negative. public static Temperature FromFahrenheit(T value) => Create(Vector0Guards.EnsureNonNegative(((value * T.CreateChecked(Units.ConversionConstants.FahrenheitScale)) + T.CreateChecked(Units.ConversionConstants.FahrenheitToKelvinOffset)), nameof(value))); +/// + /// Creates a new from a value in Rankine. + /// + /// The value in Rankine. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Temperature FromRankine(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FahrenheitScale)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Temperature unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureDelta.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureDelta.g.cs index 34d785f..711ac79 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureDelta.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureDelta.g.cs @@ -38,6 +38,12 @@ public record TemperatureDelta : PhysicalQuantity, T>, IV /// The value in Fahrenheit. /// A new instance. public static TemperatureDelta FromFahrenheit(T value) => Create(((value * T.CreateChecked(Units.ConversionConstants.FahrenheitScale)) + T.CreateChecked(Units.ConversionConstants.FahrenheitToKelvinOffset))); +/// + /// Creates a new from a value in Rankine. + /// + /// The value in Rankine. + /// A new instance. + public static TemperatureDelta FromRankine(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.FahrenheitScale))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Temperature unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureDrop.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureDrop.g.cs index 51780ac..935c01e 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureDrop.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureDrop.g.cs @@ -39,6 +39,12 @@ public record TemperatureDrop : PhysicalQuantity, T>, IVec /// The value in Fahrenheit. /// A new TemperatureDrop instance. public static TemperatureDrop FromFahrenheit(T value) => Create(((value * T.CreateChecked(Units.ConversionConstants.FahrenheitScale)) + T.CreateChecked(Units.ConversionConstants.FahrenheitToKelvinOffset))); +/// + /// Creates a new TemperatureDrop from a value in Rankine. + /// + /// The value in Rankine. + /// A new TemperatureDrop instance. + public static TemperatureDrop FromRankine(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.FahrenheitScale))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Temperature unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureRise.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureRise.g.cs index 804018e..da05de3 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureRise.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TemperatureRise.g.cs @@ -39,6 +39,12 @@ public record TemperatureRise : PhysicalQuantity, T>, IVec /// The value in Fahrenheit. /// A new TemperatureRise instance. public static TemperatureRise FromFahrenheit(T value) => Create(((value * T.CreateChecked(Units.ConversionConstants.FahrenheitScale)) + T.CreateChecked(Units.ConversionConstants.FahrenheitToKelvinOffset))); +/// + /// Creates a new TemperatureRise from a value in Rankine. + /// + /// The value in Rankine. + /// A new TemperatureRise instance. + public static TemperatureRise FromRankine(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.FahrenheitScale))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Temperature unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Tension.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Tension.g.cs index e088471..058d382 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Tension.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Tension.g.cs @@ -28,6 +28,27 @@ public record Tension : PhysicalQuantity, T>, IVector0, /// A new Tension instance. /// Thrown when the resulting magnitude would be negative. public static Tension FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Tension from a value in Kilonewton. + /// + /// The value in Kilonewton. + /// A new Tension instance. + /// Thrown when the resulting magnitude would be negative. + public static Tension FromKilonewtons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new Tension from a value in Dyne. + /// + /// The value in Dyne. + /// A new Tension instance. + /// Thrown when the resulting magnitude would be negative. + public static Tension FromDynes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DyneToNewtons)), nameof(value))); +/// + /// Creates a new Tension from a value in PoundForce. + /// + /// The value in PoundForce. + /// A new Tension instance. + /// Thrown when the resulting magnitude would be negative. + public static Tension FromPoundsForce(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundForceToNewtons)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Force unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ThermalEnergy.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ThermalEnergy.g.cs index 2894acb..ec63851 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ThermalEnergy.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/ThermalEnergy.g.cs @@ -28,6 +28,13 @@ public record ThermalEnergy : PhysicalQuantity, T>, IVector0 /// A new ThermalEnergy instance. /// Thrown when the resulting magnitude would be negative. public static ThermalEnergy FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new ThermalEnergy from a value in Kilojoule. + /// + /// The value in Kilojoule. + /// A new ThermalEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static ThermalEnergy FromKilojoules(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new ThermalEnergy from a value in ElectronVolt. /// @@ -42,6 +49,13 @@ public record ThermalEnergy : PhysicalQuantity, T>, IVector0 /// A new ThermalEnergy instance. /// Thrown when the resulting magnitude would be negative. public static ThermalEnergy FromCalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); +/// + /// Creates a new ThermalEnergy from a value in Kilocalorie. + /// + /// The value in Kilocalorie. + /// A new ThermalEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static ThermalEnergy FromKilocalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilocalorieToJoules)), nameof(value))); /// /// Creates a new ThermalEnergy from a value in KilowattHour. /// @@ -49,6 +63,27 @@ public record ThermalEnergy : PhysicalQuantity, T>, IVector0 /// A new ThermalEnergy instance. /// Thrown when the resulting magnitude would be negative. public static ThermalEnergy FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); +/// + /// Creates a new ThermalEnergy from a value in WattHour. + /// + /// The value in WattHour. + /// A new ThermalEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static ThermalEnergy FromWattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.WattHourToJoules)), nameof(value))); +/// + /// Creates a new ThermalEnergy from a value in Erg. + /// + /// The value in Erg. + /// A new ThermalEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static ThermalEnergy FromErgs(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ErgToJoules)), nameof(value))); +/// + /// Creates a new ThermalEnergy from a value in Btu. + /// + /// The value in Btu. + /// A new ThermalEnergy instance. + /// Thrown when the resulting magnitude would be negative. + public static ThermalEnergy FromBtus(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BtuToJoules)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Energy unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Thickness.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Thickness.g.cs index 22f4913..b6004c1 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Thickness.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Thickness.g.cs @@ -98,6 +98,13 @@ public record Thickness : PhysicalQuantity, T>, IVector0A new Thickness instance. /// Thrown when the resulting magnitude would be negative. public static Thickness FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); +/// + /// Creates a new Thickness from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new Thickness instance. + /// Thrown when the resulting magnitude would be negative. + public static Thickness FromNauticalMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Thrust.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Thrust.g.cs index bf6c4df..71b33ea 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Thrust.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Thrust.g.cs @@ -28,6 +28,27 @@ public record Thrust : PhysicalQuantity, T>, IVector0, T> /// A new Thrust instance. /// Thrown when the resulting magnitude would be negative. public static Thrust FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Thrust from a value in Kilonewton. + /// + /// The value in Kilonewton. + /// A new Thrust instance. + /// Thrown when the resulting magnitude would be negative. + public static Thrust FromKilonewtons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new Thrust from a value in Dyne. + /// + /// The value in Dyne. + /// A new Thrust instance. + /// Thrown when the resulting magnitude would be negative. + public static Thrust FromDynes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DyneToNewtons)), nameof(value))); +/// + /// Creates a new Thrust from a value in PoundForce. + /// + /// The value in PoundForce. + /// A new Thrust instance. + /// Thrown when the resulting magnitude would be negative. + public static Thrust FromPoundsForce(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundForceToNewtons)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Force unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TimeConstant.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TimeConstant.g.cs index f49e9f4..1541160 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TimeConstant.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TimeConstant.g.cs @@ -70,6 +70,20 @@ public record TimeConstant : PhysicalQuantity, T>, IVector0A new TimeConstant instance. /// Thrown when the resulting magnitude would be negative. public static TimeConstant FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); +/// + /// Creates a new TimeConstant from a value in Week. + /// + /// The value in Week. + /// A new TimeConstant instance. + /// Thrown when the resulting magnitude would be negative. + public static TimeConstant FromWeeks(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.WeekToSeconds)), nameof(value))); +/// + /// Creates a new TimeConstant from a value in Nanosecond. + /// + /// The value in Nanosecond. + /// A new TimeConstant instance. + /// Thrown when the resulting magnitude would be negative. + public static TimeConstant FromNanoseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Time unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Velocity1D.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Velocity1D.g.cs index 56321d8..a700e71 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Velocity1D.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Velocity1D.g.cs @@ -38,6 +38,18 @@ public record Velocity1D : PhysicalQuantity, T>, IVector1The value in MilesPerHour. /// A new instance. public static Velocity1D FromMilesPerHour(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.MilesPerHourToMetersPerSecond))); +/// + /// Creates a new from a value in FeetPerSecond. + /// + /// The value in FeetPerSecond. + /// A new instance. + public static Velocity1D FromFeetPerSecond(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.FeetPerSecondToMetersPerSecond))); +/// + /// Creates a new from a value in Knot. + /// + /// The value in Knot. + /// A new instance. + public static Velocity1D FromKnots(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.KnotToMetersPerSecond))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Velocity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Voltage.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Voltage.g.cs index d226e34..3ea4a2a 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Voltage.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Voltage.g.cs @@ -26,6 +26,12 @@ public record Voltage : PhysicalQuantity, T>, IVector1, /// The value in Volt. /// A new instance. public static Voltage FromVolts(T value) => Create(value); +/// + /// Creates a new from a value in Kilovolt. + /// + /// The value in Kilovolt. + /// A new instance. + public static Voltage FromKilovolts(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Kilo))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-ElectricPotential unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/VoltageDrop.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/VoltageDrop.g.cs index a2a6f2b..ecc1968 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/VoltageDrop.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/VoltageDrop.g.cs @@ -28,6 +28,13 @@ public record VoltageDrop : PhysicalQuantity, T>, IVector0A new VoltageDrop instance. /// Thrown when the resulting magnitude would be negative. public static VoltageDrop FromVolts(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new VoltageDrop from a value in Kilovolt. + /// + /// The value in Kilovolt. + /// A new VoltageDrop instance. + /// Thrown when the resulting magnitude would be negative. + public static VoltageDrop FromKilovolts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-ElectricPotential unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/VoltageMagnitude.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/VoltageMagnitude.g.cs index 7ecef6b..1d72803 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/VoltageMagnitude.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/VoltageMagnitude.g.cs @@ -27,6 +27,13 @@ public record VoltageMagnitude : PhysicalQuantity, T>, IV /// A new instance. /// Thrown when the resulting magnitude would be negative. public static VoltageMagnitude FromVolts(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new from a value in Kilovolt. + /// + /// The value in Kilovolt. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static VoltageMagnitude FromKilovolts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-ElectricPotential unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Volume.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Volume.g.cs index b2890aa..a24b676 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Volume.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Volume.g.cs @@ -41,6 +41,27 @@ public record Volume : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Volume FromMilliliters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); +/// + /// Creates a new from a value in CubicCentimeter. + /// + /// The value in CubicCentimeter. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Volume FromCubicCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CubicCentimeterToCubicMeters)), nameof(value))); +/// + /// Creates a new from a value in CubicFoot. + /// + /// The value in CubicFoot. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Volume FromCubicFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CubicFootToCubicMeters)), nameof(value))); +/// + /// Creates a new from a value in CubicInch. + /// + /// The value in CubicInch. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Volume FromCubicInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CubicInchToCubicMeters)), nameof(value))); /// /// Creates a new from a value in Gallon. /// @@ -48,6 +69,34 @@ public record Volume : PhysicalQuantity, T>, IVector0, T> /// A new instance. /// Thrown when the resulting magnitude would be negative. public static Volume FromGallons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GallonToCubicMeters)), nameof(value))); +/// + /// Creates a new from a value in ImperialGallon. + /// + /// The value in ImperialGallon. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Volume FromImperialGallons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ImperialGallonToCubicMeters)), nameof(value))); +/// + /// Creates a new from a value in USQuart. + /// + /// The value in USQuart. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Volume FromUSQuarts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.USQuartToCubicMeters)), nameof(value))); +/// + /// Creates a new from a value in USPint. + /// + /// The value in USPint. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Volume FromUSPints(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.USPintToCubicMeters)), nameof(value))); +/// + /// Creates a new from a value in USFluidOunce. + /// + /// The value in USFluidOunce. + /// A new instance. + /// Thrown when the resulting magnitude would be negative. + public static Volume FromUSFluidOunces(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.USFluidOunceToCubicMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Volume unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Wavelength.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Wavelength.g.cs index 704e9ea..793c2b7 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Wavelength.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Wavelength.g.cs @@ -98,6 +98,13 @@ public record Wavelength : PhysicalQuantity, T>, IVector0A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. public static Wavelength FromMiles(T value) => Create(Vector0Guards.EnsurePositive((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); +/// + /// Creates a new Wavelength from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new Wavelength instance. + /// Thrown when the resulting magnitude would be negative. + public static Wavelength FromNauticalMiles(T value) => Create(Vector0Guards.EnsurePositive((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Weight.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Weight.g.cs index 635478f..b31d7d2 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Weight.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Weight.g.cs @@ -28,6 +28,27 @@ public record Weight : PhysicalQuantity, T>, IVector0, T> /// A new Weight instance. /// Thrown when the resulting magnitude would be negative. public static Weight FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Weight from a value in Kilonewton. + /// + /// The value in Kilonewton. + /// A new Weight instance. + /// Thrown when the resulting magnitude would be negative. + public static Weight FromKilonewtons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); +/// + /// Creates a new Weight from a value in Dyne. + /// + /// The value in Dyne. + /// A new Weight instance. + /// Thrown when the resulting magnitude would be negative. + public static Weight FromDynes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DyneToNewtons)), nameof(value))); +/// + /// Creates a new Weight from a value in PoundForce. + /// + /// The value in PoundForce. + /// A new Weight instance. + /// Thrown when the resulting magnitude would be negative. + public static Weight FromPoundsForce(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundForceToNewtons)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Force unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Width.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Width.g.cs index c41816b..cb64f04 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Width.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Width.g.cs @@ -98,6 +98,13 @@ public record Width : PhysicalQuantity, T>, IVector0, T> /// A new Width instance. /// Thrown when the resulting magnitude would be negative. public static Width FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); +/// + /// Creates a new Width from a value in NauticalMile. + /// + /// The value in NauticalMile. + /// A new Width instance. + /// Thrown when the resulting magnitude would be negative. + public static Width FromNauticalMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.NauticalMileToMeters)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Length unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/WindSpeed.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/WindSpeed.g.cs index dd2069e..efa6915 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/WindSpeed.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/WindSpeed.g.cs @@ -42,6 +42,20 @@ public record WindSpeed : PhysicalQuantity, T>, IVector0A new WindSpeed instance. /// Thrown when the resulting magnitude would be negative. public static WindSpeed FromMilesPerHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MilesPerHourToMetersPerSecond)), nameof(value))); +/// + /// Creates a new WindSpeed from a value in FeetPerSecond. + /// + /// The value in FeetPerSecond. + /// A new WindSpeed instance. + /// Thrown when the resulting magnitude would be negative. + public static WindSpeed FromFeetPerSecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetPerSecondToMetersPerSecond)), nameof(value))); +/// + /// Creates a new WindSpeed from a value in Knot. + /// + /// The value in Knot. + /// A new WindSpeed instance. + /// Thrown when the resulting magnitude would be negative. + public static WindSpeed FromKnots(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KnotToMetersPerSecond)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Velocity unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Work.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Work.g.cs index 601e49c..ad6f05e 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Work.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Work.g.cs @@ -28,6 +28,13 @@ public record Work : PhysicalQuantity, T>, IVector0, T> /// A new Work instance. /// Thrown when the resulting magnitude would be negative. public static Work FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new Work from a value in Kilojoule. + /// + /// The value in Kilojoule. + /// A new Work instance. + /// Thrown when the resulting magnitude would be negative. + public static Work FromKilojoules(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Work from a value in ElectronVolt. /// @@ -42,6 +49,13 @@ public record Work : PhysicalQuantity, T>, IVector0, T> /// A new Work instance. /// Thrown when the resulting magnitude would be negative. public static Work FromCalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); +/// + /// Creates a new Work from a value in Kilocalorie. + /// + /// The value in Kilocalorie. + /// A new Work instance. + /// Thrown when the resulting magnitude would be negative. + public static Work FromKilocalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilocalorieToJoules)), nameof(value))); /// /// Creates a new Work from a value in KilowattHour. /// @@ -49,6 +63,27 @@ public record Work : PhysicalQuantity, T>, IVector0, T> /// A new Work instance. /// Thrown when the resulting magnitude would be negative. public static Work FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); +/// + /// Creates a new Work from a value in WattHour. + /// + /// The value in WattHour. + /// A new Work instance. + /// Thrown when the resulting magnitude would be negative. + public static Work FromWattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.WattHourToJoules)), nameof(value))); +/// + /// Creates a new Work from a value in Erg. + /// + /// The value in Erg. + /// A new Work instance. + /// Thrown when the resulting magnitude would be negative. + public static Work FromErgs(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ErgToJoules)), nameof(value))); +/// + /// Creates a new Work from a value in Btu. + /// + /// The value in Btu. + /// A new Work instance. + /// Thrown when the resulting magnitude would be negative. + public static Work FromBtus(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BtuToJoules)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Energy unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/YoungsModulus.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/YoungsModulus.g.cs index f4f3e45..d4a8d3d 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/YoungsModulus.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/YoungsModulus.g.cs @@ -28,6 +28,13 @@ public record YoungsModulus : PhysicalQuantity, T>, IVector0 /// A new YoungsModulus instance. /// Thrown when the resulting magnitude would be negative. public static YoungsModulus FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); +/// + /// Creates a new YoungsModulus from a value in Kilopascal. + /// + /// The value in Kilopascal. + /// A new YoungsModulus instance. + /// Thrown when the resulting magnitude would be negative. + public static YoungsModulus FromKilopascals(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new YoungsModulus from a value in Bar. /// @@ -49,6 +56,13 @@ public record YoungsModulus : PhysicalQuantity, T>, IVector0 /// A new YoungsModulus instance. /// Thrown when the resulting magnitude would be negative. public static YoungsModulus FromPsi(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PsiToPascals)), nameof(value))); +/// + /// Creates a new YoungsModulus from a value in Torr. + /// + /// The value in Torr. + /// A new YoungsModulus instance. + /// Thrown when the resulting magnitude would be negative. + public static YoungsModulus FromTorr(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.TorrToPascals)), nameof(value))); /// /// Converts this quantity's SI-base value to the value in . /// Cross-dimension calls (e.g. passing a non-Pressure unit) fail at compile time. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.UnitsGenerator/Units.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.UnitsGenerator/Units.g.cs index 31b4be8..468f47c 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.UnitsGenerator/Units.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.UnitsGenerator/Units.g.cs @@ -933,721 +933,721 @@ public Degree() { } }; /// -/// Newton - SI derived unit of force. +/// Nautical mile - 1852 meters, used in navigation. /// -public sealed record Newton : IUnit, IForceUnit +public sealed record NauticalMile : IUnit, ILengthUnit { /// Gets the full name of the unit. - public string Name => "Newton"; + public string Name => "NauticalMile"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "N"; + public string Symbol => "nmi"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Force; + public DimensionInfo Dimension => PhysicalDimensions.Length; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => NauticalMileToMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Newton() { } + public NauticalMile() { } }; /// -/// Pascal - SI derived unit of pressure. +/// Stone - Imperial unit of mass (14 pounds). /// -public sealed record Pascal : IUnit, IPressureUnit +public sealed record Stone : IUnit, IMassUnit { /// Gets the full name of the unit. - public string Name => "Pascal"; + public string Name => "Stone"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "Pa"; + public string Symbol => "st"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Imperial; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Pressure; + public DimensionInfo Dimension => PhysicalDimensions.Mass; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => StoneToKilograms; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Pascal() { } + public Stone() { } }; /// -/// Meters per second - SI derived unit of velocity. +/// Short ton - US customary unit of mass (2000 pounds). /// -public sealed record MetersPerSecond : IUnit, IVelocityUnit +public sealed record ShortTon : IUnit, IMassUnit { /// Gets the full name of the unit. - public string Name => "MetersPerSecond"; + public string Name => "ShortTon"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "m/s"; + public string Symbol => "ton"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.USCustomary; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Velocity; + public DimensionInfo Dimension => PhysicalDimensions.Mass; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => ShortTonToKilograms; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public MetersPerSecond() { } + public ShortTon() { } }; /// -/// Meters per second squared - SI derived unit of acceleration. +/// Atomic mass unit - 1/12 the mass of a carbon-12 atom. /// -public sealed record MetersPerSecondSquared : IUnit, IAccelerationUnit +public sealed record AtomicMassUnit : IUnit, IMassUnit { /// Gets the full name of the unit. - public string Name => "MetersPerSecondSquared"; + public string Name => "AtomicMassUnit"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "m/s²"; + public string Symbol => "u"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Atomic; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Acceleration; + public DimensionInfo Dimension => PhysicalDimensions.Mass; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => AtomicMassUnitToKilograms; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public MetersPerSecondSquared() { } + public AtomicMassUnit() { } }; /// -/// Bar - Metric unit of pressure. +/// Week - 7 days. /// -public sealed record Bar : IUnit, IPressureUnit +public sealed record Week : IUnit, ITimeUnit { /// Gets the full name of the unit. - public string Name => "Bar"; + public string Name => "Week"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "bar"; + public string Symbol => "wk"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Pressure; + public DimensionInfo Dimension => PhysicalDimensions.Time; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => BarToPascals; + public double ToBaseFactor => WeekToSeconds; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Bar() { } + public Week() { } }; /// -/// Standard atmosphere - Unit of pressure. +/// Nanosecond - 1e-9 seconds. /// -public sealed record Atmosphere : IUnit, IPressureUnit +public sealed record Nanosecond : IUnit, ITimeUnit { /// Gets the full name of the unit. - public string Name => "Atmosphere"; + public string Name => "Nanosecond"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "atm"; + public string Symbol => "ns"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.Other; + public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Pressure; + public DimensionInfo Dimension => PhysicalDimensions.Time; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => AtmosphereToPascals; + public double ToBaseFactor => MetricMagnitudes.Nano; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Atmosphere() { } + public Nanosecond() { } }; /// -/// Pounds per square inch - Imperial unit of pressure. +/// Square kilometer - 1e6 square meters. /// -public sealed record Psi : IUnit, IPressureUnit +public sealed record SquareKilometer : IUnit, IAreaUnit { /// Gets the full name of the unit. - public string Name => "Psi"; + public string Name => "SquareKilometer"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "psi"; + public string Symbol => "km²"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.Imperial; + public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Pressure; + public DimensionInfo Dimension => PhysicalDimensions.Area; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => PsiToPascals; + public double ToBaseFactor => SquareKilometerToSquareMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Psi() { } + public SquareKilometer() { } }; /// -/// Kilometers per hour - Common unit of velocity. +/// Square centimeter - 1e-4 square meters. /// -public sealed record KilometersPerHour : IUnit, IVelocityUnit +public sealed record SquareCentimeter : IUnit, IAreaUnit { /// Gets the full name of the unit. - public string Name => "KilometersPerHour"; + public string Name => "SquareCentimeter"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "km/h"; + public string Symbol => "cm²"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Velocity; + public DimensionInfo Dimension => PhysicalDimensions.Area; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => KilometersPerHourToMetersPerSecond; + public double ToBaseFactor => SquareCentimeterToSquareMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public KilometersPerHour() { } + public SquareCentimeter() { } }; /// -/// Miles per hour - Imperial unit of velocity. +/// Square mile - Imperial unit of area. /// -public sealed record MilesPerHour : IUnit, IVelocityUnit +public sealed record SquareMile : IUnit, IAreaUnit { /// Gets the full name of the unit. - public string Name => "MilesPerHour"; + public string Name => "SquareMile"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "mph"; + public string Symbol => "mi²"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.Imperial; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Velocity; + public DimensionInfo Dimension => PhysicalDimensions.Area; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => MilesPerHourToMetersPerSecond; + public double ToBaseFactor => SquareMileToSquareMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public MilesPerHour() { } + public SquareMile() { } }; /// -/// Joule - SI derived unit of energy. +/// Hectare - metric unit of area (10000 m²). /// -public sealed record Joule : IUnit, IEnergyUnit +public sealed record Hectare : IUnit, IAreaUnit { /// Gets the full name of the unit. - public string Name => "Joule"; + public string Name => "Hectare"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "J"; + public string Symbol => "ha"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Metric; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Energy; + public DimensionInfo Dimension => PhysicalDimensions.Area; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => HectareToSquareMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Joule() { } + public Hectare() { } }; /// -/// Watt - SI derived unit of power. +/// Acre - Imperial unit of area. /// -public sealed record Watt : IUnit, IPowerUnit +public sealed record Acre : IUnit, IAreaUnit { /// Gets the full name of the unit. - public string Name => "Watt"; + public string Name => "Acre"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "W"; + public string Symbol => "ac"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Imperial; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Power; + public DimensionInfo Dimension => PhysicalDimensions.Area; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => AcreToSquareMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Watt() { } + public Acre() { } }; /// -/// Calorie - Thermochemical calorie, energy unit. +/// Cubic centimeter - 1e-6 cubic meters. /// -public sealed record Calorie : IUnit, IEnergyUnit +public sealed record CubicCentimeter : IUnit, IVolumeUnit { /// Gets the full name of the unit. - public string Name => "Calorie"; + public string Name => "CubicCentimeter"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "cal"; + public string Symbol => "cm³"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.Other; + public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Energy; + public DimensionInfo Dimension => PhysicalDimensions.Volume; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => CalorieToJoules; + public double ToBaseFactor => CubicCentimeterToCubicMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Calorie() { } + public CubicCentimeter() { } }; /// -/// Kilowatt-hour - Common unit of electrical energy. +/// Cubic foot - Imperial unit of volume. /// -public sealed record KilowattHour : IUnit, IEnergyUnit +public sealed record CubicFoot : IUnit, IVolumeUnit { /// Gets the full name of the unit. - public string Name => "KilowattHour"; + public string Name => "CubicFoot"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "kWh"; + public string Symbol => "ft³"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Imperial; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Energy; + public DimensionInfo Dimension => PhysicalDimensions.Volume; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => KilowattHourToJoules; + public double ToBaseFactor => CubicFootToCubicMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public KilowattHour() { } + public CubicFoot() { } }; /// -/// Mechanical horsepower - Imperial unit of power. +/// Cubic inch - Imperial unit of volume. /// -public sealed record Horsepower : IUnit, IPowerUnit +public sealed record CubicInch : IUnit, IVolumeUnit { /// Gets the full name of the unit. - public string Name => "Horsepower"; + public string Name => "CubicInch"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "hp"; + public string Symbol => "in³"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.Imperial; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Power; + public DimensionInfo Dimension => PhysicalDimensions.Volume; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => HorsepowerToWatts; + public double ToBaseFactor => CubicInchToCubicMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Horsepower() { } + public CubicInch() { } }; /// -/// Newton-second - SI derived unit of momentum. +/// Imperial gallon - British unit of volume. /// -public sealed record NewtonSecond : IUnit, IMomentumUnit +public sealed record ImperialGallon : IUnit, IVolumeUnit { /// Gets the full name of the unit. - public string Name => "NewtonSecond"; + public string Name => "ImperialGallon"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "N⋅s"; + public string Symbol => "imp gal"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Imperial; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Momentum; + public DimensionInfo Dimension => PhysicalDimensions.Volume; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => ImperialGallonToCubicMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public NewtonSecond() { } + public ImperialGallon() { } }; /// -/// Electron volt - Energy unit equal to electron charge times one volt. +/// US liquid quart - US customary unit of volume. /// -public sealed record ElectronVolt : IUnit, IEnergyUnit +public sealed record USQuart : IUnit, IVolumeUnit { /// Gets the full name of the unit. - public string Name => "ElectronVolt"; + public string Name => "USQuart"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "eV"; + public string Symbol => "qt"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.Other; + public UnitSystem System => UnitSystem.USCustomary; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Energy; + public DimensionInfo Dimension => PhysicalDimensions.Volume; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => ElectronVoltToJoules; + public double ToBaseFactor => USQuartToCubicMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public ElectronVolt() { } + public USQuart() { } }; /// -/// Newton-meter - SI derived unit of torque. +/// US liquid pint - US customary unit of volume. /// -public sealed record NewtonMeter : IUnit, ITorqueUnit +public sealed record USPint : IUnit, IVolumeUnit { /// Gets the full name of the unit. - public string Name => "NewtonMeter"; + public string Name => "USPint"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "N⋅m"; + public string Symbol => "pt"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.USCustomary; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Torque; + public DimensionInfo Dimension => PhysicalDimensions.Volume; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => USPintToCubicMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public NewtonMeter() { } + public USPint() { } }; /// -/// Pound-foot - Imperial unit of torque. +/// US fluid ounce - US customary unit of volume. /// -public sealed record PoundFoot : IUnit, ITorqueUnit +public sealed record USFluidOunce : IUnit, IVolumeUnit { /// Gets the full name of the unit. - public string Name => "PoundFoot"; + public string Name => "USFluidOunce"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "lb⋅ft"; + public string Symbol => "fl oz"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.Imperial; + public UnitSystem System => UnitSystem.USCustomary; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Torque; + public DimensionInfo Dimension => PhysicalDimensions.Volume; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => PoundFootToNewtonMeters; + public double ToBaseFactor => USFluidOunceToCubicMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public PoundFoot() { } + public USFluidOunce() { } }; /// -/// Kilogram-meter squared - SI derived unit of moment of inertia. +/// Gradian - 1/400 of a full circle (π/200 rad). /// -public sealed record KilogramMeterSquared : IUnit, IMomentOfInertiaUnit +public sealed record Gradian : IUnit, IDimensionlessUnit, IAngularDisplacementUnit { /// Gets the full name of the unit. - public string Name => "KilogramMeterSquared"; + public string Name => "Gradian"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "kg⋅m²"; + public string Symbol => "grad"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.MomentOfInertia; + public DimensionInfo Dimension => PhysicalDimensions.Dimensionless; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => GradianToRadians; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public KilogramMeterSquared() { } + public Gradian() { } }; /// -/// Kilogram-meter squared per second - SI derived unit of angular momentum. +/// Revolution - one full circle (2π rad). /// -public sealed record KilogramMeterSquaredPerSecond : IUnit, IAngularMomentumUnit +public sealed record Revolution : IUnit, IDimensionlessUnit, IAngularDisplacementUnit { /// Gets the full name of the unit. - public string Name => "KilogramMeterSquaredPerSecond"; + public string Name => "Revolution"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "kg⋅m²/s"; + public string Symbol => "rev"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.AngularMomentum; + public DimensionInfo Dimension => PhysicalDimensions.Dimensionless; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => RevolutionToRadians; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public KilogramMeterSquaredPerSecond() { } + public Revolution() { } }; /// -/// Meters per second cubed - SI derived unit of jerk. +/// Milliradian - 0.001 radians. /// -public sealed record MetersPerSecondCubed : IUnit, IJerkUnit +public sealed record Milliradian : IUnit, IDimensionlessUnit, IAngularDisplacementUnit { /// Gets the full name of the unit. - public string Name => "MetersPerSecondCubed"; + public string Name => "Milliradian"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "m/s³"; + public string Symbol => "mrad"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Jerk; + public DimensionInfo Dimension => PhysicalDimensions.Dimensionless; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => MetricMagnitudes.Milli; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public MetersPerSecondCubed() { } + public Milliradian() { } }; /// -/// Meters per second to the fourth - SI derived unit of snap. +/// Parts per million - 1e-6 dimensionless ratio. /// -public sealed record MetersPerSecondQuartic : IUnit, ISnapUnit +public sealed record PartsPerMillion : IUnit, IDimensionlessUnit { /// Gets the full name of the unit. - public string Name => "MetersPerSecondQuartic"; + public string Name => "PartsPerMillion"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "m/s⁴"; + public string Symbol => "ppm"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Snap; + public DimensionInfo Dimension => PhysicalDimensions.Dimensionless; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => PartsPerMillionToRatio; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public MetersPerSecondQuartic() { } + public PartsPerMillion() { } }; /// -/// Kelvin - SI base unit of thermodynamic temperature. +/// Parts per billion - 1e-9 dimensionless ratio. /// -public sealed record Kelvin : IUnit, ITemperatureUnit +public sealed record PartsPerBillion : IUnit, IDimensionlessUnit { /// Gets the full name of the unit. - public string Name => "Kelvin"; + public string Name => "PartsPerBillion"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "K"; + public string Symbol => "ppb"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIBase; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Temperature; + public DimensionInfo Dimension => PhysicalDimensions.Dimensionless; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => PartsPerBillionToRatio; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Kelvin() { } + public PartsPerBillion() { } }; /// -/// Celsius - Common temperature scale. +/// Percent by weight - mass fraction expressed as a percentage. /// -public sealed record Celsius : IUnit, ITemperatureUnit +public sealed record PercentByWeight : IUnit, IDimensionlessUnit { /// Gets the full name of the unit. - public string Name => "Celsius"; + public string Name => "PercentByWeight"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "°C"; + public string Symbol => "% w/w"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Temperature; + public DimensionInfo Dimension => PhysicalDimensions.Dimensionless; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => PercentByWeightToRatio; /// Gets the additive offset used in the to-base affine conversion. - public double ToBaseOffset => CelsiusToKelvinOffset; + public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Celsius() { } + public PercentByWeight() { } }; /// -/// Fahrenheit - Imperial temperature scale. +/// Newton - SI derived unit of force. /// -public sealed record Fahrenheit : IUnit, ITemperatureUnit +public sealed record Newton : IUnit, IForceUnit { /// Gets the full name of the unit. - public string Name => "Fahrenheit"; + public string Name => "Newton"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "°F"; + public string Symbol => "N"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.Imperial; + public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Temperature; + public DimensionInfo Dimension => PhysicalDimensions.Force; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => FahrenheitScale; + public double ToBaseFactor => 1d; /// Gets the additive offset used in the to-base affine conversion. - public double ToBaseOffset => FahrenheitToKelvinOffset; + public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Fahrenheit() { } + public Newton() { } }; /// -/// Joule per kelvin - SI derived unit of entropy and heat capacity. +/// Pascal - SI derived unit of pressure. /// -public sealed record JoulePerKelvin : IUnit, IEntropyUnit +public sealed record Pascal : IUnit, IPressureUnit { /// Gets the full name of the unit. - public string Name => "JoulePerKelvin"; + public string Name => "Pascal"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "J/K"; + public string Symbol => "Pa"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Entropy; + public DimensionInfo Dimension => PhysicalDimensions.Pressure; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -1656,26 +1656,26 @@ public sealed record JoulePerKelvin : IUnit, IEntropyUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public JoulePerKelvin() { } + public Pascal() { } }; /// -/// Joule per kilogram kelvin - SI derived unit of specific heat capacity. +/// Meters per second - SI derived unit of velocity. /// -public sealed record JoulePerKilogramKelvin : IUnit, ISpecificHeatUnit +public sealed record MetersPerSecond : IUnit, IVelocityUnit { /// Gets the full name of the unit. - public string Name => "JoulePerKilogramKelvin"; + public string Name => "MetersPerSecond"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "J/(kg·K)"; + public string Symbol => "m/s"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.SpecificHeat; + public DimensionInfo Dimension => PhysicalDimensions.Velocity; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -1684,26 +1684,26 @@ public sealed record JoulePerKilogramKelvin : IUnit, ISpecificHeatUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public JoulePerKilogramKelvin() { } + public MetersPerSecond() { } }; /// -/// Watt per meter kelvin - SI derived unit of thermal conductivity. +/// Meters per second squared - SI derived unit of acceleration. /// -public sealed record WattPerMeterKelvin : IUnit, IThermalConductivityUnit +public sealed record MetersPerSecondSquared : IUnit, IAccelerationUnit { /// Gets the full name of the unit. - public string Name => "WattPerMeterKelvin"; + public string Name => "MetersPerSecondSquared"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "W/(m·K)"; + public string Symbol => "m/s²"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.ThermalConductivity; + public DimensionInfo Dimension => PhysicalDimensions.Acceleration; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -1712,54 +1712,1818 @@ public sealed record WattPerMeterKelvin : IUnit, IThermalConductivityUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public WattPerMeterKelvin() { } + public MetersPerSecondSquared() { } }; /// -/// Watt per square meter kelvin - SI derived unit of heat transfer coefficient. +/// Bar - Metric unit of pressure. /// -public sealed record WattPerSquareMeterKelvin : IUnit, IHeatTransferCoefficientUnit +public sealed record Bar : IUnit, IPressureUnit { /// Gets the full name of the unit. - public string Name => "WattPerSquareMeterKelvin"; + public string Name => "Bar"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "W/(m²·K)"; + public string Symbol => "bar"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Pressure; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => BarToPascals; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Bar() { } + +}; + +/// +/// Standard atmosphere - Unit of pressure. +/// +public sealed record Atmosphere : IUnit, IPressureUnit +{ + /// Gets the full name of the unit. + public string Name => "Atmosphere"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "atm"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Other; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Pressure; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => AtmosphereToPascals; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Atmosphere() { } + +}; + +/// +/// Pounds per square inch - Imperial unit of pressure. +/// +public sealed record Psi : IUnit, IPressureUnit +{ + /// Gets the full name of the unit. + public string Name => "Psi"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "psi"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Imperial; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Pressure; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => PsiToPascals; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Psi() { } + +}; + +/// +/// Kilometers per hour - Common unit of velocity. +/// +public sealed record KilometersPerHour : IUnit, IVelocityUnit +{ + /// Gets the full name of the unit. + public string Name => "KilometersPerHour"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "km/h"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Velocity; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => KilometersPerHourToMetersPerSecond; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public KilometersPerHour() { } + +}; + +/// +/// Miles per hour - Imperial unit of velocity. +/// +public sealed record MilesPerHour : IUnit, IVelocityUnit +{ + /// Gets the full name of the unit. + public string Name => "MilesPerHour"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "mph"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Imperial; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Velocity; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MilesPerHourToMetersPerSecond; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public MilesPerHour() { } + +}; + +/// +/// Joule - SI derived unit of energy. +/// +public sealed record Joule : IUnit, IEnergyUnit +{ + /// Gets the full name of the unit. + public string Name => "Joule"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "J"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Energy; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Joule() { } + +}; + +/// +/// Watt - SI derived unit of power. +/// +public sealed record Watt : IUnit, IPowerUnit +{ + /// Gets the full name of the unit. + public string Name => "Watt"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "W"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.HeatTransferCoefficient; + public DimensionInfo Dimension => PhysicalDimensions.Power; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Watt() { } + +}; + +/// +/// Calorie - Thermochemical calorie, energy unit. +/// +public sealed record Calorie : IUnit, IEnergyUnit +{ + /// Gets the full name of the unit. + public string Name => "Calorie"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "cal"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Other; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Energy; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => CalorieToJoules; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Calorie() { } + +}; + +/// +/// Kilowatt-hour - Common unit of electrical energy. +/// +public sealed record KilowattHour : IUnit, IEnergyUnit +{ + /// Gets the full name of the unit. + public string Name => "KilowattHour"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kWh"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Energy; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => KilowattHourToJoules; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public KilowattHour() { } + +}; + +/// +/// Mechanical horsepower - Imperial unit of power. +/// +public sealed record Horsepower : IUnit, IPowerUnit +{ + /// Gets the full name of the unit. + public string Name => "Horsepower"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "hp"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Imperial; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Power; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => HorsepowerToWatts; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Horsepower() { } + +}; + +/// +/// Newton-second - SI derived unit of momentum. +/// +public sealed record NewtonSecond : IUnit, IMomentumUnit +{ + /// Gets the full name of the unit. + public string Name => "NewtonSecond"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "N⋅s"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Momentum; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public NewtonSecond() { } + +}; + +/// +/// Electron volt - Energy unit equal to electron charge times one volt. +/// +public sealed record ElectronVolt : IUnit, IEnergyUnit +{ + /// Gets the full name of the unit. + public string Name => "ElectronVolt"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "eV"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Other; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Energy; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => ElectronVoltToJoules; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public ElectronVolt() { } + +}; + +/// +/// Newton-meter - SI derived unit of torque. +/// +public sealed record NewtonMeter : IUnit, ITorqueUnit +{ + /// Gets the full name of the unit. + public string Name => "NewtonMeter"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "N⋅m"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Torque; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public NewtonMeter() { } + +}; + +/// +/// Pound-foot - Imperial unit of torque. +/// +public sealed record PoundFoot : IUnit, ITorqueUnit +{ + /// Gets the full name of the unit. + public string Name => "PoundFoot"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "lb⋅ft"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Imperial; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Torque; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => PoundFootToNewtonMeters; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public PoundFoot() { } + +}; + +/// +/// Kilogram-meter squared - SI derived unit of moment of inertia. +/// +public sealed record KilogramMeterSquared : IUnit, IMomentOfInertiaUnit +{ + /// Gets the full name of the unit. + public string Name => "KilogramMeterSquared"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kg⋅m²"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.MomentOfInertia; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public KilogramMeterSquared() { } + +}; + +/// +/// Kilogram-meter squared per second - SI derived unit of angular momentum. +/// +public sealed record KilogramMeterSquaredPerSecond : IUnit, IAngularMomentumUnit +{ + /// Gets the full name of the unit. + public string Name => "KilogramMeterSquaredPerSecond"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kg⋅m²/s"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.AngularMomentum; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public KilogramMeterSquaredPerSecond() { } + +}; + +/// +/// Meters per second cubed - SI derived unit of jerk. +/// +public sealed record MetersPerSecondCubed : IUnit, IJerkUnit +{ + /// Gets the full name of the unit. + public string Name => "MetersPerSecondCubed"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "m/s³"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Jerk; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public MetersPerSecondCubed() { } + +}; + +/// +/// Meters per second to the fourth - SI derived unit of snap. +/// +public sealed record MetersPerSecondQuartic : IUnit, ISnapUnit +{ + /// Gets the full name of the unit. + public string Name => "MetersPerSecondQuartic"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "m/s⁴"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Snap; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public MetersPerSecondQuartic() { } + +}; + +/// +/// Feet per second - Imperial unit of velocity. +/// +public sealed record FeetPerSecond : IUnit, IVelocityUnit +{ + /// Gets the full name of the unit. + public string Name => "FeetPerSecond"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "ft/s"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Imperial; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Velocity; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => FeetPerSecondToMetersPerSecond; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public FeetPerSecond() { } + +}; + +/// +/// Knot - one nautical mile per hour. +/// +public sealed record Knot : IUnit, IVelocityUnit +{ + /// Gets the full name of the unit. + public string Name => "Knot"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kn"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Other; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Velocity; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => KnotToMetersPerSecond; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Knot() { } + +}; + +/// +/// Standard gravity - acceleration of free fall at Earth's surface. +/// +public sealed record StandardGravity : IUnit, IAccelerationUnit +{ + /// Gets the full name of the unit. + public string Name => "StandardGravity"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "g"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Other; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Acceleration; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => StandardGravityToMetersPerSecondSquared; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public StandardGravity() { } + +}; + +/// +/// Kilonewton - 1000 newtons. +/// +public sealed record Kilonewton : IUnit, IForceUnit +{ + /// Gets the full name of the unit. + public string Name => "Kilonewton"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kN"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Force; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Kilo; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Kilonewton() { } + +}; + +/// +/// Dyne - CGS unit of force. +/// +public sealed record Dyne : IUnit, IForceUnit +{ + /// Gets the full name of the unit. + public string Name => "Dyne"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "dyn"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.CGS; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Force; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => DyneToNewtons; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Dyne() { } + +}; + +/// +/// Pound-force - Imperial unit of force. +/// +public sealed record PoundForce : IUnit, IForceUnit +{ + /// Gets the full name of the unit. + public string Name => "PoundForce"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "lbf"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Imperial; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Force; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => PoundForceToNewtons; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public PoundForce() { } + +}; + +/// +/// Kilopascal - 1000 pascals. +/// +public sealed record Kilopascal : IUnit, IPressureUnit +{ + /// Gets the full name of the unit. + public string Name => "Kilopascal"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kPa"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Pressure; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Kilo; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Kilopascal() { } + +}; + +/// +/// Torr - 1/760 of a standard atmosphere. +/// +public sealed record Torr : IUnit, IPressureUnit +{ + /// Gets the full name of the unit. + public string Name => "Torr"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "Torr"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Other; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Pressure; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => TorrToPascals; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Torr() { } + +}; + +/// +/// Kilojoule - 1000 joules. +/// +public sealed record Kilojoule : IUnit, IEnergyUnit +{ + /// Gets the full name of the unit. + public string Name => "Kilojoule"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kJ"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Energy; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Kilo; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Kilojoule() { } + +}; + +/// +/// Kilocalorie - 1000 thermochemical calories. +/// +public sealed record Kilocalorie : IUnit, IEnergyUnit +{ + /// Gets the full name of the unit. + public string Name => "Kilocalorie"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kcal"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Other; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Energy; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => KilocalorieToJoules; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Kilocalorie() { } + +}; + +/// +/// Watt-hour - 3600 joules. +/// +public sealed record WattHour : IUnit, IEnergyUnit +{ + /// Gets the full name of the unit. + public string Name => "WattHour"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "Wh"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Energy; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => WattHourToJoules; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public WattHour() { } + +}; + +/// +/// Erg - CGS unit of energy. +/// +public sealed record Erg : IUnit, IEnergyUnit +{ + /// Gets the full name of the unit. + public string Name => "Erg"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "erg"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.CGS; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Energy; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => ErgToJoules; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Erg() { } + +}; + +/// +/// British thermal unit (IT) - Imperial unit of energy. +/// +public sealed record Btu : IUnit, IEnergyUnit +{ + /// Gets the full name of the unit. + public string Name => "Btu"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "BTU"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Imperial; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Energy; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => BtuToJoules; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Btu() { } + +}; + +/// +/// Kilowatt - 1000 watts. +/// +public sealed record Kilowatt : IUnit, IPowerUnit +{ + /// Gets the full name of the unit. + public string Name => "Kilowatt"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kW"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Power; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Kilo; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Kilowatt() { } + +}; + +/// +/// Megawatt - 1e6 watts. +/// +public sealed record Megawatt : IUnit, IPowerUnit +{ + /// Gets the full name of the unit. + public string Name => "Megawatt"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "MW"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Power; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Mega; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Megawatt() { } + +}; + +/// +/// Kelvin - SI base unit of thermodynamic temperature. +/// +public sealed record Kelvin : IUnit, ITemperatureUnit +{ + /// Gets the full name of the unit. + public string Name => "Kelvin"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "K"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIBase; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Temperature; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Kelvin() { } + +}; + +/// +/// Celsius - Common temperature scale. +/// +public sealed record Celsius : IUnit, ITemperatureUnit +{ + /// Gets the full name of the unit. + public string Name => "Celsius"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "°C"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Temperature; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => CelsiusToKelvinOffset; + + /// Initializes a new instance of the unit. + public Celsius() { } + +}; + +/// +/// Fahrenheit - Imperial temperature scale. +/// +public sealed record Fahrenheit : IUnit, ITemperatureUnit +{ + /// Gets the full name of the unit. + public string Name => "Fahrenheit"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "°F"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Imperial; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Temperature; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => FahrenheitScale; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => FahrenheitToKelvinOffset; + + /// Initializes a new instance of the unit. + public Fahrenheit() { } + +}; + +/// +/// Joule per kelvin - SI derived unit of entropy and heat capacity. +/// +public sealed record JoulePerKelvin : IUnit, IEntropyUnit +{ + /// Gets the full name of the unit. + public string Name => "JoulePerKelvin"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "J/K"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Entropy; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public JoulePerKelvin() { } + +}; + +/// +/// Joule per kilogram kelvin - SI derived unit of specific heat capacity. +/// +public sealed record JoulePerKilogramKelvin : IUnit, ISpecificHeatUnit +{ + /// Gets the full name of the unit. + public string Name => "JoulePerKilogramKelvin"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "J/(kg·K)"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.SpecificHeat; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public JoulePerKilogramKelvin() { } + +}; + +/// +/// Watt per meter kelvin - SI derived unit of thermal conductivity. +/// +public sealed record WattPerMeterKelvin : IUnit, IThermalConductivityUnit +{ + /// Gets the full name of the unit. + public string Name => "WattPerMeterKelvin"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "W/(m·K)"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ThermalConductivity; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public WattPerMeterKelvin() { } + +}; + +/// +/// Watt per square meter kelvin - SI derived unit of heat transfer coefficient. +/// +public sealed record WattPerSquareMeterKelvin : IUnit, IHeatTransferCoefficientUnit +{ + /// Gets the full name of the unit. + public string Name => "WattPerSquareMeterKelvin"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "W/(m²·K)"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.HeatTransferCoefficient; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public WattPerSquareMeterKelvin() { } + +}; + +/// +/// Per kelvin - SI derived unit of thermal expansion coefficient. +/// +public sealed record PerKelvin : IUnit, IThermalExpansionUnit +{ + /// Gets the full name of the unit. + public string Name => "PerKelvin"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "K⁻¹"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ThermalExpansion; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public PerKelvin() { } + +}; + +/// +/// Rankine - absolute temperature scale with Fahrenheit-sized degrees. +/// +public sealed record Rankine : IUnit, ITemperatureUnit +{ + /// Gets the full name of the unit. + public string Name => "Rankine"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "°R"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Imperial; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Temperature; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => FahrenheitScale; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Rankine() { } + +}; + +/// +/// Ampere - SI base unit of electric current. +/// +public sealed record Ampere : IUnit, IElectricCurrentUnit +{ + /// Gets the full name of the unit. + public string Name => "Ampere"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "A"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIBase; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricCurrent; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Ampere() { } + +}; + +/// +/// Volt - SI derived unit of electric potential. +/// +public sealed record Volt : IUnit, IElectricPotentialUnit +{ + /// Gets the full name of the unit. + public string Name => "Volt"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "V"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricPotential; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Volt() { } + +}; + +/// +/// Volt per meter - SI derived unit of electric field strength. +/// +public sealed record VoltPerMeter : IUnit, IElectricFieldUnit +{ + /// Gets the full name of the unit. + public string Name => "VoltPerMeter"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "V/m"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricField; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public VoltPerMeter() { } + +}; + +/// +/// Ohm - SI derived unit of electric resistance. +/// +public sealed record Ohm : IUnit, IElectricResistanceUnit +{ + /// Gets the full name of the unit. + public string Name => "Ohm"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "Ω"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricResistance; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Ohm() { } + +}; + +/// +/// Coulomb - SI derived unit of electric charge. +/// +public sealed record Coulomb : IUnit, IElectricChargeUnit +{ + /// Gets the full name of the unit. + public string Name => "Coulomb"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "C"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricCharge; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Coulomb() { } + +}; + +/// +/// Farad - SI derived unit of electric capacitance. +/// +public sealed record Farad : IUnit, IElectricCapacitanceUnit +{ + /// Gets the full name of the unit. + public string Name => "Farad"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "F"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricCapacitance; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Farad() { } + +}; + +/// +/// Siemens - SI derived unit of electric conductance. +/// +public sealed record Siemens : IUnit, IElectricConductanceUnit +{ + /// Gets the full name of the unit. + public string Name => "Siemens"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "S"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricConductance; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Siemens() { } + +}; + +/// +/// Tesla - SI derived unit of magnetic flux density. +/// +public sealed record Tesla : IUnit, IMagneticFluxDensityUnit +{ + /// Gets the full name of the unit. + public string Name => "Tesla"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "T"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.MagneticFluxDensity; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Tesla() { } + +}; + +/// +/// Gauss - CGS unit of magnetic flux density. +/// +public sealed record Gauss : IUnit, IMagneticFluxDensityUnit +{ + /// Gets the full name of the unit. + public string Name => "Gauss"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "G"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.CGS; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.MagneticFluxDensity; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => GaussToTesla; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Gauss() { } + +}; + +/// +/// Weber - SI derived unit of magnetic flux. +/// +public sealed record Weber : IUnit, IMagneticFluxUnit +{ + /// Gets the full name of the unit. + public string Name => "Weber"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "Wb"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.MagneticFlux; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Weber() { } + +}; + +/// +/// Henry - SI derived unit of inductance. +/// +public sealed record Henry : IUnit, IInductanceUnit +{ + /// Gets the full name of the unit. + public string Name => "Henry"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "H"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.Inductance; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Henry() { } + +}; + +/// +/// Milliampere - 0.001 amperes. +/// +public sealed record Milliampere : IUnit, IElectricCurrentUnit +{ + /// Gets the full name of the unit. + public string Name => "Milliampere"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "mA"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricCurrent; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Milli; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Milliampere() { } + +}; + +/// +/// Kiloampere - 1000 amperes. +/// +public sealed record Kiloampere : IUnit, IElectricCurrentUnit +{ + /// Gets the full name of the unit. + public string Name => "Kiloampere"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kA"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricCurrent; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Kilo; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Kiloampere() { } + +}; + +/// +/// Kilovolt - 1000 volts. +/// +public sealed record Kilovolt : IUnit, IElectricPotentialUnit +{ + /// Gets the full name of the unit. + public string Name => "Kilovolt"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kV"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricPotential; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Kilo; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Kilovolt() { } + +}; + +/// +/// Kilohm - 1000 ohms. +/// +public sealed record Kilohm : IUnit, IElectricResistanceUnit +{ + /// Gets the full name of the unit. + public string Name => "Kilohm"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "kΩ"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricResistance; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Kilo; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Kilohm() { } + +}; + +/// +/// Megohm - 1e6 ohms. +/// +public sealed record Megohm : IUnit, IElectricResistanceUnit +{ + /// Gets the full name of the unit. + public string Name => "Megohm"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "MΩ"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricResistance; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Mega; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Megohm() { } + +}; + +/// +/// Microfarad - 1e-6 farads. +/// +public sealed record Microfarad : IUnit, IElectricCapacitanceUnit +{ + /// Gets the full name of the unit. + public string Name => "Microfarad"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "μF"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricCapacitance; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Micro; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Microfarad() { } + +}; + +/// +/// Nanofarad - 1e-9 farads. +/// +public sealed record Nanofarad : IUnit, IElectricCapacitanceUnit +{ + /// Gets the full name of the unit. + public string Name => "Nanofarad"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "nF"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricCapacitance; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Nano; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Nanofarad() { } + +}; + +/// +/// Picofarad - 1e-12 farads. +/// +public sealed record Picofarad : IUnit, IElectricCapacitanceUnit +{ + /// Gets the full name of the unit. + public string Name => "Picofarad"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "pF"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricCapacitance; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => MetricMagnitudes.Pico; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Picofarad() { } + +}; + +/// +/// Ampere-hour - 3600 coulombs of electric charge. +/// +public sealed record AmpereHour : IUnit, IElectricChargeUnit +{ + /// Gets the full name of the unit. + public string Name => "AmpereHour"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "Ah"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.ElectricCharge; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => AmpereHourToCoulombs; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public AmpereHour() { } + +}; + +/// +/// Radians per second - SI derived unit of angular velocity. +/// +public sealed record RadiansPerSecond : IUnit, IAngularVelocityUnit +{ + /// Gets the full name of the unit. + public string Name => "RadiansPerSecond"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "rad/s"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.SIDerived; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.AngularVelocity; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => 1d; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public RadiansPerSecond() { } + +}; + +/// +/// Revolutions per minute - Common unit of angular velocity. +/// +public sealed record RevolutionsPerMinute : IUnit, IAngularVelocityUnit +{ + /// Gets the full name of the unit. + public string Name => "RevolutionsPerMinute"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "rpm"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Other; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.AngularVelocity; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => RevolutionsPerMinuteToRadiansPerSecond; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public WattPerSquareMeterKelvin() { } + public RevolutionsPerMinute() { } }; /// -/// Per kelvin - SI derived unit of thermal expansion coefficient. +/// Radians per second squared - SI derived unit of angular acceleration. /// -public sealed record PerKelvin : IUnit, IThermalExpansionUnit +public sealed record RadiansPerSecondSquared : IUnit, IAngularAccelerationUnit { /// Gets the full name of the unit. - public string Name => "PerKelvin"; + public string Name => "RadiansPerSecondSquared"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "K⁻¹"; + public string Symbol => "rad/s²"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.ThermalExpansion; + public DimensionInfo Dimension => PhysicalDimensions.AngularAcceleration; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -1768,26 +3532,26 @@ public sealed record PerKelvin : IUnit, IThermalExpansionUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public PerKelvin() { } + public RadiansPerSecondSquared() { } }; /// -/// Ampere - SI base unit of electric current. +/// Radians per second cubed - SI derived unit of angular jerk. /// -public sealed record Ampere : IUnit, IElectricCurrentUnit +public sealed record RadiansPerSecondCubed : IUnit, IAngularJerkUnit { /// Gets the full name of the unit. - public string Name => "Ampere"; + public string Name => "RadiansPerSecondCubed"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "A"; + public string Symbol => "rad/s³"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIBase; + public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.ElectricCurrent; + public DimensionInfo Dimension => PhysicalDimensions.AngularJerk; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -1796,26 +3560,26 @@ public sealed record Ampere : IUnit, IElectricCurrentUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Ampere() { } + public RadiansPerSecondCubed() { } }; /// -/// Volt - SI derived unit of electric potential. +/// Hertz - SI derived unit of frequency. /// -public sealed record Volt : IUnit, IElectricPotentialUnit +public sealed record Hertz : IUnit, IFrequencyUnit { /// Gets the full name of the unit. - public string Name => "Volt"; + public string Name => "Hertz"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "V"; + public string Symbol => "Hz"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.ElectricPotential; + public DimensionInfo Dimension => PhysicalDimensions.Frequency; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -1824,82 +3588,82 @@ public sealed record Volt : IUnit, IElectricPotentialUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Volt() { } + public Hertz() { } }; /// -/// Volt per meter - SI derived unit of electric field strength. +/// Kilohertz - 1000 hertz. /// -public sealed record VoltPerMeter : IUnit, IElectricFieldUnit +public sealed record Kilohertz : IUnit, IFrequencyUnit { /// Gets the full name of the unit. - public string Name => "VoltPerMeter"; + public string Name => "Kilohertz"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "V/m"; + public string Symbol => "kHz"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.ElectricField; + public DimensionInfo Dimension => PhysicalDimensions.Frequency; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => MetricMagnitudes.Kilo; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public VoltPerMeter() { } + public Kilohertz() { } }; /// -/// Ohm - SI derived unit of electric resistance. +/// Megahertz - 1e6 hertz. /// -public sealed record Ohm : IUnit, IElectricResistanceUnit +public sealed record Megahertz : IUnit, IFrequencyUnit { /// Gets the full name of the unit. - public string Name => "Ohm"; + public string Name => "Megahertz"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "Ω"; + public string Symbol => "MHz"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.ElectricResistance; + public DimensionInfo Dimension => PhysicalDimensions.Frequency; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => MetricMagnitudes.Mega; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Ohm() { } + public Megahertz() { } }; /// -/// Coulomb - SI derived unit of electric charge. +/// Candela - SI base unit of luminous intensity. /// -public sealed record Coulomb : IUnit, IElectricChargeUnit +public sealed record Candela : IUnit, ILuminousIntensityUnit { /// Gets the full name of the unit. - public string Name => "Coulomb"; + public string Name => "Candela"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "C"; + public string Symbol => "cd"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.SIBase; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.ElectricCharge; + public DimensionInfo Dimension => PhysicalDimensions.LuminousIntensity; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -1908,26 +3672,26 @@ public sealed record Coulomb : IUnit, IElectricChargeUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Coulomb() { } + public Candela() { } }; /// -/// Farad - SI derived unit of electric capacitance. +/// Lumen - SI derived unit of luminous flux. /// -public sealed record Farad : IUnit, IElectricCapacitanceUnit +public sealed record Lumen : IUnit, ILuminousFluxUnit { /// Gets the full name of the unit. - public string Name => "Farad"; + public string Name => "Lumen"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "F"; + public string Symbol => "lm"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.ElectricCapacitance; + public DimensionInfo Dimension => PhysicalDimensions.LuminousFlux; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -1936,26 +3700,26 @@ public sealed record Farad : IUnit, IElectricCapacitanceUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Farad() { } + public Lumen() { } }; /// -/// Siemens - SI derived unit of electric conductance. +/// Lux - SI derived unit of illuminance. /// -public sealed record Siemens : IUnit, IElectricConductanceUnit +public sealed record Lux : IUnit, IIlluminanceUnit { /// Gets the full name of the unit. - public string Name => "Siemens"; + public string Name => "Lux"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "S"; + public string Symbol => "lx"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.ElectricConductance; + public DimensionInfo Dimension => PhysicalDimensions.Illuminance; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -1964,26 +3728,26 @@ public sealed record Siemens : IUnit, IElectricConductanceUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Siemens() { } + public Lux() { } }; /// -/// Tesla - SI derived unit of magnetic flux density. +/// Diopter - SI unit of optical power. /// -public sealed record Tesla : IUnit, IMagneticFluxDensityUnit +public sealed record Diopter : IUnit, IOpticalPowerUnit { /// Gets the full name of the unit. - public string Name => "Tesla"; + public string Name => "Diopter"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "T"; + public string Symbol => "D"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.MagneticFluxDensity; + public DimensionInfo Dimension => PhysicalDimensions.OpticalPower; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -1992,82 +3756,82 @@ public sealed record Tesla : IUnit, IMagneticFluxDensityUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Tesla() { } + public Diopter() { } }; /// -/// Gauss - CGS unit of magnetic flux density. +/// Millicandela - 0.001 candelas. /// -public sealed record Gauss : IUnit, IMagneticFluxDensityUnit +public sealed record Millicandela : IUnit, ILuminousIntensityUnit { /// Gets the full name of the unit. - public string Name => "Gauss"; + public string Name => "Millicandela"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "G"; + public string Symbol => "mcd"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.CGS; + public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.MagneticFluxDensity; + public DimensionInfo Dimension => PhysicalDimensions.LuminousIntensity; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => GaussToTesla; + public double ToBaseFactor => MetricMagnitudes.Milli; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Gauss() { } + public Millicandela() { } }; /// -/// Weber - SI derived unit of magnetic flux. +/// Foot-candle - Imperial unit of illuminance (lumen per square foot). /// -public sealed record Weber : IUnit, IMagneticFluxUnit +public sealed record FootCandle : IUnit, IIlluminanceUnit { /// Gets the full name of the unit. - public string Name => "Weber"; + public string Name => "FootCandle"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "Wb"; + public string Symbol => "fc"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Imperial; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.MagneticFlux; + public DimensionInfo Dimension => PhysicalDimensions.Illuminance; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => FootCandleToLux; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Weber() { } + public FootCandle() { } }; /// -/// Henry - SI derived unit of inductance. +/// Becquerel - SI derived unit of radioactive activity. /// -public sealed record Henry : IUnit, IInductanceUnit +public sealed record Becquerel : IUnit, IRadioactiveActivityUnit { /// Gets the full name of the unit. - public string Name => "Henry"; + public string Name => "Becquerel"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "H"; + public string Symbol => "Bq"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Inductance; + public DimensionInfo Dimension => PhysicalDimensions.RadioactiveActivity; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -2076,26 +3840,26 @@ public sealed record Henry : IUnit, IInductanceUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Henry() { } + public Becquerel() { } }; /// -/// Radians per second - SI derived unit of angular velocity. +/// Gray - SI derived unit of absorbed dose. /// -public sealed record RadiansPerSecond : IUnit, IAngularVelocityUnit +public sealed record Gray : IUnit, IAbsorbedDoseUnit { /// Gets the full name of the unit. - public string Name => "RadiansPerSecond"; + public string Name => "Gray"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "rad/s"; + public string Symbol => "Gy"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.AngularVelocity; + public DimensionInfo Dimension => PhysicalDimensions.AbsorbedDose; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -2104,82 +3868,82 @@ public sealed record RadiansPerSecond : IUnit, IAngularVelocityUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public RadiansPerSecond() { } + public Gray() { } }; /// -/// Revolutions per minute - Common unit of angular velocity. +/// Sievert - SI derived unit of equivalent dose. /// -public sealed record RevolutionsPerMinute : IUnit, IAngularVelocityUnit +public sealed record Sievert : IUnit, IEquivalentDoseUnit { /// Gets the full name of the unit. - public string Name => "RevolutionsPerMinute"; + public string Name => "Sievert"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "rpm"; + public string Symbol => "Sv"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.Other; + public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.AngularVelocity; + public DimensionInfo Dimension => PhysicalDimensions.EquivalentDose; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => RevolutionsPerMinuteToRadiansPerSecond; + public double ToBaseFactor => 1d; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public RevolutionsPerMinute() { } + public Sievert() { } }; /// -/// Radians per second squared - SI derived unit of angular acceleration. +/// Barn - Unit of nuclear cross section. /// -public sealed record RadiansPerSecondSquared : IUnit, IAngularAccelerationUnit +public sealed record Barn : IUnit, INuclearCrossSectionUnit { /// Gets the full name of the unit. - public string Name => "RadiansPerSecondSquared"; + public string Name => "Barn"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "rad/s²"; + public string Symbol => "b"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.AngularAcceleration; + public DimensionInfo Dimension => PhysicalDimensions.NuclearCrossSection; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => BarnToSquareMeters; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public RadiansPerSecondSquared() { } + public Barn() { } }; /// -/// Radians per second cubed - SI derived unit of angular jerk. +/// Coulomb per kilogram - SI derived unit of radiation exposure. /// -public sealed record RadiansPerSecondCubed : IUnit, IAngularJerkUnit +public sealed record CoulombPerKilogram : IUnit, IExposureUnit { /// Gets the full name of the unit. - public string Name => "RadiansPerSecondCubed"; + public string Name => "CoulombPerKilogram"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "rad/s³"; + public string Symbol => "C/kg"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.AngularJerk; + public DimensionInfo Dimension => PhysicalDimensions.Exposure; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -2188,138 +3952,138 @@ public sealed record RadiansPerSecondCubed : IUnit, IAngularJerkUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public RadiansPerSecondCubed() { } + public CoulombPerKilogram() { } }; /// -/// Hertz - SI derived unit of frequency. +/// Curie - traditional unit of radioactive activity. /// -public sealed record Hertz : IUnit, IFrequencyUnit +public sealed record Curie : IUnit, IRadioactiveActivityUnit { /// Gets the full name of the unit. - public string Name => "Hertz"; + public string Name => "Curie"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "Hz"; + public string Symbol => "Ci"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Frequency; + public DimensionInfo Dimension => PhysicalDimensions.RadioactiveActivity; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => CurieToBecquerels; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Hertz() { } + public Curie() { } }; /// -/// Candela - SI base unit of luminous intensity. +/// Rad - traditional unit of absorbed dose (0.01 Gy). /// -public sealed record Candela : IUnit, ILuminousIntensityUnit +public sealed record Rad : IUnit, IAbsorbedDoseUnit { /// Gets the full name of the unit. - public string Name => "Candela"; + public string Name => "Rad"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "cd"; + public string Symbol => "rad"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIBase; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.LuminousIntensity; + public DimensionInfo Dimension => PhysicalDimensions.AbsorbedDose; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => RadToGrays; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Candela() { } + public Rad() { } }; /// -/// Lumen - SI derived unit of luminous flux. +/// Rem - traditional unit of equivalent dose (0.01 Sv). /// -public sealed record Lumen : IUnit, ILuminousFluxUnit +public sealed record Rem : IUnit, IEquivalentDoseUnit { /// Gets the full name of the unit. - public string Name => "Lumen"; + public string Name => "Rem"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "lm"; + public string Symbol => "rem"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.LuminousFlux; + public DimensionInfo Dimension => PhysicalDimensions.EquivalentDose; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => RemToSieverts; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Lumen() { } + public Rem() { } }; /// -/// Lux - SI derived unit of illuminance. +/// Roentgen - traditional unit of ionizing radiation exposure. /// -public sealed record Lux : IUnit, IIlluminanceUnit +public sealed record Roentgen : IUnit, IExposureUnit { /// Gets the full name of the unit. - public string Name => "Lux"; + public string Name => "Roentgen"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "lx"; + public string Symbol => "R"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.Other; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Illuminance; + public DimensionInfo Dimension => PhysicalDimensions.Exposure; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => RoentgenToCoulombsPerKilogram; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Lux() { } + public Roentgen() { } }; /// -/// Diopter - SI unit of optical power. +/// Kilogram per cubic meter - SI derived unit of density. /// -public sealed record Diopter : IUnit, IOpticalPowerUnit +public sealed record KilogramPerCubicMeter : IUnit, IDensityUnit { /// Gets the full name of the unit. - public string Name => "Diopter"; + public string Name => "KilogramPerCubicMeter"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "D"; + public string Symbol => "kg/m³"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.OpticalPower; + public DimensionInfo Dimension => PhysicalDimensions.Density; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -2328,82 +4092,82 @@ public sealed record Diopter : IUnit, IOpticalPowerUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Diopter() { } + public KilogramPerCubicMeter() { } }; /// -/// Becquerel - SI derived unit of radioactive activity. +/// Gram per cubic centimeter - 1000 kg/m³. /// -public sealed record Becquerel : IUnit, IRadioactiveActivityUnit +public sealed record GramPerCubicCentimeter : IUnit, IDensityUnit { /// Gets the full name of the unit. - public string Name => "Becquerel"; + public string Name => "GramPerCubicCentimeter"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "Bq"; + public string Symbol => "g/cm³"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.RadioactiveActivity; + public DimensionInfo Dimension => PhysicalDimensions.Density; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => GramPerCubicCentimeterToKilogramPerCubicMeter; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Becquerel() { } + public GramPerCubicCentimeter() { } }; /// -/// Gray - SI derived unit of absorbed dose. +/// Gram per liter - equal to one kilogram per cubic meter. /// -public sealed record Gray : IUnit, IAbsorbedDoseUnit +public sealed record GramPerLiter : IUnit, IDensityUnit { /// Gets the full name of the unit. - public string Name => "Gray"; + public string Name => "GramPerLiter"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "Gy"; + public string Symbol => "g/L"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.AbsorbedDose; + public DimensionInfo Dimension => PhysicalDimensions.Density; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => GramPerLiterToKilogramPerCubicMeter; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Gray() { } + public GramPerLiter() { } }; /// -/// Sievert - SI derived unit of equivalent dose. +/// Mole - SI base unit of amount of substance. /// -public sealed record Sievert : IUnit, IEquivalentDoseUnit +public sealed record Mole : IUnit, IAmountOfSubstanceUnit { /// Gets the full name of the unit. - public string Name => "Sievert"; + public string Name => "Mole"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "Sv"; + public string Symbol => "mol"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIDerived; + public UnitSystem System => UnitSystem.SIBase; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.EquivalentDose; + public DimensionInfo Dimension => PhysicalDimensions.AmountOfSubstance; /// Gets the multiplication factor used in the to-base affine conversion. public double ToBaseFactor => 1d; @@ -2412,132 +4176,132 @@ public sealed record Sievert : IUnit, IEquivalentDoseUnit public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Sievert() { } + public Mole() { } }; /// -/// Barn - Unit of nuclear cross section. +/// Molar - Moles per liter concentration. /// -public sealed record Barn : IUnit, INuclearCrossSectionUnit +public sealed record Molar : IUnit, IConcentrationUnit { /// Gets the full name of the unit. - public string Name => "Barn"; + public string Name => "Molar"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "b"; + public string Symbol => "M"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.Other; + public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.NuclearCrossSection; + public DimensionInfo Dimension => PhysicalDimensions.Concentration; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => BarnToSquareMeters; + public double ToBaseFactor => MolarToCubicMeter; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Barn() { } + public Molar() { } }; /// -/// Coulomb per kilogram - SI derived unit of radiation exposure. +/// Kilomole - 1000 moles. /// -public sealed record CoulombPerKilogram : IUnit, IExposureUnit +public sealed record Kilomole : IUnit, IAmountOfSubstanceUnit { /// Gets the full name of the unit. - public string Name => "CoulombPerKilogram"; + public string Name => "Kilomole"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "C/kg"; + public string Symbol => "kmol"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Exposure; + public DimensionInfo Dimension => PhysicalDimensions.AmountOfSubstance; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => MetricMagnitudes.Kilo; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public CoulombPerKilogram() { } + public Kilomole() { } }; /// -/// Kilogram per cubic meter - SI derived unit of density. +/// Millimole - 0.001 moles. /// -public sealed record KilogramPerCubicMeter : IUnit, IDensityUnit +public sealed record Millimole : IUnit, IAmountOfSubstanceUnit { /// Gets the full name of the unit. - public string Name => "KilogramPerCubicMeter"; + public string Name => "Millimole"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "kg/m³"; + public string Symbol => "mmol"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.Density; + public DimensionInfo Dimension => PhysicalDimensions.AmountOfSubstance; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => MetricMagnitudes.Milli; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public KilogramPerCubicMeter() { } + public Millimole() { } }; /// -/// Mole - SI base unit of amount of substance. +/// Millimolar - 0.001 moles per liter (1 mol/m³). /// -public sealed record Mole : IUnit, IAmountOfSubstanceUnit +public sealed record Millimolar : IUnit, IConcentrationUnit { /// Gets the full name of the unit. - public string Name => "Mole"; + public string Name => "Millimolar"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "mol"; + public string Symbol => "mM"; /// Gets the unit system this unit belongs to. - public UnitSystem System => UnitSystem.SIBase; + public UnitSystem System => UnitSystem.SIDerived; /// Gets the physical dimension this unit measures. - public DimensionInfo Dimension => PhysicalDimensions.AmountOfSubstance; + public DimensionInfo Dimension => PhysicalDimensions.Concentration; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => 1d; + public double ToBaseFactor => MillimolarToMolePerCubicMeter; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Mole() { } + public Millimolar() { } }; /// -/// Molar - Moles per liter concentration. +/// Micromolar - 1e-6 moles per liter (0.001 mol/m³). /// -public sealed record Molar : IUnit, IConcentrationUnit +public sealed record Micromolar : IUnit, IConcentrationUnit { /// Gets the full name of the unit. - public string Name => "Molar"; + public string Name => "Micromolar"; /// Gets the symbol/abbreviation of the unit. - public string Symbol => "M"; + public string Symbol => "μM"; /// Gets the unit system this unit belongs to. public UnitSystem System => UnitSystem.SIDerived; @@ -2546,13 +4310,13 @@ public sealed record Molar : IUnit, IConcentrationUnit public DimensionInfo Dimension => PhysicalDimensions.Concentration; /// Gets the multiplication factor used in the to-base affine conversion. - public double ToBaseFactor => MolarToCubicMeter; + public double ToBaseFactor => MicromolarToMolePerCubicMeter; /// Gets the additive offset used in the to-base affine conversion. public double ToBaseOffset => 0d; /// Initializes a new instance of the unit. - public Molar() { } + public Micromolar() { } }; @@ -2780,6 +4544,62 @@ public NewtonPerMeter() { } }; +/// +/// Centipoise - 0.001 pascal seconds (viscosity of water at 20°C ≈ 1 cP). +/// +public sealed record Centipoise : IUnit, IDynamicViscosityUnit +{ + /// Gets the full name of the unit. + public string Name => "Centipoise"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "cP"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.CGS; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.DynamicViscosity; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => CentipoiseToPascalSecond; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Centipoise() { } + +}; + +/// +/// Dyne per centimeter - CGS unit of surface tension. +/// +public sealed record DynePerCentimeter : IUnit, ISurfaceTensionUnit +{ + /// Gets the full name of the unit. + public string Name => "DynePerCentimeter"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "dyn/cm"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.CGS; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.SurfaceTension; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => DynePerCentimeterToNewtonPerMeter; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public DynePerCentimeter() { } + +}; + /// /// Kilogram per mole - SI derived unit of molar mass. /// @@ -2948,6 +4768,90 @@ public KilojoulePerMole() { } }; +/// +/// Calorie per mole - thermochemical calorie per mole. +/// +public sealed record CaloriePerMole : IUnit, IMolarEnergyUnit +{ + /// Gets the full name of the unit. + public string Name => "CaloriePerMole"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "cal/mol"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Other; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.MolarEnergy; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => CaloriePerMoleToJoulePerMole; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public CaloriePerMole() { } + +}; + +/// +/// Enzyme unit - one micromole of substrate per minute. +/// +public sealed record EnzymeUnit : IUnit, ICatalyticActivityUnit +{ + /// Gets the full name of the unit. + public string Name => "EnzymeUnit"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "U"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Other; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.CatalyticActivity; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => EnzymeUnitToKatals; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public EnzymeUnit() { } + +}; + +/// +/// Dalton - molar mass numerically equal to one gram per mole. +/// +public sealed record Dalton : IUnit, IMolarMassUnit +{ + /// Gets the full name of the unit. + public string Name => "Dalton"; + + /// Gets the symbol/abbreviation of the unit. + public string Symbol => "Da"; + + /// Gets the unit system this unit belongs to. + public UnitSystem System => UnitSystem.Atomic; + + /// Gets the physical dimension this unit measures. + public DimensionInfo Dimension => PhysicalDimensions.MolarMass; + + /// Gets the multiplication factor used in the to-base affine conversion. + public double ToBaseFactor => GramPerMoleToKilogramPerMole; + + /// Gets the additive offset used in the to-base affine conversion. + public double ToBaseOffset => 0d; + + /// Initializes a new instance of the unit. + public Dalton() { } + +}; + /// /// Watt per square meter - SI derived unit of irradiance and sound intensity. /// @@ -3009,15 +4913,24 @@ public PascalSecondPerMeter() { } /// types accept these on their typed In(...) methods. /// public static class Units{ + /// Singleton Acre instance. + public static readonly Acre Acre = new Acre(); + /// Singleton Ampere instance. public static readonly Ampere Ampere = new Ampere(); + /// Singleton AmpereHour instance. + public static readonly AmpereHour AmpereHour = new AmpereHour(); + /// Singleton Angstrom instance. public static readonly Angstrom Angstrom = new Angstrom(); /// Singleton Atmosphere instance. public static readonly Atmosphere Atmosphere = new Atmosphere(); + /// Singleton AtomicMassUnit instance. + public static readonly AtomicMassUnit AtomicMassUnit = new AtomicMassUnit(); + /// Singleton Bar instance. public static readonly Bar Bar = new Bar(); @@ -3027,9 +4940,15 @@ public static class Units{ /// Singleton Becquerel instance. public static readonly Becquerel Becquerel = new Becquerel(); + /// Singleton Btu instance. + public static readonly Btu Btu = new Btu(); + /// Singleton Calorie instance. public static readonly Calorie Calorie = new Calorie(); + /// Singleton CaloriePerMole instance. + public static readonly CaloriePerMole CaloriePerMole = new CaloriePerMole(); + /// Singleton Candela instance. public static readonly Candela Candela = new Candela(); @@ -3039,18 +4958,36 @@ public static class Units{ /// Singleton Centimeter instance. public static readonly Centimeter Centimeter = new Centimeter(); + /// Singleton Centipoise instance. + public static readonly Centipoise Centipoise = new Centipoise(); + /// Singleton Coulomb instance. public static readonly Coulomb Coulomb = new Coulomb(); /// Singleton CoulombPerKilogram instance. public static readonly CoulombPerKilogram CoulombPerKilogram = new CoulombPerKilogram(); + /// Singleton CubicCentimeter instance. + public static readonly CubicCentimeter CubicCentimeter = new CubicCentimeter(); + + /// Singleton CubicFoot instance. + public static readonly CubicFoot CubicFoot = new CubicFoot(); + + /// Singleton CubicInch instance. + public static readonly CubicInch CubicInch = new CubicInch(); + /// Singleton CubicMeter instance. public static readonly CubicMeter CubicMeter = new CubicMeter(); /// Singleton CubicMeterPerSecond instance. public static readonly CubicMeterPerSecond CubicMeterPerSecond = new CubicMeterPerSecond(); + /// Singleton Curie instance. + public static readonly Curie Curie = new Curie(); + + /// Singleton Dalton instance. + public static readonly Dalton Dalton = new Dalton(); + /// Singleton Day instance. public static readonly Day Day = new Day(); @@ -3063,33 +5000,63 @@ public static class Units{ /// Singleton Diopter instance. public static readonly Diopter Diopter = new Diopter(); + /// Singleton Dyne instance. + public static readonly Dyne Dyne = new Dyne(); + + /// Singleton DynePerCentimeter instance. + public static readonly DynePerCentimeter DynePerCentimeter = new DynePerCentimeter(); + /// Singleton ElectronVolt instance. public static readonly ElectronVolt ElectronVolt = new ElectronVolt(); + /// Singleton EnzymeUnit instance. + public static readonly EnzymeUnit EnzymeUnit = new EnzymeUnit(); + + /// Singleton Erg instance. + public static readonly Erg Erg = new Erg(); + /// Singleton Fahrenheit instance. public static readonly Fahrenheit Fahrenheit = new Fahrenheit(); /// Singleton Farad instance. public static readonly Farad Farad = new Farad(); + /// Singleton FeetPerSecond instance. + public static readonly FeetPerSecond FeetPerSecond = new FeetPerSecond(); + /// Singleton Foot instance. public static readonly Foot Foot = new Foot(); + /// Singleton FootCandle instance. + public static readonly FootCandle FootCandle = new FootCandle(); + /// Singleton Gallon instance. public static readonly Gallon Gallon = new Gallon(); /// Singleton Gauss instance. public static readonly Gauss Gauss = new Gauss(); + /// Singleton Gradian instance. + public static readonly Gradian Gradian = new Gradian(); + /// Singleton Gram instance. public static readonly Gram Gram = new Gram(); + /// Singleton GramPerCubicCentimeter instance. + public static readonly GramPerCubicCentimeter GramPerCubicCentimeter = new GramPerCubicCentimeter(); + + /// Singleton GramPerLiter instance. + public static readonly GramPerLiter GramPerLiter = new GramPerLiter(); + /// Singleton GramPerMole instance. public static readonly GramPerMole GramPerMole = new GramPerMole(); /// Singleton Gray instance. public static readonly Gray Gray = new Gray(); + /// Singleton Hectare instance. + public static readonly Hectare Hectare = new Hectare(); + /// Singleton Henry instance. public static readonly Henry Henry = new Henry(); @@ -3102,6 +5069,9 @@ public static class Units{ /// Singleton Hour instance. public static readonly Hour Hour = new Hour(); + /// Singleton ImperialGallon instance. + public static readonly ImperialGallon ImperialGallon = new ImperialGallon(); + /// Singleton Inch instance. public static readonly Inch Inch = new Inch(); @@ -3123,6 +5093,12 @@ public static class Units{ /// Singleton Kelvin instance. public static readonly Kelvin Kelvin = new Kelvin(); + /// Singleton Kiloampere instance. + public static readonly Kiloampere Kiloampere = new Kiloampere(); + + /// Singleton Kilocalorie instance. + public static readonly Kilocalorie Kilocalorie = new Kilocalorie(); + /// Singleton Kilogram instance. public static readonly Kilogram Kilogram = new Kilogram(); @@ -3141,6 +5117,15 @@ public static class Units{ /// Singleton KilogramPerSecond instance. public static readonly KilogramPerSecond KilogramPerSecond = new KilogramPerSecond(); + /// Singleton Kilohertz instance. + public static readonly Kilohertz Kilohertz = new Kilohertz(); + + /// Singleton Kilohm instance. + public static readonly Kilohm Kilohm = new Kilohm(); + + /// Singleton Kilojoule instance. + public static readonly Kilojoule Kilojoule = new Kilojoule(); + /// Singleton KilojoulePerMole instance. public static readonly KilojoulePerMole KilojoulePerMole = new KilojoulePerMole(); @@ -3150,9 +5135,27 @@ public static class Units{ /// Singleton KilometersPerHour instance. public static readonly KilometersPerHour KilometersPerHour = new KilometersPerHour(); + /// Singleton Kilomole instance. + public static readonly Kilomole Kilomole = new Kilomole(); + + /// Singleton Kilonewton instance. + public static readonly Kilonewton Kilonewton = new Kilonewton(); + + /// Singleton Kilopascal instance. + public static readonly Kilopascal Kilopascal = new Kilopascal(); + + /// Singleton Kilovolt instance. + public static readonly Kilovolt Kilovolt = new Kilovolt(); + + /// Singleton Kilowatt instance. + public static readonly Kilowatt Kilowatt = new Kilowatt(); + /// Singleton KilowattHour instance. public static readonly KilowattHour KilowattHour = new KilowattHour(); + /// Singleton Knot instance. + public static readonly Knot Knot = new Knot(); + /// Singleton Liter instance. public static readonly Liter Liter = new Liter(); @@ -3165,6 +5168,15 @@ public static class Units{ /// Singleton Lux instance. public static readonly Lux Lux = new Lux(); + /// Singleton Megahertz instance. + public static readonly Megahertz Megahertz = new Megahertz(); + + /// Singleton Megawatt instance. + public static readonly Megawatt Megawatt = new Megawatt(); + + /// Singleton Megohm instance. + public static readonly Megohm Megohm = new Megohm(); + /// Singleton Meter instance. public static readonly Meter Meter = new Meter(); @@ -3180,9 +5192,15 @@ public static class Units{ /// Singleton MetersPerSecondSquared instance. public static readonly MetersPerSecondSquared MetersPerSecondSquared = new MetersPerSecondSquared(); + /// Singleton Microfarad instance. + public static readonly Microfarad Microfarad = new Microfarad(); + /// Singleton Micrometer instance. public static readonly Micrometer Micrometer = new Micrometer(); + /// Singleton Micromolar instance. + public static readonly Micromolar Micromolar = new Micromolar(); + /// Singleton Microsecond instance. public static readonly Microsecond Microsecond = new Microsecond(); @@ -3192,12 +5210,27 @@ public static class Units{ /// Singleton MilesPerHour instance. public static readonly MilesPerHour MilesPerHour = new MilesPerHour(); + /// Singleton Milliampere instance. + public static readonly Milliampere Milliampere = new Milliampere(); + + /// Singleton Millicandela instance. + public static readonly Millicandela Millicandela = new Millicandela(); + /// Singleton Milliliter instance. public static readonly Milliliter Milliliter = new Milliliter(); /// Singleton Millimeter instance. public static readonly Millimeter Millimeter = new Millimeter(); + /// Singleton Millimolar instance. + public static readonly Millimolar Millimolar = new Millimolar(); + + /// Singleton Millimole instance. + public static readonly Millimole Millimole = new Millimole(); + + /// Singleton Milliradian instance. + public static readonly Milliradian Milliradian = new Milliradian(); + /// Singleton Millisecond instance. public static readonly Millisecond Millisecond = new Millisecond(); @@ -3213,9 +5246,18 @@ public static class Units{ /// Singleton MolePerCubicMeterSecond instance. public static readonly MolePerCubicMeterSecond MolePerCubicMeterSecond = new MolePerCubicMeterSecond(); + /// Singleton Nanofarad instance. + public static readonly Nanofarad Nanofarad = new Nanofarad(); + /// Singleton Nanometer instance. public static readonly Nanometer Nanometer = new Nanometer(); + /// Singleton Nanosecond instance. + public static readonly Nanosecond Nanosecond = new Nanosecond(); + + /// Singleton NauticalMile instance. + public static readonly NauticalMile NauticalMile = new NauticalMile(); + /// Singleton Newton instance. public static readonly Newton Newton = new Newton(); @@ -3234,6 +5276,12 @@ public static class Units{ /// Singleton Ounce instance. public static readonly Ounce Ounce = new Ounce(); + /// Singleton PartsPerBillion instance. + public static readonly PartsPerBillion PartsPerBillion = new PartsPerBillion(); + + /// Singleton PartsPerMillion instance. + public static readonly PartsPerMillion PartsPerMillion = new PartsPerMillion(); + /// Singleton Pascal instance. public static readonly Pascal Pascal = new Pascal(); @@ -3246,6 +5294,12 @@ public static class Units{ /// Singleton PerKelvin instance. public static readonly PerKelvin PerKelvin = new PerKelvin(); + /// Singleton PercentByWeight instance. + public static readonly PercentByWeight PercentByWeight = new PercentByWeight(); + + /// Singleton Picofarad instance. + public static readonly Picofarad Picofarad = new Picofarad(); + /// Singleton Poise instance. public static readonly Poise Poise = new Poise(); @@ -3255,9 +5309,15 @@ public static class Units{ /// Singleton PoundFoot instance. public static readonly PoundFoot PoundFoot = new PoundFoot(); + /// Singleton PoundForce instance. + public static readonly PoundForce PoundForce = new PoundForce(); + /// Singleton Psi instance. public static readonly Psi Psi = new Psi(); + /// Singleton Rad instance. + public static readonly Rad Rad = new Rad(); + /// Singleton Radian instance. public static readonly Radian Radian = new Radian(); @@ -3270,39 +5330,81 @@ public static class Units{ /// Singleton RadiansPerSecondSquared instance. public static readonly RadiansPerSecondSquared RadiansPerSecondSquared = new RadiansPerSecondSquared(); + /// Singleton Rankine instance. + public static readonly Rankine Rankine = new Rankine(); + + /// Singleton Rem instance. + public static readonly Rem Rem = new Rem(); + + /// Singleton Revolution instance. + public static readonly Revolution Revolution = new Revolution(); + /// Singleton RevolutionsPerMinute instance. public static readonly RevolutionsPerMinute RevolutionsPerMinute = new RevolutionsPerMinute(); + /// Singleton Roentgen instance. + public static readonly Roentgen Roentgen = new Roentgen(); + /// Singleton Second instance. public static readonly Second Second = new Second(); + /// Singleton ShortTon instance. + public static readonly ShortTon ShortTon = new ShortTon(); + /// Singleton Siemens instance. public static readonly Siemens Siemens = new Siemens(); /// Singleton Sievert instance. public static readonly Sievert Sievert = new Sievert(); + /// Singleton SquareCentimeter instance. + public static readonly SquareCentimeter SquareCentimeter = new SquareCentimeter(); + /// Singleton SquareFoot instance. public static readonly SquareFoot SquareFoot = new SquareFoot(); /// Singleton SquareInch instance. public static readonly SquareInch SquareInch = new SquareInch(); + /// Singleton SquareKilometer instance. + public static readonly SquareKilometer SquareKilometer = new SquareKilometer(); + /// Singleton SquareMeter instance. public static readonly SquareMeter SquareMeter = new SquareMeter(); /// Singleton SquareMeterPerSecond instance. public static readonly SquareMeterPerSecond SquareMeterPerSecond = new SquareMeterPerSecond(); + /// Singleton SquareMile instance. + public static readonly SquareMile SquareMile = new SquareMile(); + + /// Singleton StandardGravity instance. + public static readonly StandardGravity StandardGravity = new StandardGravity(); + /// Singleton Stokes instance. public static readonly Stokes Stokes = new Stokes(); + /// Singleton Stone instance. + public static readonly Stone Stone = new Stone(); + /// Singleton Tesla instance. public static readonly Tesla Tesla = new Tesla(); /// Singleton Ton instance. public static readonly Ton Ton = new Ton(); + /// Singleton Torr instance. + public static readonly Torr Torr = new Torr(); + + /// Singleton USFluidOunce instance. + public static readonly USFluidOunce USFluidOunce = new USFluidOunce(); + + /// Singleton USPint instance. + public static readonly USPint USPint = new USPint(); + + /// Singleton USQuart instance. + public static readonly USQuart USQuart = new USQuart(); + /// Singleton Volt instance. public static readonly Volt Volt = new Volt(); @@ -3312,6 +5414,9 @@ public static class Units{ /// Singleton Watt instance. public static readonly Watt Watt = new Watt(); + /// Singleton WattHour instance. + public static readonly WattHour WattHour = new WattHour(); + /// Singleton WattPerMeterKelvin instance. public static readonly WattPerMeterKelvin WattPerMeterKelvin = new WattPerMeterKelvin(); @@ -3324,6 +5429,9 @@ public static class Units{ /// Singleton Weber instance. public static readonly Weber Weber = new Weber(); + /// Singleton Week instance. + public static readonly Week Week = new Week(); + /// Singleton Yard instance. public static readonly Yard Yard = new Yard(); diff --git a/Semantics.SourceGenerators/Generators/PhysicalConstantsGenerator.cs b/Semantics.SourceGenerators/Generators/PhysicalConstantsGenerator.cs index 469abbc..5168909 100644 --- a/Semantics.SourceGenerators/Generators/PhysicalConstantsGenerator.cs +++ b/Semantics.SourceGenerators/Generators/PhysicalConstantsGenerator.cs @@ -119,7 +119,10 @@ protected override void Generate(SourceProductionContext context, DomainsMetadat Name = $"{constant.Name}", BodyFactory = (body) => { - body.Write($" where T : struct, INumber => T.CreateChecked({domainName}.{constant.Name});"); + // PreciseNumber does not support T.CreateChecked conversion (its + // TryConvertToChecked throws NotSupportedException); To() is the + // supported materialisation path. + body.Write($" where T : struct, INumber => {domainName}.{constant.Name}.To();"); }, }); } diff --git a/Semantics.SourceGenerators/Metadata/conversions.json b/Semantics.SourceGenerators/Metadata/conversions.json index b766f11..d1b621f 100644 --- a/Semantics.SourceGenerators/Metadata/conversions.json +++ b/Semantics.SourceGenerators/Metadata/conversions.json @@ -28,6 +28,11 @@ "name": "AngstromToMeters", "description": "Angstrom to meter conversion: 1e-10 m/Å (exact by definition)", "value": "1e-10" + }, + { + "name": "NauticalMileToMeters", + "description": "Nautical mile to meter conversion: 1852 m/nmi (exact by definition)", + "value": "1852" } ] }, @@ -54,6 +59,21 @@ "name": "TonToKilograms", "description": "Metric ton to kilogram conversion: 1000 kg/t (exact by definition)", "value": "1000" + }, + { + "name": "StoneToKilograms", + "description": "Stone to kilogram conversion: 6.35029318 kg/st (14 lb, exact)", + "value": "6.35029318" + }, + { + "name": "ShortTonToKilograms", + "description": "Short ton to kilogram conversion: 907.18474 kg/ton (2000 lb, exact)", + "value": "907.18474" + }, + { + "name": "AtomicMassUnitToKilograms", + "description": "Atomic mass unit to kilogram: 1.66053906660e-27 kg/u (2018 CODATA)", + "value": "1.66053906660e-27" } ] }, @@ -70,6 +90,41 @@ "name": "GallonToCubicMeters", "description": "US gallon to cubic meter conversion: 0.003785411784 m³/gal (exact)", "value": "0.003785411784" + }, + { + "name": "CubicCentimeterToCubicMeters", + "description": "Cubic centimeter to cubic meter: 1e-6 m³/cm³ (exact by definition)", + "value": "1e-6" + }, + { + "name": "CubicFootToCubicMeters", + "description": "Cubic foot to cubic meter: 0.028316846592 m³/ft³ (exact)", + "value": "0.028316846592" + }, + { + "name": "CubicInchToCubicMeters", + "description": "Cubic inch to cubic meter: 1.6387064e-5 m³/in³ (exact)", + "value": "1.6387064e-5" + }, + { + "name": "ImperialGallonToCubicMeters", + "description": "Imperial gallon to cubic meter: 0.00454609 m³/imp gal (exact by definition)", + "value": "0.00454609" + }, + { + "name": "USQuartToCubicMeters", + "description": "US liquid quart to cubic meter: 0.000946352946 m³/qt (exact)", + "value": "0.000946352946" + }, + { + "name": "USPintToCubicMeters", + "description": "US liquid pint to cubic meter: 0.000473176473 m³/pt (exact)", + "value": "0.000473176473" + }, + { + "name": "USFluidOunceToCubicMeters", + "description": "US fluid ounce to cubic meter: 2.95735295625e-5 m³/fl oz (exact)", + "value": "2.95735295625e-5" } ] }, @@ -96,6 +151,11 @@ "name": "YearToSeconds", "description": "Year to second conversion: 31557600 s/year (365.25 days, exact)", "value": "31557600" + }, + { + "name": "WeekToSeconds", + "description": "Week to second conversion: 604800 s/wk (exact)", + "value": "604800" } ] }, @@ -110,13 +170,13 @@ }, { "name": "FahrenheitScale", - "description": "Fahrenheit degree scale factor: 9/5 = 1.8 (exact)", - "value": "1.8" + "description": "Fahrenheit-to-Kelvin degree scale factor: 5/9 (exact)", + "value": "0.5555555555555556" }, { "name": "FahrenheitToKelvinOffset", - "description": "Fahrenheit to Kelvin absolute offset: -459.67 K (exact)", - "value": "-459.67" + "description": "Fahrenheit to Kelvin affine offset: 459.67 × 5/9 ≈ 255.372 K (exact)", + "value": "255.37222222222223" } ] }, @@ -128,6 +188,16 @@ "name": "DegreeToRadians", "description": "Degree to radian conversion: π/180 rad/° (exact)", "value": "0.017453292519943295769236907684886127134428718885417254560971914401710091146034494436822415696345097379101040706699150667990539631694451077627806983" + }, + { + "name": "GradianToRadians", + "description": "Gradian to radian conversion: π/200 rad/grad (exact)", + "value": "0.015707963267948966" + }, + { + "name": "RevolutionToRadians", + "description": "Revolution to radian conversion: 2π rad/rev (exact)", + "value": "6.283185307179586" } ] }, @@ -154,6 +224,26 @@ "name": "ElectronVoltToJoules", "description": "Electron volt to joule conversion: 1.602176634e-19 J/eV (exact, based on elementary charge)", "value": "1.602176634e-19" + }, + { + "name": "KilocalorieToJoules", + "description": "Kilocalorie to joule conversion: 4184 J/kcal (exact, thermochemical)", + "value": "4184" + }, + { + "name": "WattHourToJoules", + "description": "Watt-hour to joule conversion: 3600 J/Wh (exact)", + "value": "3600" + }, + { + "name": "ErgToJoules", + "description": "Erg to joule conversion: 1e-7 J/erg (exact by definition)", + "value": "1e-7" + }, + { + "name": "BtuToJoules", + "description": "British thermal unit (IT) to joule conversion: 1055.05585262 J/BTU (exact)", + "value": "1055.05585262" } ] }, @@ -175,6 +265,11 @@ "name": "PsiToPascals", "description": "PSI to pascal conversion: 6894.757293168361 Pa/psi (exact)", "value": "6894.757293168361" + }, + { + "name": "TorrToPascals", + "description": "Torr to pascal conversion: 101325/760 ≈ 133.322 Pa/Torr (exact)", + "value": "133.32236842105263" } ] }, @@ -196,6 +291,31 @@ "name": "BarnToSquareMeters", "description": "Barn to square meter conversion: 1e-28 m² (exact by definition)", "value": "1e-28" + }, + { + "name": "SquareKilometerToSquareMeters", + "description": "Square kilometer to square meter: 1e6 m²/km² (exact by definition)", + "value": "1e6" + }, + { + "name": "SquareCentimeterToSquareMeters", + "description": "Square centimeter to square meter: 1e-4 m²/cm² (exact by definition)", + "value": "1e-4" + }, + { + "name": "SquareMileToSquareMeters", + "description": "Square mile to square meter: 2589988.110336 m²/mi² (exact)", + "value": "2589988.110336" + }, + { + "name": "HectareToSquareMeters", + "description": "Hectare to square meter: 10000 m²/ha (exact by definition)", + "value": "10000" + }, + { + "name": "AcreToSquareMeters", + "description": "Acre to square meter: 4046.8564224 m²/ac (exact)", + "value": "4046.8564224" } ] }, @@ -212,6 +332,16 @@ "name": "MilesPerHourToMetersPerSecond", "description": "Miles per hour to meters per second conversion: 0.44704 m/s per mph (exact)", "value": "0.44704" + }, + { + "name": "FeetPerSecondToMetersPerSecond", + "description": "Feet per second to meters per second: 0.3048 m/s per ft/s (exact)", + "value": "0.3048" + }, + { + "name": "KnotToMetersPerSecond", + "description": "Knot to meters per second: 1852/3600 ≈ 0.514444 m/s per kn (exact)", + "value": "0.5144444444444445" } ] }, @@ -245,6 +375,16 @@ "name": "MolarToCubicMeter", "description": "Molar to cubic meter concentration conversion: 1000.0 mol/m³ per mol/L (exact)", "value": "1000.0" + }, + { + "name": "MillimolarToMolePerCubicMeter", + "description": "Millimolar to mole per cubic meter: 1 mol/m³ per mM (exact)", + "value": "1.0" + }, + { + "name": "MicromolarToMolePerCubicMeter", + "description": "Micromolar to mole per cubic meter: 0.001 mol/m³ per μM (exact)", + "value": "0.001" } ] }, @@ -266,6 +406,26 @@ "name": "LiterPerSecondToCubicMeterPerSecond", "description": "Liter per second to cubic meter per second: 0.001 m³/s per L/s (exact by definition)", "value": "0.001" + }, + { + "name": "CentipoiseToPascalSecond", + "description": "Centipoise to pascal second: 0.001 Pa·s per cP (exact by definition)", + "value": "0.001" + }, + { + "name": "DynePerCentimeterToNewtonPerMeter", + "description": "Dyne per centimeter to newton per meter: 0.001 N/m per dyn/cm (exact)", + "value": "0.001" + }, + { + "name": "GramPerCubicCentimeterToKilogramPerCubicMeter", + "description": "Gram per cubic centimeter to kilogram per cubic meter: 1000 kg/m³ per g/cm³ (exact)", + "value": "1000" + }, + { + "name": "GramPerLiterToKilogramPerCubicMeter", + "description": "Gram per liter to kilogram per cubic meter: 1 kg/m³ per g/L (exact)", + "value": "1.0" } ] }, @@ -277,6 +437,11 @@ "name": "GaussToTesla", "description": "Gauss to Tesla: 1e-4 T per G (exact by definition)", "value": "1e-4" + }, + { + "name": "AmpereHourToCoulombs", + "description": "Ampere-hour to coulomb conversion: 3600 C/Ah (exact)", + "value": "3600" } ] }, @@ -293,6 +458,101 @@ "name": "KilojoulePerMoleToJoulePerMole", "description": "Kilojoule per mole to joule per mole: 1000 J/mol per kJ/mol (exact by definition)", "value": "1000" + }, + { + "name": "CaloriePerMoleToJoulePerMole", + "description": "Calorie per mole to joule per mole: 4.184 J/mol per cal/mol (exact, thermochemical)", + "value": "4.184" + }, + { + "name": "EnzymeUnitToKatals", + "description": "Enzyme unit (1 μmol/min) to katal: 1/6e7 ≈ 1.6667e-8 kat/U (exact)", + "value": "1.6666666666666667e-8" + } + ] + }, + { + "category": "Acceleration", + "description": "Acceleration unit conversion factors", + "factors": [ + { + "name": "StandardGravityToMetersPerSecondSquared", + "description": "Standard gravity to meters per second squared: 9.80665 m/s² per g (exact by definition)", + "value": "9.80665" + } + ] + }, + { + "category": "Force", + "description": "Force unit conversion factors", + "factors": [ + { + "name": "DyneToNewtons", + "description": "Dyne to newton conversion: 1e-5 N/dyn (exact by definition)", + "value": "1e-5" + }, + { + "name": "PoundForceToNewtons", + "description": "Pound-force to newton conversion: 4.4482216152605 N/lbf (exact)", + "value": "4.4482216152605" + } + ] + }, + { + "category": "Radiation", + "description": "Radiological unit conversion factors", + "factors": [ + { + "name": "CurieToBecquerels", + "description": "Curie to becquerel conversion: 3.7e10 Bq/Ci (exact by definition)", + "value": "3.7e10" + }, + { + "name": "RadToGrays", + "description": "Rad to gray conversion: 0.01 Gy/rad (exact by definition)", + "value": "0.01" + }, + { + "name": "RemToSieverts", + "description": "Rem to sievert conversion: 0.01 Sv/rem (exact by definition)", + "value": "0.01" + }, + { + "name": "RoentgenToCoulombsPerKilogram", + "description": "Roentgen to coulomb per kilogram: 2.58e-4 C/kg per R (exact by definition)", + "value": "2.58e-4" + } + ] + }, + { + "category": "Photometry", + "description": "Photometric unit conversion factors", + "factors": [ + { + "name": "FootCandleToLux", + "description": "Foot-candle to lux conversion: 1/0.09290304 ≈ 10.7639 lx/fc (exact)", + "value": "10.763910416709722" + } + ] + }, + { + "category": "Ratio", + "description": "Dimensionless ratio conversion factors", + "factors": [ + { + "name": "PartsPerMillionToRatio", + "description": "Parts per million to ratio: 1e-6 (exact by definition)", + "value": "1e-6" + }, + { + "name": "PartsPerBillionToRatio", + "description": "Parts per billion to ratio: 1e-9 (exact by definition)", + "value": "1e-9" + }, + { + "name": "PercentByWeightToRatio", + "description": "Percent by weight to mass-fraction ratio: 0.01 (exact by definition)", + "value": "0.01" } ] } diff --git a/Semantics.SourceGenerators/Metadata/dimensions.json b/Semantics.SourceGenerators/Metadata/dimensions.json index b28b111..da4f509 100644 --- a/Semantics.SourceGenerators/Metadata/dimensions.json +++ b/Semantics.SourceGenerators/Metadata/dimensions.json @@ -4,7 +4,7 @@ "name": "Dimensionless", "symbol": "1", "dimensionalFormula": {}, - "availableUnits": ["Dimensionless", "Radian", "Degree"], + "availableUnits": ["Dimensionless", "Radian", "Degree", "Gradian", "Revolution", "Milliradian", "PartsPerMillion", "PartsPerBillion", "PercentByWeight"], "quantities": { "vector0": { "base": "Ratio", @@ -29,7 +29,7 @@ "availableUnits": [ "Meter", "Kilometer", "Centimeter", "Millimeter", "Micrometer", "Nanometer", "Angstrom", - "Foot", "Inch", "Yard", "Mile" + "Foot", "Inch", "Yard", "Mile", "NauticalMile" ], "quantities": { "vector0": { @@ -78,7 +78,7 @@ "name": "Mass", "symbol": "M", "dimensionalFormula": { "mass": 1 }, - "availableUnits": ["Kilogram", "Gram", "Ton", "Pound", "Ounce"], + "availableUnits": ["Kilogram", "Gram", "Ton", "Pound", "Ounce", "Stone", "ShortTon", "AtomicMassUnit"], "quantities": { "vector0": { "base": "Mass", @@ -101,7 +101,7 @@ "dimensionalFormula": { "time": 1 }, "availableUnits": [ "Second", "Millisecond", "Microsecond", - "Minute", "Hour", "Day", "Year" + "Minute", "Hour", "Day", "Year", "Week", "Nanosecond" ], "quantities": { "vector0": { @@ -125,7 +125,7 @@ "name": "ElectricCurrent", "symbol": "I", "dimensionalFormula": { "electricCurrent": 1 }, - "availableUnits": ["Ampere"], + "availableUnits": ["Ampere", "Milliampere", "Kiloampere"], "quantities": { "vector0": { "base": "CurrentMagnitude" }, "vector1": { "base": "Current1D" }, @@ -144,7 +144,7 @@ "name": "Temperature", "symbol": "Θ", "dimensionalFormula": { "temperature": 1 }, - "availableUnits": ["Kelvin", "Celsius", "Fahrenheit"], + "availableUnits": ["Kelvin", "Celsius", "Fahrenheit", "Rankine"], "quantities": { "vector0": { "base": "Temperature" }, "vector1": { @@ -164,7 +164,7 @@ "name": "AmountOfSubstance", "symbol": "N", "dimensionalFormula": { "amountOfSubstance": 1 }, - "availableUnits": ["Mole"], + "availableUnits": ["Mole", "Kilomole", "Millimole"], "quantities": { "vector0": { "base": "AmountOfSubstance" } }, @@ -177,7 +177,7 @@ "name": "LuminousIntensity", "symbol": "J", "dimensionalFormula": { "luminousIntensity": 1 }, - "availableUnits": ["Candela"], + "availableUnits": ["Candela", "Millicandela"], "quantities": { "vector0": { "base": "LuminousIntensity" } }, @@ -190,7 +190,7 @@ "name": "Area", "symbol": "L²", "dimensionalFormula": { "length": 2 }, - "availableUnits": ["SquareMeter", "SquareFoot", "SquareInch"], + "availableUnits": ["SquareMeter", "SquareKilometer", "SquareCentimeter", "SquareFoot", "SquareInch", "SquareMile", "Hectare", "Acre"], "quantities": { "vector0": { "base": "Area", @@ -224,7 +224,7 @@ "name": "Volume", "symbol": "L³", "dimensionalFormula": { "length": 3 }, - "availableUnits": ["CubicMeter", "Liter", "Milliliter", "Gallon"], + "availableUnits": ["CubicMeter", "Liter", "Milliliter", "CubicCentimeter", "CubicFoot", "CubicInch", "Gallon", "ImperialGallon", "USQuart", "USPint", "USFluidOunce"], "quantities": { "vector0": { "base": "Volume", @@ -245,7 +245,7 @@ "symbol": "L T⁻¹", "dimensionalFormula": { "length": 1, "time": -1 }, "availableUnits": [ - "MetersPerSecond", "KilometersPerHour", "MilesPerHour" + "MetersPerSecond", "KilometersPerHour", "MilesPerHour", "FeetPerSecond", "Knot" ], "quantities": { "vector0": { @@ -283,7 +283,7 @@ "name": "Acceleration", "symbol": "L T⁻²", "dimensionalFormula": { "length": 1, "time": -2 }, - "availableUnits": ["MetersPerSecondSquared"], + "availableUnits": ["MetersPerSecondSquared", "StandardGravity"], "quantities": { "vector0": { "base": "AccelerationMagnitude", @@ -354,7 +354,7 @@ "name": "Frequency", "symbol": "T⁻¹", "dimensionalFormula": { "time": -1 }, - "availableUnits": ["Hertz"], + "availableUnits": ["Hertz", "Kilohertz", "Megahertz"], "quantities": { "vector0": { "base": "Frequency", @@ -378,7 +378,7 @@ "name": "RadioactiveActivity", "symbol": "T⁻¹", "dimensionalFormula": { "time": -1 }, - "availableUnits": ["Becquerel"], + "availableUnits": ["Becquerel", "Curie"], "quantities": { "vector0": { "base": "RadioactiveActivity" } }, @@ -391,7 +391,7 @@ "name": "AngularDisplacement", "symbol": "1", "dimensionalFormula": {}, - "availableUnits": ["Radian", "Degree"], + "availableUnits": ["Radian", "Degree", "Gradian", "Revolution", "Milliradian"], "quantities": { "vector0": { "base": "Angle", @@ -527,7 +527,7 @@ "name": "Force", "symbol": "M L T⁻²", "dimensionalFormula": { "mass": 1, "length": 1, "time": -2 }, - "availableUnits": ["Newton"], + "availableUnits": ["Newton", "Kilonewton", "Dyne", "PoundForce"], "quantities": { "vector0": { "base": "ForceMagnitude", @@ -590,7 +590,7 @@ "name": "Pressure", "symbol": "M L⁻¹ T⁻²", "dimensionalFormula": { "mass": 1, "length": -1, "time": -2 }, - "availableUnits": ["Pascal", "Bar", "Atmosphere", "Psi"], + "availableUnits": ["Pascal", "Kilopascal", "Bar", "Atmosphere", "Psi", "Torr"], "quantities": { "vector0": { "base": "Pressure", @@ -615,7 +615,7 @@ "name": "Energy", "symbol": "M L² T⁻²", "dimensionalFormula": { "mass": 1, "length": 2, "time": -2 }, - "availableUnits": ["Joule", "ElectronVolt", "Calorie", "KilowattHour"], + "availableUnits": ["Joule", "Kilojoule", "ElectronVolt", "Calorie", "Kilocalorie", "KilowattHour", "WattHour", "Erg", "Btu"], "quantities": { "vector0": { "base": "Energy", @@ -640,7 +640,7 @@ "name": "Power", "symbol": "M L² T⁻³", "dimensionalFormula": { "mass": 1, "length": 2, "time": -3 }, - "availableUnits": ["Watt", "Horsepower"], + "availableUnits": ["Watt", "Kilowatt", "Megawatt", "Horsepower"], "quantities": { "vector0": { "base": "Power", @@ -663,7 +663,7 @@ "name": "AbsorbedDose", "symbol": "L² T⁻²", "dimensionalFormula": { "length": 2, "time": -2 }, - "availableUnits": ["Gray"], + "availableUnits": ["Gray", "Rad"], "quantities": { "vector0": { "base": "AbsorbedDose" } }, @@ -676,7 +676,7 @@ "name": "EquivalentDose", "symbol": "L² T⁻²", "dimensionalFormula": { "length": 2, "time": -2 }, - "availableUnits": ["Sievert"], + "availableUnits": ["Sievert", "Rem"], "quantities": { "vector0": { "base": "EquivalentDose" } }, @@ -689,7 +689,7 @@ "name": "Density", "symbol": "M L⁻³", "dimensionalFormula": { "mass": 1, "length": -3 }, - "availableUnits": ["KilogramPerCubicMeter"], + "availableUnits": ["KilogramPerCubicMeter", "GramPerCubicCentimeter", "GramPerLiter"], "quantities": { "vector0": { "base": "Density" } }, @@ -704,7 +704,7 @@ "name": "ElectricCharge", "symbol": "I T", "dimensionalFormula": { "electricCurrent": 1, "time": 1 }, - "availableUnits": ["Coulomb"], + "availableUnits": ["Coulomb", "AmpereHour"], "quantities": { "vector0": { "base": "ChargeMagnitude" }, "vector1": { "base": "Charge" } @@ -722,7 +722,7 @@ "dimensionalFormula": { "mass": 1, "length": 2, "time": -3, "electricCurrent": -1 }, - "availableUnits": ["Volt"], + "availableUnits": ["Volt", "Kilovolt"], "quantities": { "vector0": { "base": "VoltageMagnitude", @@ -770,7 +770,7 @@ "dimensionalFormula": { "mass": 1, "length": 2, "time": -3, "electricCurrent": -2 }, - "availableUnits": ["Ohm"], + "availableUnits": ["Ohm", "Kilohm", "Megohm"], "quantities": { "vector0": { "base": "Resistance" } }, @@ -787,7 +787,7 @@ "dimensionalFormula": { "mass": -1, "length": -2, "time": 4, "electricCurrent": 2 }, - "availableUnits": ["Farad"], + "availableUnits": ["Farad", "Microfarad", "Nanofarad", "Picofarad"], "quantities": { "vector0": { "base": "Capacitance" } }, @@ -817,7 +817,7 @@ "name": "Illuminance", "symbol": "J L⁻²", "dimensionalFormula": { "luminousIntensity": 1, "length": -2 }, - "availableUnits": ["Lux"], + "availableUnits": ["Lux", "FootCandle"], "quantities": { "vector0": { "base": "Illuminance", @@ -850,7 +850,7 @@ "name": "Concentration", "symbol": "N L⁻³", "dimensionalFormula": { "amountOfSubstance": 1, "length": -3 }, - "availableUnits": ["Molar"], + "availableUnits": ["Molar", "Millimolar", "Micromolar"], "quantities": { "vector0": { "base": "Concentration" } }, @@ -966,7 +966,7 @@ "name": "DynamicViscosity", "symbol": "M L⁻¹ T⁻¹", "dimensionalFormula": { "mass": 1, "length": -1, "time": -1 }, - "availableUnits": ["PascalSecond", "Poise"], + "availableUnits": ["PascalSecond", "Poise", "Centipoise"], "quantities": { "vector0": { "base": "DynamicViscosity" } }, @@ -1011,7 +1011,7 @@ "name": "SurfaceTension", "symbol": "M T⁻²", "dimensionalFormula": { "mass": 1, "time": -2 }, - "availableUnits": ["NewtonPerMeter"], + "availableUnits": ["NewtonPerMeter", "DynePerCentimeter"], "quantities": { "vector0": { "base": "SurfaceTension" } }, @@ -1026,7 +1026,7 @@ "name": "MolarMass", "symbol": "M N⁻¹", "dimensionalFormula": { "mass": 1, "amountOfSubstance": -1 }, - "availableUnits": ["KilogramPerMole", "GramPerMole"], + "availableUnits": ["KilogramPerMole", "GramPerMole", "Dalton"], "quantities": { "vector0": { "base": "MolarMass" } }, @@ -1041,7 +1041,7 @@ "name": "CatalyticActivity", "symbol": "N T⁻¹", "dimensionalFormula": { "amountOfSubstance": 1, "time": -1 }, - "availableUnits": ["Katal"], + "availableUnits": ["Katal", "EnzymeUnit"], "quantities": { "vector0": { "base": "CatalyticActivity", @@ -1076,7 +1076,7 @@ "name": "MolarEnergy", "symbol": "M L² T⁻² N⁻¹", "dimensionalFormula": { "mass": 1, "length": 2, "time": -2, "amountOfSubstance": -1 }, - "availableUnits": ["JoulePerMole", "KilojoulePerMole"], + "availableUnits": ["JoulePerMole", "KilojoulePerMole", "CaloriePerMole"], "quantities": { "vector0": { "base": "MolarEnergy", @@ -1198,7 +1198,7 @@ "name": "Exposure", "symbol": "M⁻¹ T I", "dimensionalFormula": { "mass": -1, "time": 1, "electricCurrent": 1 }, - "availableUnits": ["CoulombPerKilogram"], + "availableUnits": ["CoulombPerKilogram", "Roentgen"], "quantities": { "vector0": { "base": "Exposure" } }, diff --git a/Semantics.SourceGenerators/Metadata/domains.json b/Semantics.SourceGenerators/Metadata/domains.json index 3182826..00bf43d 100644 --- a/Semantics.SourceGenerators/Metadata/domains.json +++ b/Semantics.SourceGenerators/Metadata/domains.json @@ -69,7 +69,19 @@ }, { "name": "FluidMechanics", - "description": "The study of fluids (liquids and gases) in motion and at rest, including fluid properties, flow dynamics, viscosity, pressure, and fluid-structure interactions" + "description": "The study of fluids (liquids and gases) in motion and at rest, including fluid properties, flow dynamics, viscosity, pressure, and fluid-structure interactions", + "constants": [ + { + "name": "StandardAirDensity", + "description": "Standard air density at 15°C and 1 atm: 1.225 kg/m³ (ISO 2533)", + "value": "1.225" + }, + { + "name": "WaterSurfaceTension", + "description": "Water surface tension at 20°C: 0.0728 N/m (NIST)", + "value": "0.0728" + } + ] }, { "name": "StructuralMechanics", @@ -77,7 +89,19 @@ }, { "name": "NuclearPhysics", - "description": "The study of atomic nuclei, radioactivity, nuclear reactions, decay processes, and radiation interactions with matter" + "description": "The study of atomic nuclei, radioactivity, nuclear reactions, decay processes, and radiation interactions with matter", + "constants": [ + { + "name": "AtomicMassUnit", + "description": "Atomic mass unit: 1.66053906660 × 10⁻²⁷ kg (2018 CODATA)", + "value": "1.66053906660e-27" + }, + { + "name": "NuclearMagneton", + "description": "Nuclear magneton: 5.0507837461 × 10⁻²⁷ J/T (2018 CODATA)", + "value": "5.0507837461e-27" + } + ] }, { "name": "ParticlePhysics", @@ -131,7 +155,14 @@ }, { "name": "Optics", - "description": "The physics of light and optical phenomena, including electromagnetic radiation, photometry, illumination, optical properties, and light-matter interactions" + "description": "The physics of light and optical phenomena, including electromagnetic radiation, photometry, illumination, optical properties, and light-matter interactions", + "constants": [ + { + "name": "LuminousEfficacy", + "description": "Luminous efficacy of monochromatic radiation at 540 THz: 683 lm/W (exact, SI defining constant)", + "value": "683.0" + } + ] }, { "name": "AngularMechanics", @@ -156,7 +187,29 @@ }, { "name": "Acoustics", - "description": "The physics of sound and vibration, including wave propagation, acoustic properties, sound intensity, frequency analysis, and audio-related measurements" + "description": "The physics of sound and vibration, including wave propagation, acoustic properties, sound intensity, frequency analysis, and audio-related measurements", + "constants": [ + { + "name": "ReferenceSoundPressure", + "description": "Reference sound pressure: 20 × 10⁻⁶ Pa (threshold of hearing)", + "value": "20e-6" + }, + { + "name": "ReferenceSoundIntensity", + "description": "Reference sound intensity: 1 × 10⁻¹² W/m² (threshold of hearing)", + "value": "1e-12" + }, + { + "name": "ReferenceSoundPower", + "description": "Reference sound power: 1 × 10⁻¹² W", + "value": "1e-12" + }, + { + "name": "SabineConstant", + "description": "Sabine reverberation constant: 0.161 s/m", + "value": "0.161" + } + ] }, { "name": "Chemistry", diff --git a/Semantics.SourceGenerators/Metadata/units.json b/Semantics.SourceGenerators/Metadata/units.json index 5d47591..f07b672 100644 --- a/Semantics.SourceGenerators/Metadata/units.json +++ b/Semantics.SourceGenerators/Metadata/units.json @@ -260,6 +260,198 @@ "system": "Other", "conversionFactor": "DegreeToRadians", "factoryName": "Degrees" + }, + { + "name": "NauticalMile", + "symbol": "nmi", + "description": "Nautical mile - 1852 meters, used in navigation.", + "system": "Other", + "conversionFactor": "NauticalMileToMeters", + "factoryName": "NauticalMiles" + }, + { + "name": "Stone", + "symbol": "st", + "description": "Stone - Imperial unit of mass (14 pounds).", + "system": "Imperial", + "conversionFactor": "StoneToKilograms", + "factoryName": "Stone" + }, + { + "name": "ShortTon", + "symbol": "ton", + "description": "Short ton - US customary unit of mass (2000 pounds).", + "system": "USCustomary", + "conversionFactor": "ShortTonToKilograms", + "factoryName": "ShortTons" + }, + { + "name": "AtomicMassUnit", + "symbol": "u", + "description": "Atomic mass unit - 1/12 the mass of a carbon-12 atom.", + "system": "Atomic", + "conversionFactor": "AtomicMassUnitToKilograms", + "factoryName": "AtomicMassUnits" + }, + { + "name": "Week", + "symbol": "wk", + "description": "Week - 7 days.", + "system": "Other", + "conversionFactor": "WeekToSeconds", + "factoryName": "Weeks" + }, + { + "name": "Nanosecond", + "symbol": "ns", + "description": "Nanosecond - 1e-9 seconds.", + "system": "SIDerived", + "magnitude": "Nano", + "factoryName": "Nanoseconds" + }, + { + "name": "SquareKilometer", + "symbol": "km²", + "description": "Square kilometer - 1e6 square meters.", + "system": "SIDerived", + "conversionFactor": "SquareKilometerToSquareMeters", + "factoryName": "SquareKilometers" + }, + { + "name": "SquareCentimeter", + "symbol": "cm²", + "description": "Square centimeter - 1e-4 square meters.", + "system": "SIDerived", + "conversionFactor": "SquareCentimeterToSquareMeters", + "factoryName": "SquareCentimeters" + }, + { + "name": "SquareMile", + "symbol": "mi²", + "description": "Square mile - Imperial unit of area.", + "system": "Imperial", + "conversionFactor": "SquareMileToSquareMeters", + "factoryName": "SquareMiles" + }, + { + "name": "Hectare", + "symbol": "ha", + "description": "Hectare - metric unit of area (10000 m²).", + "system": "Metric", + "conversionFactor": "HectareToSquareMeters", + "factoryName": "Hectares" + }, + { + "name": "Acre", + "symbol": "ac", + "description": "Acre - Imperial unit of area.", + "system": "Imperial", + "conversionFactor": "AcreToSquareMeters", + "factoryName": "Acres" + }, + { + "name": "CubicCentimeter", + "symbol": "cm³", + "description": "Cubic centimeter - 1e-6 cubic meters.", + "system": "SIDerived", + "conversionFactor": "CubicCentimeterToCubicMeters", + "factoryName": "CubicCentimeters" + }, + { + "name": "CubicFoot", + "symbol": "ft³", + "description": "Cubic foot - Imperial unit of volume.", + "system": "Imperial", + "conversionFactor": "CubicFootToCubicMeters", + "factoryName": "CubicFeet" + }, + { + "name": "CubicInch", + "symbol": "in³", + "description": "Cubic inch - Imperial unit of volume.", + "system": "Imperial", + "conversionFactor": "CubicInchToCubicMeters", + "factoryName": "CubicInches" + }, + { + "name": "ImperialGallon", + "symbol": "imp gal", + "description": "Imperial gallon - British unit of volume.", + "system": "Imperial", + "conversionFactor": "ImperialGallonToCubicMeters", + "factoryName": "ImperialGallons" + }, + { + "name": "USQuart", + "symbol": "qt", + "description": "US liquid quart - US customary unit of volume.", + "system": "USCustomary", + "conversionFactor": "USQuartToCubicMeters", + "factoryName": "USQuarts" + }, + { + "name": "USPint", + "symbol": "pt", + "description": "US liquid pint - US customary unit of volume.", + "system": "USCustomary", + "conversionFactor": "USPintToCubicMeters", + "factoryName": "USPints" + }, + { + "name": "USFluidOunce", + "symbol": "fl oz", + "description": "US fluid ounce - US customary unit of volume.", + "system": "USCustomary", + "conversionFactor": "USFluidOunceToCubicMeters", + "factoryName": "USFluidOunces" + }, + { + "name": "Gradian", + "symbol": "grad", + "description": "Gradian - 1/400 of a full circle (π/200 rad).", + "system": "Other", + "conversionFactor": "GradianToRadians", + "factoryName": "Gradians" + }, + { + "name": "Revolution", + "symbol": "rev", + "description": "Revolution - one full circle (2π rad).", + "system": "Other", + "conversionFactor": "RevolutionToRadians", + "factoryName": "Revolutions" + }, + { + "name": "Milliradian", + "symbol": "mrad", + "description": "Milliradian - 0.001 radians.", + "system": "SIDerived", + "magnitude": "Milli", + "factoryName": "Milliradians" + }, + { + "name": "PartsPerMillion", + "symbol": "ppm", + "description": "Parts per million - 1e-6 dimensionless ratio.", + "system": "Other", + "conversionFactor": "PartsPerMillionToRatio", + "factoryName": "PartsPerMillion" + }, + { + "name": "PartsPerBillion", + "symbol": "ppb", + "description": "Parts per billion - 1e-9 dimensionless ratio.", + "system": "Other", + "conversionFactor": "PartsPerBillionToRatio", + "factoryName": "PartsPerBillion" + }, + { + "name": "PercentByWeight", + "symbol": "% w/w", + "description": "Percent by weight - mass fraction expressed as a percentage.", + "system": "Other", + "conversionFactor": "PercentByWeightToRatio", + "factoryName": "PercentByWeight" } ] }, @@ -430,6 +622,126 @@ "description": "Meters per second to the fourth - SI derived unit of snap.", "system": "SIDerived", "factoryName": "MetersPerSecondQuartic" + }, + { + "name": "FeetPerSecond", + "symbol": "ft/s", + "description": "Feet per second - Imperial unit of velocity.", + "system": "Imperial", + "conversionFactor": "FeetPerSecondToMetersPerSecond", + "factoryName": "FeetPerSecond" + }, + { + "name": "Knot", + "symbol": "kn", + "description": "Knot - one nautical mile per hour.", + "system": "Other", + "conversionFactor": "KnotToMetersPerSecond", + "factoryName": "Knots" + }, + { + "name": "StandardGravity", + "symbol": "g", + "description": "Standard gravity - acceleration of free fall at Earth's surface.", + "system": "Other", + "conversionFactor": "StandardGravityToMetersPerSecondSquared", + "factoryName": "StandardGravity" + }, + { + "name": "Kilonewton", + "symbol": "kN", + "description": "Kilonewton - 1000 newtons.", + "system": "SIDerived", + "magnitude": "Kilo", + "factoryName": "Kilonewtons" + }, + { + "name": "Dyne", + "symbol": "dyn", + "description": "Dyne - CGS unit of force.", + "system": "CGS", + "conversionFactor": "DyneToNewtons", + "factoryName": "Dynes" + }, + { + "name": "PoundForce", + "symbol": "lbf", + "description": "Pound-force - Imperial unit of force.", + "system": "Imperial", + "conversionFactor": "PoundForceToNewtons", + "factoryName": "PoundsForce" + }, + { + "name": "Kilopascal", + "symbol": "kPa", + "description": "Kilopascal - 1000 pascals.", + "system": "SIDerived", + "magnitude": "Kilo", + "factoryName": "Kilopascals" + }, + { + "name": "Torr", + "symbol": "Torr", + "description": "Torr - 1/760 of a standard atmosphere.", + "system": "Other", + "conversionFactor": "TorrToPascals", + "factoryName": "Torr" + }, + { + "name": "Kilojoule", + "symbol": "kJ", + "description": "Kilojoule - 1000 joules.", + "system": "SIDerived", + "magnitude": "Kilo", + "factoryName": "Kilojoules" + }, + { + "name": "Kilocalorie", + "symbol": "kcal", + "description": "Kilocalorie - 1000 thermochemical calories.", + "system": "Other", + "conversionFactor": "KilocalorieToJoules", + "factoryName": "Kilocalories" + }, + { + "name": "WattHour", + "symbol": "Wh", + "description": "Watt-hour - 3600 joules.", + "system": "SIDerived", + "conversionFactor": "WattHourToJoules", + "factoryName": "WattHours" + }, + { + "name": "Erg", + "symbol": "erg", + "description": "Erg - CGS unit of energy.", + "system": "CGS", + "conversionFactor": "ErgToJoules", + "factoryName": "Ergs" + }, + { + "name": "Btu", + "symbol": "BTU", + "description": "British thermal unit (IT) - Imperial unit of energy.", + "system": "Imperial", + "conversionFactor": "BtuToJoules", + "factoryName": "Btus" + }, + { + "name": "Kilowatt", + "symbol": "kW", + "description": "Kilowatt - 1000 watts.", + "system": "SIDerived", + "magnitude": "Kilo", + "factoryName": "Kilowatts" + }, + { + "name": "Megawatt", + "symbol": "MW", + "description": "Megawatt - 1e6 watts.", + "system": "SIDerived", + "magnitude": "Mega", + "factoryName": "Megawatts" } ] }, @@ -495,6 +807,14 @@ "description": "Per kelvin - SI derived unit of thermal expansion coefficient.", "system": "SIDerived", "factoryName": "PerKelvin" + }, + { + "name": "Rankine", + "symbol": "°R", + "description": "Rankine - absolute temperature scale with Fahrenheit-sized degrees.", + "system": "Imperial", + "conversionFactor": "FahrenheitScale", + "factoryName": "Rankine" } ] }, @@ -579,6 +899,78 @@ "description": "Henry - SI derived unit of inductance.", "system": "SIDerived", "factoryName": "Henries" + }, + { + "name": "Milliampere", + "symbol": "mA", + "description": "Milliampere - 0.001 amperes.", + "system": "SIDerived", + "magnitude": "Milli", + "factoryName": "Milliamperes" + }, + { + "name": "Kiloampere", + "symbol": "kA", + "description": "Kiloampere - 1000 amperes.", + "system": "SIDerived", + "magnitude": "Kilo", + "factoryName": "Kiloamperes" + }, + { + "name": "Kilovolt", + "symbol": "kV", + "description": "Kilovolt - 1000 volts.", + "system": "SIDerived", + "magnitude": "Kilo", + "factoryName": "Kilovolts" + }, + { + "name": "Kilohm", + "symbol": "kΩ", + "description": "Kilohm - 1000 ohms.", + "system": "SIDerived", + "magnitude": "Kilo", + "factoryName": "Kilohms" + }, + { + "name": "Megohm", + "symbol": "MΩ", + "description": "Megohm - 1e6 ohms.", + "system": "SIDerived", + "magnitude": "Mega", + "factoryName": "Megohms" + }, + { + "name": "Microfarad", + "symbol": "μF", + "description": "Microfarad - 1e-6 farads.", + "system": "SIDerived", + "magnitude": "Micro", + "factoryName": "Microfarads" + }, + { + "name": "Nanofarad", + "symbol": "nF", + "description": "Nanofarad - 1e-9 farads.", + "system": "SIDerived", + "magnitude": "Nano", + "factoryName": "Nanofarads" + }, + { + "name": "Picofarad", + "symbol": "pF", + "description": "Picofarad - 1e-12 farads.", + "system": "SIDerived", + "magnitude": "Pico", + "factoryName": "Picofarads" + }, + { + "name": "AmpereHour", + "symbol": "Ah", + "description": "Ampere-hour - 3600 coulombs of electric charge.", + "system": "SIDerived", + "conversionFactor": "AmpereHourToCoulombs", + "factoryName": "AmpereHours" } ] }, @@ -627,6 +1019,22 @@ "description": "Hertz - SI derived unit of frequency.", "system": "SIDerived", "factoryName": "Hertz" + }, + { + "name": "Kilohertz", + "symbol": "kHz", + "description": "Kilohertz - 1000 hertz.", + "system": "SIDerived", + "magnitude": "Kilo", + "factoryName": "Kilohertz" + }, + { + "name": "Megahertz", + "symbol": "MHz", + "description": "Megahertz - 1e6 hertz.", + "system": "SIDerived", + "magnitude": "Mega", + "factoryName": "Megahertz" } ] }, @@ -661,6 +1069,22 @@ "description": "Diopter - SI unit of optical power.", "system": "SIDerived", "factoryName": "Diopters" + }, + { + "name": "Millicandela", + "symbol": "mcd", + "description": "Millicandela - 0.001 candelas.", + "system": "SIDerived", + "magnitude": "Milli", + "factoryName": "Millicandelas" + }, + { + "name": "FootCandle", + "symbol": "fc", + "description": "Foot-candle - Imperial unit of illuminance (lumen per square foot).", + "system": "Imperial", + "conversionFactor": "FootCandleToLux", + "factoryName": "FootCandles" } ] }, @@ -703,6 +1127,38 @@ "description": "Coulomb per kilogram - SI derived unit of radiation exposure.", "system": "SIDerived", "factoryName": "CoulombPerKilogram" + }, + { + "name": "Curie", + "symbol": "Ci", + "description": "Curie - traditional unit of radioactive activity.", + "system": "Other", + "conversionFactor": "CurieToBecquerels", + "factoryName": "Curies" + }, + { + "name": "Rad", + "symbol": "rad", + "description": "Rad - traditional unit of absorbed dose (0.01 Gy).", + "system": "Other", + "conversionFactor": "RadToGrays", + "factoryName": "Rads" + }, + { + "name": "Rem", + "symbol": "rem", + "description": "Rem - traditional unit of equivalent dose (0.01 Sv).", + "system": "Other", + "conversionFactor": "RemToSieverts", + "factoryName": "Rems" + }, + { + "name": "Roentgen", + "symbol": "R", + "description": "Roentgen - traditional unit of ionizing radiation exposure.", + "system": "Other", + "conversionFactor": "RoentgenToCoulombsPerKilogram", + "factoryName": "Roentgens" } ] }, @@ -716,6 +1172,22 @@ "description": "Kilogram per cubic meter - SI derived unit of density.", "system": "SIDerived", "factoryName": "KilogramPerCubicMeter" + }, + { + "name": "GramPerCubicCentimeter", + "symbol": "g/cm³", + "description": "Gram per cubic centimeter - 1000 kg/m³.", + "system": "SIDerived", + "conversionFactor": "GramPerCubicCentimeterToKilogramPerCubicMeter", + "factoryName": "GramPerCubicCentimeter" + }, + { + "name": "GramPerLiter", + "symbol": "g/L", + "description": "Gram per liter - equal to one kilogram per cubic meter.", + "system": "SIDerived", + "conversionFactor": "GramPerLiterToKilogramPerCubicMeter", + "factoryName": "GramPerLiter" } ] }, @@ -737,6 +1209,38 @@ "system": "SIDerived", "conversionFactor": "MolarToCubicMeter", "factoryName": "Molars" + }, + { + "name": "Kilomole", + "symbol": "kmol", + "description": "Kilomole - 1000 moles.", + "system": "SIDerived", + "magnitude": "Kilo", + "factoryName": "Kilomoles" + }, + { + "name": "Millimole", + "symbol": "mmol", + "description": "Millimole - 0.001 moles.", + "system": "SIDerived", + "magnitude": "Milli", + "factoryName": "Millimoles" + }, + { + "name": "Millimolar", + "symbol": "mM", + "description": "Millimolar - 0.001 moles per liter (1 mol/m³).", + "system": "SIDerived", + "conversionFactor": "MillimolarToMolePerCubicMeter", + "factoryName": "Millimolars" + }, + { + "name": "Micromolar", + "symbol": "μM", + "description": "Micromolar - 1e-6 moles per liter (0.001 mol/m³).", + "system": "SIDerived", + "conversionFactor": "MicromolarToMolePerCubicMeter", + "factoryName": "Micromolars" } ] }, @@ -802,6 +1306,22 @@ "description": "Newton per meter - SI derived unit of surface tension.", "system": "SIDerived", "factoryName": "NewtonPerMeter" + }, + { + "name": "Centipoise", + "symbol": "cP", + "description": "Centipoise - 0.001 pascal seconds (viscosity of water at 20°C ≈ 1 cP).", + "system": "CGS", + "conversionFactor": "CentipoiseToPascalSecond", + "factoryName": "Centipoise" + }, + { + "name": "DynePerCentimeter", + "symbol": "dyn/cm", + "description": "Dyne per centimeter - CGS unit of surface tension.", + "system": "CGS", + "conversionFactor": "DynePerCentimeterToNewtonPerMeter", + "factoryName": "DynePerCentimeter" } ] }, @@ -852,6 +1372,30 @@ "system": "SIDerived", "conversionFactor": "KilojoulePerMoleToJoulePerMole", "factoryName": "KilojoulePerMole" + }, + { + "name": "CaloriePerMole", + "symbol": "cal/mol", + "description": "Calorie per mole - thermochemical calorie per mole.", + "system": "Other", + "conversionFactor": "CaloriePerMoleToJoulePerMole", + "factoryName": "CaloriesPerMole" + }, + { + "name": "EnzymeUnit", + "symbol": "U", + "description": "Enzyme unit - one micromole of substrate per minute.", + "system": "Other", + "conversionFactor": "EnzymeUnitToKatals", + "factoryName": "EnzymeUnits" + }, + { + "name": "Dalton", + "symbol": "Da", + "description": "Dalton - molar mass numerically equal to one gram per mole.", + "system": "Atomic", + "conversionFactor": "GramPerMoleToKilogramPerMole", + "factoryName": "Daltons" } ] }, diff --git a/Semantics.Test/Quantities/UnitBackfillTests.cs b/Semantics.Test/Quantities/UnitBackfillTests.cs new file mode 100644 index 0000000..1c605be --- /dev/null +++ b/Semantics.Test/Quantities/UnitBackfillTests.cs @@ -0,0 +1,231 @@ +// Copyright (c) ktsu.dev +// All rights reserved. +// Licensed under the MIT license. + +namespace ktsu.Semantics.Test.Quantities; + +using ktsu.Semantics.Quantities; +using ktsu.Semantics.Quantities.Units; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +/// +/// Covers the unit catalog backfilled from main (imperial/US/CGS/traditional units and +/// SI-prefixed conveniences) plus the corrected Fahrenheit/Rankine affine conversions. +/// +[TestClass] +public sealed class UnitBackfillTests +{ + private const double Tolerance = 1e-9; + + // ---- Temperature: the affine conversion was inverted before the backfill ---- + + [TestMethod] + public void Temperature_FromFahrenheit_FreezingPoint_Is_273_15_Kelvin() + { + Temperature t = Temperature.FromFahrenheit(32.0); + Assert.AreEqual(273.15, t.Value, Tolerance); + } + + [TestMethod] + public void Temperature_FromFahrenheit_BoilingPoint_Is_373_15_Kelvin() + { + Temperature t = Temperature.FromFahrenheit(212.0); + Assert.AreEqual(373.15, t.Value, Tolerance); + } + + [TestMethod] + public void Temperature_In_Fahrenheit_RoundTrips() + { + Temperature t = Temperature.FromFahrenheit(98.6); + Assert.AreEqual(98.6, t.In(Units.Fahrenheit), Tolerance); + } + + [TestMethod] + public void Temperature_FromRankine_Is_Absolute_With_Fahrenheit_Degrees() + { + Temperature t = Temperature.FromRankine(491.67); + Assert.AreEqual(273.15, t.Value, Tolerance); + } + + // ---- Length / Area / Volume ---- + + [TestMethod] + public void Length_FromNauticalMiles_Is_1852_Meters() + { + Length l = Length.FromNauticalMiles(1.0); + Assert.AreEqual(1852.0, l.Value, Tolerance); + Assert.AreEqual(1.0, l.In(Units.NauticalMile), Tolerance); + } + + [TestMethod] + public void Area_FromAcres_And_Hectares() + { + Assert.AreEqual(4046.8564224, Area.FromAcres(1.0).Value, Tolerance); + Assert.AreEqual(10000.0, Area.FromHectares(1.0).Value, Tolerance); + Assert.AreEqual(2589988.110336, Area.FromSquareMiles(1.0).Value, Tolerance); + Assert.AreEqual(1e6, Area.FromSquareKilometers(1.0).Value, Tolerance); + } + + [TestMethod] + public void Volume_From_Imperial_And_US_Units() + { + Assert.AreEqual(0.028316846592, Volume.FromCubicFeet(1.0).Value, Tolerance); + Assert.AreEqual(0.00454609, Volume.FromImperialGallons(1.0).Value, Tolerance); + Assert.AreEqual(0.000946352946, Volume.FromUSQuarts(1.0).Value, Tolerance); + Assert.AreEqual(1e-6, Volume.FromCubicCentimeters(1.0).Value, Tolerance); + } + + // ---- Mass ---- + + [TestMethod] + public void Mass_FromStone_And_ShortTons() + { + Assert.AreEqual(6.35029318, Mass.FromStone(1.0).Value, Tolerance); + Assert.AreEqual(907.18474, Mass.FromShortTons(1.0).Value, Tolerance); + } + + [TestMethod] + public void Mass_FromAtomicMassUnits_Is_CODATA_Value() + { + Mass m = Mass.FromAtomicMassUnits(1.0); + Assert.AreEqual(1.66053906660e-27, m.Value, 1e-36); + } + + // ---- Mechanics ---- + + [TestMethod] + public void Speed_FromKnots_Is_NauticalMilesPerHour() + { + Speed s = Speed.FromKnots(1.0); + Assert.AreEqual(1852.0 / 3600.0, s.Value, Tolerance); + } + + [TestMethod] + public void AccelerationMagnitude_FromStandardGravity_Is_9_80665() + { + AccelerationMagnitude a = AccelerationMagnitude.FromStandardGravity(1.0); + Assert.AreEqual(9.80665, a.Value, Tolerance); + } + + [TestMethod] + public void ForceMagnitude_FromPoundsForce_And_Dynes() + { + Assert.AreEqual(4.4482216152605, ForceMagnitude.FromPoundsForce(1.0).Value, Tolerance); + Assert.AreEqual(1e-5, ForceMagnitude.FromDynes(1.0).Value, Tolerance); + } + + [TestMethod] + public void Pressure_FromKilopascals_And_Torr() + { + Assert.AreEqual(1000.0, Pressure.FromKilopascals(1.0).Value, Tolerance); + Assert.AreEqual(101325.0, Pressure.FromTorr(760.0).Value, 1e-6); + } + + [TestMethod] + public void Energy_From_Btus_WattHours_Ergs_Kilocalories() + { + Assert.AreEqual(1055.05585262, Energy.FromBtus(1.0).Value, Tolerance); + Assert.AreEqual(3600.0, Energy.FromWattHours(1.0).Value, Tolerance); + Assert.AreEqual(1e-7, Energy.FromErgs(1.0).Value, Tolerance); + Assert.AreEqual(4184.0, Energy.FromKilocalories(1.0).Value, Tolerance); + } + + [TestMethod] + public void Power_FromKilowatts_And_Megawatts() + { + Assert.AreEqual(1500.0, Power.FromKilowatts(1.5).Value, Tolerance); + Assert.AreEqual(1e6, Power.FromMegawatts(1.0).Value, Tolerance); + } + + // ---- Electromagnetism ---- + + [TestMethod] + public void ChargeMagnitude_FromAmpereHours_Is_3600_Coulombs() + { + Assert.AreEqual(3600.0, ChargeMagnitude.FromAmpereHours(1.0).Value, Tolerance); + } + + [TestMethod] + public void Capacitance_From_SI_Prefixed_Farads() + { + Assert.AreEqual(1e-6, Capacitance.FromMicrofarads(1.0).Value, 1e-15); + Assert.AreEqual(1e-12, Capacitance.FromPicofarads(1.0).Value, 1e-21); + } + + // ---- Frequency / angle / ratio ---- + + [TestMethod] + public void Frequency_FromKilohertz_And_Megahertz() + { + Assert.AreEqual(1000.0, Frequency.FromKilohertz(1.0).Value, Tolerance); + Assert.AreEqual(1e6, Frequency.FromMegahertz(1.0).Value, Tolerance); + } + + [TestMethod] + public void Angle_FromGradians_And_Revolutions() + { + Assert.AreEqual(Math.PI, Angle.FromGradians(200.0).Value, Tolerance); + Assert.AreEqual(2.0 * Math.PI, Angle.FromRevolutions(1.0).Value, Tolerance); + } + + [TestMethod] + public void Ratio_FromPartsPerMillion_And_Billion() + { + Assert.AreEqual(1e-6, Ratio.FromPartsPerMillion(1.0).Value, 1e-15); + Assert.AreEqual(1e-9, Ratio.FromPartsPerBillion(1.0).Value, 1e-18); + } + + // ---- Chemistry ---- + + [TestMethod] + public void Concentration_FromMillimolars_Is_One_MolePerCubicMeter() + { + Assert.AreEqual(1.0, Concentration.FromMillimolars(1.0).Value, Tolerance); + } + + [TestMethod] + public void MolarMass_FromDaltons_Equals_GramPerMole() + { + Assert.AreEqual(0.001, MolarMass.FromDaltons(1.0).Value, Tolerance); + Assert.AreEqual(MolarMass.FromGramPerMole(1.0).Value, MolarMass.FromDaltons(1.0).Value, Tolerance); + } + + // ---- Radiology ---- + + [TestMethod] + public void Traditional_Radiological_Units_Convert_To_SI() + { + Assert.AreEqual(3.7e10, RadioactiveActivity.FromCuries(1.0).Value, 1.0); + Assert.AreEqual(1.0, AbsorbedDose.FromRads(100.0).Value, Tolerance); + Assert.AreEqual(1.0, EquivalentDose.FromRems(100.0).Value, Tolerance); + Assert.AreEqual(2.58e-4, Exposure.FromRoentgens(1.0).Value, 1e-12); + } + + // ---- Density ---- + + [TestMethod] + public void Density_FromGramPerCubicCentimeter_Is_1000_KilogramPerCubicMeter() + { + Assert.AreEqual(1000.0, Density.FromGramPerCubicCentimeter(1.0).Value, Tolerance); + Assert.AreEqual(1.0, Density.FromGramPerLiter(1.0).Value, Tolerance); + } + + // ---- Physical constants backfilled into domains.json ---- + + [TestMethod] + public void Acoustic_Reference_Constants_Are_Available() + { + Assert.AreEqual(20e-6, PhysicalConstants.Generic.ReferenceSoundPressure(), 1e-12); + Assert.AreEqual(1e-12, PhysicalConstants.Generic.ReferenceSoundIntensity(), 1e-21); + Assert.AreEqual(0.161, PhysicalConstants.Generic.SabineConstant(), Tolerance); + } + + [TestMethod] + public void Optical_Nuclear_And_Fluid_Constants_Are_Available() + { + Assert.AreEqual(683.0, PhysicalConstants.Generic.LuminousEfficacy(), Tolerance); + Assert.AreEqual(5.0507837461e-27, PhysicalConstants.Generic.NuclearMagneton(), 1e-36); + Assert.AreEqual(1.225, PhysicalConstants.Generic.StandardAirDensity(), Tolerance); + Assert.AreEqual(0.0728, PhysicalConstants.Generic.WaterSurfaceTension(), Tolerance); + } +}