From 77422b6b0c62d3410cb191976bf556705b3b4fc3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 10 May 2026 12:31:21 +0000 Subject: [PATCH] feat(generator): plural From{Unit} factory naming + form matrix docs (closes #49) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue #49 — every generated From{Unit} factory now uses the plural form, matching the convention CLAUDE.md and docs/strategy-unified-vector-quantities.md already advertise (Speed.FromMetersPerSecond, Force1D.FromNewtons, etc). - UnitDefinition gets a new optional FactoryName field. units.json sets it explicitly on every unit, including: * regular: Meter -> Meters, Newton -> Newtons, Joule -> Joules, ... * irregular: Foot -> Feet, Inch -> Inches, SquareFoot -> SquareFeet, SquareInch -> SquareInches, PoundFoot -> PoundFeet, Henry -> Henries * mass nouns / no-plural: Hertz, Lux, Siemens, Stokes, Psi, Horsepower, Celsius, Fahrenheit, Gauss, Poise, Dimensionless * already-plural compounds (Per): MetersPerSecond, KilometersPerHour, RadiansPerSecond, JoulePerKelvin, etc. all keep their name. - QuantitiesGenerator.AddUnitFactories looks up FactoryName from the unit map; falls back to Name + "s" when absent (correct for regular units, and lets dimensions.json that aren't migrated yet still build). - Regenerated Semantics.Quantities/Generated/. Spot-checked Length (FromMeters / FromKilometers / FromCentimeters / FromMillimeters / FromNanometers / FromAngstroms / FromFeet / FromInches / FromYards / FromMiles), Velocity1D (FromMetersPerSecond / FromKilometersPerHour / FromMilesPerHour), Frequency (FromHertz), Temperature (FromKelvins / FromCelsius / FromFahrenheit). All preserve the V0 non-negativity guard from #50 and the V0 - V0 absolute subtraction from #52. Updated tests in Semantics.Test/Quantities/{MultiUnitFactoryTests, Vector0InvariantTests,VectorQuantityTests,SemanticOverloadTests}.cs to use the new plural names (call sites + method names). Updated docs: - docs/physics-domains-guide.md, docs/complete-library-guide.md: example call sites switched to plural forms. - CLAUDE.md: noted the plural-naming convention and that every new unit in units.json must set factoryName. Issue #58 part 1 — added a "Form Coverage Matrix" section to docs/strategy-unified-vector-quantities.md documenting the canonical patterns (linear V0-V4, angular V0/V1/V3, scalar-only V0(+V1), etc.) and explaining that the generator silently skips a relationship form when either side is missing, so a new dimension must declare any form it needs to participate in. The SEM003 generator-time validator suggested in #58 needs a metadata schema change first (relationships are dimension-to-dimension today, not form-specific) — leaving that for a follow-up. --- CLAUDE.md | 1 + .../AbsorbedDose.g.cs | 2 +- .../Altitude.g.cs | 22 +- .../AmountOfSubstance.g.cs | 2 +- .../Angle.g.cs | 4 +- .../ApertureAngle.g.cs | 4 +- .../Area.g.cs | 6 +- .../AtmosphericPressure.g.cs | 6 +- .../AtomicMass.g.cs | 10 +- .../Bearing.g.cs | 4 +- .../BulkModulus.g.cs | 6 +- .../Capacitance.g.cs | 2 +- .../Capacity.g.cs | 8 +- .../CatalyticActivity.g.cs | 2 +- .../Charge.g.cs | 2 +- .../ChargeMagnitude.g.cs | 2 +- .../Concentration.g.cs | 2 +- .../CrossSectionalArea.g.cs | 6 +- .../Current1D.g.cs | 2 +- .../CurrentMagnitude.g.cs | 2 +- .../DecayTime.g.cs | 14 +- .../Depth.g.cs | 22 +- .../Diameter.g.cs | 22 +- .../Displacement1D.g.cs | 22 +- .../Distance.g.cs | 22 +- .../Drag.g.cs | 2 +- .../Duration.g.cs | 14 +- .../DynamicViscosity.g.cs | 2 +- .../EMF.g.cs | 2 +- .../Energy.g.cs | 8 +- .../EnzymeActivity.g.cs | 2 +- .../EquivalentDose.g.cs | 2 +- .../FieldOfView.g.cs | 4 +- .../Force1D.g.cs | 2 +- .../ForceMagnitude.g.cs | 2 +- .../Friction.g.cs | 2 +- .../GaugePressure.g.cs | 6 +- .../HalfLife.g.cs | 14 +- .../Heading.g.cs | 4 +- .../Heat.g.cs | 8 +- .../HeatFlowRate.g.cs | 2 +- .../Height.g.cs | 22 +- .../Inductance.g.cs | 2 +- .../KineticEnergy.g.cs | 8 +- .../Latency.g.cs | 14 +- .../Length.g.cs | 22 +- .../Lift.g.cs | 2 +- .../LuminousFlux.g.cs | 2 +- .../LuminousIntensity.g.cs | 2 +- .../MachNumber.g.cs | 4 +- .../MagneticFlux.g.cs | 2 +- .../MagneticFluxDensityMagnitude.g.cs | 2 +- .../Mass.g.cs | 10 +- .../Momentum1D.g.cs | 2 +- .../MomentumMagnitude.g.cs | 2 +- .../NormalForce.g.cs | 2 +- .../NuclearCrossSection.g.cs | 2 +- .../Offset.g.cs | 22 +- .../OpticalPower.g.cs | 2 +- .../Perimeter.g.cs | 22 +- .../Period.g.cs | 14 +- .../Phase.g.cs | 4 +- .../PotentialEnergy.g.cs | 8 +- .../Power.g.cs | 2 +- .../Pressure.g.cs | 6 +- .../RadioactiveActivity.g.cs | 2 +- .../Radius.g.cs | 22 +- .../Ratio.g.cs | 4 +- .../RefractiveIndex.g.cs | 4 +- .../Resistance.g.cs | 2 +- .../ReverberationTime.g.cs | 14 +- .../ReynoldsNumber.g.cs | 4 +- .../Rotation.g.cs | 4 +- .../ShearModulus.g.cs | 6 +- .../SignedAngle.g.cs | 4 +- .../SignedRatio.g.cs | 4 +- .../SpecificGravity.g.cs | 4 +- .../Stress.g.cs | 6 +- .../SurfaceArea.g.cs | 6 +- .../Temperature.g.cs | 2 +- .../TemperatureDelta.g.cs | 2 +- .../TemperatureDrop.g.cs | 2 +- .../TemperatureRise.g.cs | 2 +- .../Tension.g.cs | 2 +- .../ThermalEnergy.g.cs | 8 +- .../Thickness.g.cs | 22 +- .../Thrust.g.cs | 2 +- .../TimeConstant.g.cs | 14 +- .../Torque1D.g.cs | 4 +- .../TorqueMagnitude.g.cs | 4 +- .../Voltage.g.cs | 2 +- .../VoltageDrop.g.cs | 2 +- .../VoltageMagnitude.g.cs | 2 +- .../Volume.g.cs | 8 +- .../Wavelength.g.cs | 22 +- .../Weight.g.cs | 2 +- .../Width.g.cs | 22 +- .../Work.g.cs | 8 +- .../YoungsModulus.g.cs | 6 +- .../Generators/QuantitiesGenerator.cs | 12 +- .../Metadata/units.json | 321 ++++++++++++------ .../Models/UnitsMetadata.cs | 9 + .../Quantities/MultiUnitFactoryTests.cs | 68 ++-- .../Quantities/SemanticOverloadTests.cs | 30 +- .../Quantities/Vector0InvariantTests.cs | 64 ++-- .../Quantities/VectorQuantityTests.cs | 10 +- docs/complete-library-guide.md | 20 +- docs/physics-domains-guide.md | 44 +-- docs/strategy-unified-vector-quantities.md | 14 + 109 files changed, 705 insertions(+), 564 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 0f851d7..255bfe3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -145,6 +145,7 @@ var converted = sourceString.As(); - Edit `Semantics.SourceGenerators/Metadata/dimensions.json` to add a dimension, vector form, semantic overload, or relationship. - Rebuild `Semantics.SourceGenerators` and the consuming `Semantics.Quantities` project; emitted files appear in `Semantics.Quantities/Generated/Semantics.SourceGenerators//`. - Treat generator output as committed source. Diff it before commit so accidental regressions are visible. +- Factory names are **plural by convention** (#49). Each entry in `units.json` carries a `factoryName` field — the generator emits `From{factoryName}` (e.g. `Length.FromMeters`, `Mass.FromKilograms`, `Speed.FromMetersPerSecond`, `Length.FromFeet`, `Frequency.FromHertz`). Set it explicitly on every new unit; the generator falls back to `name + "s"` if absent, which is wrong for irregulars and "Per" compounds. - Generator diagnostics: - **SEM001** — a relationship in `dimensions.json` references a dimension that does not exist (typo or rename). The operator is silently dropped. - **SEM002** — schema-level validation issue (missing `name`/`symbol`, empty `availableUnits`, duplicate type names, no vector forms declared). 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 bca841e..18348e0 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 @@ -23,7 +23,7 @@ public record AbsorbedDose : PhysicalQuantity, T>, IVector0The value in Gray. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static AbsorbedDose FromGray(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static AbsorbedDose FromGrays(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two AbsorbedDose values, returning the absolute difference as a non-negative AbsorbedDose. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 4fc48ab..3285f4a 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 @@ -24,77 +24,77 @@ public record Altitude : PhysicalQuantity, T>, IVector0The value in Meter. /// A new Altitude instance. /// Thrown when the resulting magnitude would be negative. - public static Altitude FromMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Altitude FromMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Altitude from a value in Kilometer. /// /// The value in Kilometer. /// A new Altitude instance. /// Thrown when the resulting magnitude would be negative. - public static Altitude FromKilometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); + public static Altitude FromKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Altitude from a value in Centimeter. /// /// The value in Centimeter. /// A new Altitude instance. /// Thrown when the resulting magnitude would be negative. - public static Altitude FromCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); + public static Altitude FromCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); /// /// Creates a new Altitude from a value in Millimeter. /// /// The value in Millimeter. /// A new Altitude instance. /// Thrown when the resulting magnitude would be negative. - public static Altitude FromMillimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Altitude FromMillimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Altitude from a value in Micrometer. /// /// The value in Micrometer. /// A new Altitude instance. /// Thrown when the resulting magnitude would be negative. - public static Altitude FromMicrometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Altitude FromMicrometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Altitude from a value in Nanometer. /// /// The value in Nanometer. /// A new Altitude instance. /// Thrown when the resulting magnitude would be negative. - public static Altitude FromNanometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); + public static Altitude FromNanometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Creates a new Altitude from a value in Angstrom. /// /// The value in Angstrom. /// A new Altitude instance. /// Thrown when the resulting magnitude would be negative. - public static Altitude FromAngstrom(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); + public static Altitude FromAngstroms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); /// /// Creates a new Altitude from a value in Foot. /// /// The value in Foot. /// A new Altitude instance. /// Thrown when the resulting magnitude would be negative. - public static Altitude FromFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); + public static Altitude FromFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); /// /// Creates a new Altitude from a value in Inch. /// /// The value in Inch. /// A new Altitude instance. /// Thrown when the resulting magnitude would be negative. - public static Altitude FromInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); + public static Altitude FromInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); /// /// Creates a new Altitude from a value in Yard. /// /// The value in Yard. /// A new Altitude instance. /// Thrown when the resulting magnitude would be negative. - public static Altitude FromYard(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); + public static Altitude FromYards(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); /// /// Creates a new Altitude from a value in Mile. /// /// The value in Mile. /// A new Altitude instance. /// Thrown when the resulting magnitude would be negative. - public static Altitude FromMile(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); + public static Altitude FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); /// Implicit conversion to Length. public static implicit operator Length(Altitude value) => Length.Create(value.Value); /// Explicit conversion from Length. 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 2bdaef9..b9f8836 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 @@ -23,7 +23,7 @@ public record AmountOfSubstance : PhysicalQuantity, T>, /// The value in Mole. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static AmountOfSubstance FromMole(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static AmountOfSubstance FromMoles(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two AmountOfSubstance values, returning the absolute difference as a non-negative AmountOfSubstance. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 5c2a201..f644923 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 @@ -23,14 +23,14 @@ public record Angle : PhysicalQuantity, T>, IVector0, T> /// The value in Radian. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Angle FromRadian(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Angle FromRadians(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in Degree. /// /// The value in Degree. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Angle FromDegree(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); + public static Angle FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); /// /// Subtracts two Angle values, returning the absolute difference as a non-negative Angle. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 213716e..7133102 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 @@ -24,14 +24,14 @@ public record ApertureAngle : PhysicalQuantity, T>, IVector0 /// The value in Radian. /// A new ApertureAngle instance. /// Thrown when the resulting magnitude would be negative. - public static ApertureAngle FromRadian(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static ApertureAngle FromRadians(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new ApertureAngle from a value in Degree. /// /// The value in Degree. /// A new ApertureAngle instance. /// Thrown when the resulting magnitude would be negative. - public static ApertureAngle FromDegree(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); + public static ApertureAngle FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); /// Implicit conversion to Angle. public static implicit operator Angle(ApertureAngle value) => Angle.Create(value.Value); /// Explicit conversion from Angle. 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 06f9fae..b8f8146 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 @@ -23,21 +23,21 @@ public record Area : PhysicalQuantity, T>, IVector0, T> /// The value in SquareMeter. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Area FromSquareMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Area FromSquareMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in SquareFoot. /// /// The value in SquareFoot. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Area FromSquareFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareFootToSquareMeters)), nameof(value))); + public static Area FromSquareFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareFootToSquareMeters)), nameof(value))); /// /// Creates a new from a value in SquareInch. /// /// The value in SquareInch. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Area FromSquareInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareInchToSquareMeters)), nameof(value))); + public static Area FromSquareInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareInchToSquareMeters)), nameof(value))); /// /// Subtracts two Area values, returning the absolute difference as a non-negative Area. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 5af2b8d..0a69c55 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 @@ -24,21 +24,21 @@ public record AtmosphericPressure : PhysicalQuantity, /// The value in Pascal. /// A new AtmosphericPressure instance. /// Thrown when the resulting magnitude would be negative. - public static AtmosphericPressure FromPascal(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static AtmosphericPressure FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new AtmosphericPressure from a value in Bar. /// /// The value in Bar. /// A new AtmosphericPressure instance. /// Thrown when the resulting magnitude would be negative. - public static AtmosphericPressure FromBar(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); + public static AtmosphericPressure FromBars(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); /// /// Creates a new AtmosphericPressure from a value in Atmosphere. /// /// The value in Atmosphere. /// A new AtmosphericPressure instance. /// Thrown when the resulting magnitude would be negative. - public static AtmosphericPressure FromAtmosphere(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); + public static AtmosphericPressure FromAtmospheres(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); /// /// Creates a new AtmosphericPressure from a value in Psi. /// 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 5e7bdcf..eb6e816 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 @@ -24,35 +24,35 @@ public record AtomicMass : PhysicalQuantity, T>, IVector0The value in Kilogram. /// A new AtomicMass instance. /// Thrown when the resulting magnitude would be negative. - public static AtomicMass FromKilogram(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static AtomicMass FromKilograms(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new AtomicMass from a value in Gram. /// /// The value in Gram. /// A new AtomicMass instance. /// Thrown when the resulting magnitude would be negative. - public static AtomicMass FromGram(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static AtomicMass FromGrams(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new AtomicMass from a value in Ton. /// /// The value in Ton. /// A new AtomicMass instance. /// Thrown when the resulting magnitude would be negative. - public static AtomicMass FromTon(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.TonToKilograms)), nameof(value))); + public static AtomicMass FromTons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.TonToKilograms)), nameof(value))); /// /// Creates a new AtomicMass from a value in Pound. /// /// The value in Pound. /// A new AtomicMass instance. /// Thrown when the resulting magnitude would be negative. - public static AtomicMass FromPound(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundToKilograms)), nameof(value))); + public static AtomicMass FromPounds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundToKilograms)), nameof(value))); /// /// Creates a new AtomicMass from a value in Ounce. /// /// The value in Ounce. /// A new AtomicMass instance. /// Thrown when the resulting magnitude would be negative. - public static AtomicMass FromOunce(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.OunceToKilograms)), nameof(value))); + public static AtomicMass FromOunces(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.OunceToKilograms)), nameof(value))); /// Implicit conversion to Mass. public static implicit operator Mass(AtomicMass value) => Mass.Create(value.Value); /// Explicit conversion from Mass. 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 7d790c8..f04ecce 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 @@ -23,13 +23,13 @@ public record Bearing : PhysicalQuantity, T>, IVector1, /// /// The value in Radian. /// A new Bearing instance. - public static Bearing FromRadian(T value) => Create(value); + public static Bearing FromRadians(T value) => Create(value); /// /// Creates a new Bearing from a value in Degree. /// /// The value in Degree. /// A new Bearing instance. - public static Bearing FromDegree(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); + public static Bearing FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); /// Implicit conversion to SignedAngle. public static implicit operator SignedAngle(Bearing value) => SignedAngle.Create(value.Value); /// Explicit conversion from SignedAngle. 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 1670c84..822c260 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 @@ -24,21 +24,21 @@ public record BulkModulus : PhysicalQuantity, T>, IVector0The value in Pascal. /// A new BulkModulus instance. /// Thrown when the resulting magnitude would be negative. - public static BulkModulus FromPascal(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static BulkModulus FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new BulkModulus from a value in Bar. /// /// The value in Bar. /// A new BulkModulus instance. /// Thrown when the resulting magnitude would be negative. - public static BulkModulus FromBar(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); + public static BulkModulus FromBars(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); /// /// Creates a new BulkModulus from a value in Atmosphere. /// /// The value in Atmosphere. /// A new BulkModulus instance. /// Thrown when the resulting magnitude would be negative. - public static BulkModulus FromAtmosphere(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); + public static BulkModulus FromAtmospheres(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); /// /// Creates a new BulkModulus from a value in Psi. /// 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 c92022f..cddd45e 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 @@ -23,7 +23,7 @@ public record Capacitance : PhysicalQuantity, T>, IVector0The value in Farad. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Capacitance FromFarad(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Capacitance FromFarads(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two Capacitance values, returning the absolute difference as a non-negative Capacitance. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 f153d3e..06eec91 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 @@ -24,28 +24,28 @@ public record Capacity : PhysicalQuantity, T>, IVector0The value in CubicMeter. /// A new Capacity instance. /// Thrown when the resulting magnitude would be negative. - public static Capacity FromCubicMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Capacity FromCubicMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Capacity from a value in Liter. /// /// The value in Liter. /// A new Capacity instance. /// Thrown when the resulting magnitude would be negative. - public static Capacity FromLiter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.LiterToCubicMeters)), nameof(value))); + public static Capacity FromLiters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.LiterToCubicMeters)), nameof(value))); /// /// Creates a new Capacity from a value in Milliliter. /// /// The value in Milliliter. /// A new Capacity instance. /// Thrown when the resulting magnitude would be negative. - public static Capacity FromMilliliter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Capacity FromMilliliters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Capacity from a value in Gallon. /// /// The value in Gallon. /// A new Capacity instance. /// Thrown when the resulting magnitude would be negative. - public static Capacity FromGallon(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GallonToCubicMeters)), nameof(value))); + public static Capacity FromGallons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GallonToCubicMeters)), nameof(value))); /// Implicit conversion to Volume. public static implicit operator Volume(Capacity value) => Volume.Create(value.Value); /// Explicit conversion from Volume. 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 c820864..e1e979b 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 @@ -23,7 +23,7 @@ public record CatalyticActivity : PhysicalQuantity, T>, /// The value in Katal. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static CatalyticActivity FromKatal(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static CatalyticActivity FromKatals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two CatalyticActivity values, returning the absolute difference as a non-negative CatalyticActivity. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 6709bfc..504ed62 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 @@ -22,7 +22,7 @@ public record Charge : PhysicalQuantity, T>, IVector1, T> /// /// The value in Coulomb. /// A new instance. - public static Charge FromCoulomb(T value) => Create(value); + public static Charge FromCoulombs(T value) => Create(value); /// /// Gets the magnitude of this quantity as a . /// 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 ac9d67b..30795a5 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 @@ -23,7 +23,7 @@ public record ChargeMagnitude : PhysicalQuantity, T>, IVec /// The value in Coulomb. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static ChargeMagnitude FromCoulomb(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static ChargeMagnitude FromCoulombs(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two ChargeMagnitude values, returning the absolute difference as a non-negative ChargeMagnitude. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 c6ba074..54ba729 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 @@ -23,7 +23,7 @@ public record Concentration : PhysicalQuantity, T>, IVector0 /// The value in Molar. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Concentration FromMolar(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Concentration FromMolars(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two Concentration values, returning the absolute difference as a non-negative Concentration. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 02c5873..a4c37b3 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 @@ -24,21 +24,21 @@ public record CrossSectionalArea : PhysicalQuantity, T> /// The value in SquareMeter. /// A new CrossSectionalArea instance. /// Thrown when the resulting magnitude would be negative. - public static CrossSectionalArea FromSquareMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static CrossSectionalArea FromSquareMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new CrossSectionalArea from a value in SquareFoot. /// /// The value in SquareFoot. /// A new CrossSectionalArea instance. /// Thrown when the resulting magnitude would be negative. - public static CrossSectionalArea FromSquareFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareFootToSquareMeters)), nameof(value))); + public static CrossSectionalArea FromSquareFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareFootToSquareMeters)), nameof(value))); /// /// Creates a new CrossSectionalArea from a value in SquareInch. /// /// The value in SquareInch. /// A new CrossSectionalArea instance. /// Thrown when the resulting magnitude would be negative. - public static CrossSectionalArea FromSquareInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareInchToSquareMeters)), nameof(value))); + public static CrossSectionalArea FromSquareInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareInchToSquareMeters)), nameof(value))); /// Implicit conversion to Area. public static implicit operator Area(CrossSectionalArea value) => Area.Create(value.Value); /// Explicit conversion from Area. 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 ea3ebb8..c893622 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 @@ -22,7 +22,7 @@ public record Current1D : PhysicalQuantity, T>, IVector1 /// The value in Ampere. /// A new instance. - public static Current1D FromAmpere(T value) => Create(value); + public static Current1D FromAmperes(T value) => Create(value); /// /// Gets the magnitude of this quantity as a . /// 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 2e69d94..88d9c3c 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 @@ -23,7 +23,7 @@ public record CurrentMagnitude : PhysicalQuantity, T>, IV /// The value in Ampere. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static CurrentMagnitude FromAmpere(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static CurrentMagnitude FromAmperes(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two CurrentMagnitude values, returning the absolute difference as a non-negative CurrentMagnitude. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 c61a521..9547be6 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 @@ -24,49 +24,49 @@ public record DecayTime : PhysicalQuantity, T>, IVector0The value in Second. /// A new DecayTime instance. /// Thrown when the resulting magnitude would be negative. - public static DecayTime FromSecond(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static DecayTime FromSeconds(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new DecayTime from a value in Millisecond. /// /// The value in Millisecond. /// A new DecayTime instance. /// Thrown when the resulting magnitude would be negative. - public static DecayTime FromMillisecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static DecayTime FromMilliseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new DecayTime from a value in Microsecond. /// /// The value in Microsecond. /// A new DecayTime instance. /// Thrown when the resulting magnitude would be negative. - public static DecayTime FromMicrosecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static DecayTime FromMicroseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new DecayTime from a value in Minute. /// /// The value in Minute. /// A new DecayTime instance. /// Thrown when the resulting magnitude would be negative. - public static DecayTime FromMinute(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); + public static DecayTime FromMinutes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); /// /// Creates a new DecayTime from a value in Hour. /// /// The value in Hour. /// A new DecayTime instance. /// Thrown when the resulting magnitude would be negative. - public static DecayTime FromHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); + public static DecayTime FromHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); /// /// Creates a new DecayTime from a value in Day. /// /// The value in Day. /// A new DecayTime instance. /// Thrown when the resulting magnitude would be negative. - public static DecayTime FromDay(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); + public static DecayTime FromDays(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); /// /// Creates a new DecayTime from a value in Year. /// /// The value in Year. /// A new DecayTime instance. /// Thrown when the resulting magnitude would be negative. - public static DecayTime FromYear(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); + public static DecayTime FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); /// Implicit conversion to Duration. public static implicit operator Duration(DecayTime value) => Duration.Create(value.Value); /// Explicit conversion from Duration. 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 9c62482..ac7408a 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 @@ -24,77 +24,77 @@ public record Depth : PhysicalQuantity, T>, IVector0, T> /// The value in Meter. /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. - public static Depth FromMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Depth FromMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Depth from a value in Kilometer. /// /// The value in Kilometer. /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. - public static Depth FromKilometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); + public static Depth FromKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Depth from a value in Centimeter. /// /// The value in Centimeter. /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. - public static Depth FromCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); + public static Depth FromCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); /// /// Creates a new Depth from a value in Millimeter. /// /// The value in Millimeter. /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. - public static Depth FromMillimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Depth FromMillimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Depth from a value in Micrometer. /// /// The value in Micrometer. /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. - public static Depth FromMicrometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Depth FromMicrometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Depth from a value in Nanometer. /// /// The value in Nanometer. /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. - public static Depth FromNanometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); + public static Depth FromNanometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Creates a new Depth from a value in Angstrom. /// /// The value in Angstrom. /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. - public static Depth FromAngstrom(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); + public static Depth FromAngstroms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); /// /// Creates a new Depth from a value in Foot. /// /// The value in Foot. /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. - public static Depth FromFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); + public static Depth FromFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); /// /// Creates a new Depth from a value in Inch. /// /// The value in Inch. /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. - public static Depth FromInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); + public static Depth FromInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); /// /// Creates a new Depth from a value in Yard. /// /// The value in Yard. /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. - public static Depth FromYard(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); + public static Depth FromYards(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); /// /// Creates a new Depth from a value in Mile. /// /// The value in Mile. /// A new Depth instance. /// Thrown when the resulting magnitude would be negative. - public static Depth FromMile(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); + public static Depth FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); /// Implicit conversion to Length. public static implicit operator Length(Depth value) => Length.Create(value.Value); /// Explicit conversion from Length. 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 fcd55eb..2707906 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 @@ -24,77 +24,77 @@ public record Diameter : PhysicalQuantity, T>, IVector0The value in Meter. /// A new Diameter instance. /// Thrown when the resulting magnitude would be negative. - public static Diameter FromMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Diameter FromMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Diameter from a value in Kilometer. /// /// The value in Kilometer. /// A new Diameter instance. /// Thrown when the resulting magnitude would be negative. - public static Diameter FromKilometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); + public static Diameter FromKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Diameter from a value in Centimeter. /// /// The value in Centimeter. /// A new Diameter instance. /// Thrown when the resulting magnitude would be negative. - public static Diameter FromCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); + public static Diameter FromCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); /// /// Creates a new Diameter from a value in Millimeter. /// /// The value in Millimeter. /// A new Diameter instance. /// Thrown when the resulting magnitude would be negative. - public static Diameter FromMillimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Diameter FromMillimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Diameter from a value in Micrometer. /// /// The value in Micrometer. /// A new Diameter instance. /// Thrown when the resulting magnitude would be negative. - public static Diameter FromMicrometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Diameter FromMicrometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Diameter from a value in Nanometer. /// /// The value in Nanometer. /// A new Diameter instance. /// Thrown when the resulting magnitude would be negative. - public static Diameter FromNanometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); + public static Diameter FromNanometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Creates a new Diameter from a value in Angstrom. /// /// The value in Angstrom. /// A new Diameter instance. /// Thrown when the resulting magnitude would be negative. - public static Diameter FromAngstrom(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); + public static Diameter FromAngstroms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); /// /// Creates a new Diameter from a value in Foot. /// /// The value in Foot. /// A new Diameter instance. /// Thrown when the resulting magnitude would be negative. - public static Diameter FromFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); + public static Diameter FromFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); /// /// Creates a new Diameter from a value in Inch. /// /// The value in Inch. /// A new Diameter instance. /// Thrown when the resulting magnitude would be negative. - public static Diameter FromInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); + public static Diameter FromInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); /// /// Creates a new Diameter from a value in Yard. /// /// The value in Yard. /// A new Diameter instance. /// Thrown when the resulting magnitude would be negative. - public static Diameter FromYard(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); + public static Diameter FromYards(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); /// /// Creates a new Diameter from a value in Mile. /// /// The value in Mile. /// A new Diameter instance. /// Thrown when the resulting magnitude would be negative. - public static Diameter FromMile(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); + public static Diameter FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); /// Implicit conversion to Length. public static implicit operator Length(Diameter value) => Length.Create(value.Value); /// Explicit conversion from Length. 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 c5ba4af..56ec7fc 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 @@ -22,67 +22,67 @@ public record Displacement1D : PhysicalQuantity, T>, IVecto /// /// The value in Meter. /// A new instance. - public static Displacement1D FromMeter(T value) => Create(value); + public static Displacement1D FromMeters(T value) => Create(value); /// /// Creates a new from a value in Kilometer. /// /// The value in Kilometer. /// A new instance. - public static Displacement1D FromKilometer(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Kilo))); + public static Displacement1D FromKilometers(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Kilo))); /// /// Creates a new from a value in Centimeter. /// /// The value in Centimeter. /// A new instance. - public static Displacement1D FromCentimeter(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Centi))); + public static Displacement1D FromCentimeters(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Centi))); /// /// Creates a new from a value in Millimeter. /// /// The value in Millimeter. /// A new instance. - public static Displacement1D FromMillimeter(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Milli))); + public static Displacement1D FromMillimeters(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Milli))); /// /// Creates a new from a value in Micrometer. /// /// The value in Micrometer. /// A new instance. - public static Displacement1D FromMicrometer(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Micro))); + public static Displacement1D FromMicrometers(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Micro))); /// /// Creates a new from a value in Nanometer. /// /// The value in Nanometer. /// A new instance. - public static Displacement1D FromNanometer(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Nano))); + public static Displacement1D FromNanometers(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Nano))); /// /// Creates a new from a value in Angstrom. /// /// The value in Angstrom. /// A new instance. - public static Displacement1D FromAngstrom(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters))); + public static Displacement1D FromAngstroms(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters))); /// /// Creates a new from a value in Foot. /// /// The value in Foot. /// A new instance. - public static Displacement1D FromFoot(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters))); + public static Displacement1D FromFeet(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters))); /// /// Creates a new from a value in Inch. /// /// The value in Inch. /// A new instance. - public static Displacement1D FromInch(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters))); + public static Displacement1D FromInches(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters))); /// /// Creates a new from a value in Yard. /// /// The value in Yard. /// A new instance. - public static Displacement1D FromYard(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.YardToMeters))); + public static Displacement1D FromYards(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.YardToMeters))); /// /// Creates a new from a value in Mile. /// /// The value in Mile. /// A new instance. - public static Displacement1D FromMile(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.MileToMeters))); + public static Displacement1D FromMiles(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.MileToMeters))); /// /// Gets the magnitude of this quantity as a . /// 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 6ce4600..f531e89 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 @@ -24,77 +24,77 @@ public record Distance : PhysicalQuantity, T>, IVector0The value in Meter. /// A new Distance instance. /// Thrown when the resulting magnitude would be negative. - public static Distance FromMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Distance FromMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Distance from a value in Kilometer. /// /// The value in Kilometer. /// A new Distance instance. /// Thrown when the resulting magnitude would be negative. - public static Distance FromKilometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); + public static Distance FromKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Distance from a value in Centimeter. /// /// The value in Centimeter. /// A new Distance instance. /// Thrown when the resulting magnitude would be negative. - public static Distance FromCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); + public static Distance FromCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); /// /// Creates a new Distance from a value in Millimeter. /// /// The value in Millimeter. /// A new Distance instance. /// Thrown when the resulting magnitude would be negative. - public static Distance FromMillimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Distance FromMillimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Distance from a value in Micrometer. /// /// The value in Micrometer. /// A new Distance instance. /// Thrown when the resulting magnitude would be negative. - public static Distance FromMicrometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Distance FromMicrometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Distance from a value in Nanometer. /// /// The value in Nanometer. /// A new Distance instance. /// Thrown when the resulting magnitude would be negative. - public static Distance FromNanometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); + public static Distance FromNanometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Creates a new Distance from a value in Angstrom. /// /// The value in Angstrom. /// A new Distance instance. /// Thrown when the resulting magnitude would be negative. - public static Distance FromAngstrom(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); + public static Distance FromAngstroms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); /// /// Creates a new Distance from a value in Foot. /// /// The value in Foot. /// A new Distance instance. /// Thrown when the resulting magnitude would be negative. - public static Distance FromFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); + public static Distance FromFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); /// /// Creates a new Distance from a value in Inch. /// /// The value in Inch. /// A new Distance instance. /// Thrown when the resulting magnitude would be negative. - public static Distance FromInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); + public static Distance FromInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); /// /// Creates a new Distance from a value in Yard. /// /// The value in Yard. /// A new Distance instance. /// Thrown when the resulting magnitude would be negative. - public static Distance FromYard(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); + public static Distance FromYards(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); /// /// Creates a new Distance from a value in Mile. /// /// The value in Mile. /// A new Distance instance. /// Thrown when the resulting magnitude would be negative. - public static Distance FromMile(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); + public static Distance FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); /// Implicit conversion to Length. public static implicit operator Length(Distance value) => Length.Create(value.Value); /// Explicit conversion from Length. 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 8c5cc03..d1c5aac 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 @@ -24,7 +24,7 @@ public record Drag : PhysicalQuantity, T>, IVector0, T> /// The value in Newton. /// A new Drag instance. /// Thrown when the resulting magnitude would be negative. - public static Drag FromNewton(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Drag FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// Implicit conversion to ForceMagnitude. public static implicit operator ForceMagnitude(Drag value) => ForceMagnitude.Create(value.Value); /// Explicit conversion from ForceMagnitude. 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 0171369..59cbbcc 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 @@ -23,49 +23,49 @@ public record Duration : PhysicalQuantity, T>, IVector0The value in Second. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Duration FromSecond(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Duration FromSeconds(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in Millisecond. /// /// The value in Millisecond. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Duration FromMillisecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Duration FromMilliseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new from a value in Microsecond. /// /// The value in Microsecond. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Duration FromMicrosecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Duration FromMicroseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new from a value in Minute. /// /// The value in Minute. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Duration FromMinute(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); + public static Duration FromMinutes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); /// /// Creates a new from a value in Hour. /// /// The value in Hour. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Duration FromHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); + public static Duration FromHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); /// /// Creates a new from a value in Day. /// /// The value in Day. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Duration FromDay(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); + public static Duration FromDays(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); /// /// Creates a new from a value in Year. /// /// The value in Year. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Duration FromYear(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); + public static Duration FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); /// /// Subtracts two Duration values, returning the absolute difference as a non-negative Duration. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 17d02a9..66cfa5c 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 @@ -23,7 +23,7 @@ public record DynamicViscosity : PhysicalQuantity, T>, IV /// The value in PascalSecond. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static DynamicViscosity FromPascalSecond(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static DynamicViscosity FromPascalSeconds(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in Poise. /// 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 b5be8b6..16238ac 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 @@ -24,7 +24,7 @@ public record EMF : PhysicalQuantity, T>, IVector0, T> /// The value in Volt. /// A new EMF instance. /// Thrown when the resulting magnitude would be negative. - public static EMF FromVolt(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static EMF FromVolts(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// Implicit conversion to VoltageMagnitude. public static implicit operator VoltageMagnitude(EMF value) => VoltageMagnitude.Create(value.Value); /// Explicit conversion from VoltageMagnitude. 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 a2765f6..21fea89 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 @@ -23,28 +23,28 @@ public record Energy : PhysicalQuantity, T>, IVector0, T> /// The value in Joule. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Energy FromJoule(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Energy FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in ElectronVolt. /// /// The value in ElectronVolt. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Energy FromElectronVolt(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); + public static Energy FromElectronVolts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); /// /// Creates a new from a value in Calorie. /// /// The value in Calorie. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Energy FromCalorie(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); + public static Energy FromCalories(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); /// /// Creates a new from a value in KilowattHour. /// /// The value in KilowattHour. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Energy FromKilowattHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); + public static Energy FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); /// /// Subtracts two Energy values, returning the absolute difference as a non-negative Energy. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 ff8d4b4..ccba6b2 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 @@ -24,7 +24,7 @@ public record EnzymeActivity : PhysicalQuantity, T>, IVecto /// The value in Katal. /// A new EnzymeActivity instance. /// Thrown when the resulting magnitude would be negative. - public static EnzymeActivity FromKatal(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static EnzymeActivity FromKatals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// Implicit conversion to CatalyticActivity. public static implicit operator CatalyticActivity(EnzymeActivity value) => CatalyticActivity.Create(value.Value); /// Explicit conversion from CatalyticActivity. 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 7375ff9..4d33e2d 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 @@ -23,7 +23,7 @@ public record EquivalentDose : PhysicalQuantity, T>, IVecto /// The value in Sievert. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static EquivalentDose FromSievert(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static EquivalentDose FromSieverts(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two EquivalentDose values, returning the absolute difference as a non-negative EquivalentDose. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 c2d1a3c..e2c316f 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 @@ -24,14 +24,14 @@ public record FieldOfView : PhysicalQuantity, T>, IVector0The value in Radian. /// A new FieldOfView instance. /// Thrown when the resulting magnitude would be negative. - public static FieldOfView FromRadian(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static FieldOfView FromRadians(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new FieldOfView from a value in Degree. /// /// The value in Degree. /// A new FieldOfView instance. /// Thrown when the resulting magnitude would be negative. - public static FieldOfView FromDegree(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); + public static FieldOfView FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); /// Implicit conversion to Angle. public static implicit operator Angle(FieldOfView value) => Angle.Create(value.Value); /// Explicit conversion from Angle. 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 76eaed4..67bbc1f 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 @@ -22,7 +22,7 @@ public record Force1D : PhysicalQuantity, T>, IVector1, /// /// The value in Newton. /// A new instance. - public static Force1D FromNewton(T value) => Create(value); + public static Force1D FromNewtons(T value) => Create(value); /// /// Gets the magnitude of this quantity as a . /// 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 a46a1d4..f9c5ba2 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 @@ -23,7 +23,7 @@ public record ForceMagnitude : PhysicalQuantity, T>, IVecto /// The value in Newton. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static ForceMagnitude FromNewton(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static ForceMagnitude FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two ForceMagnitude values, returning the absolute difference as a non-negative ForceMagnitude. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 364266d..81eb858 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 @@ -24,7 +24,7 @@ public record Friction : PhysicalQuantity, T>, IVector0The value in Newton. /// A new Friction instance. /// Thrown when the resulting magnitude would be negative. - public static Friction FromNewton(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Friction FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// Implicit conversion to ForceMagnitude. public static implicit operator ForceMagnitude(Friction value) => ForceMagnitude.Create(value.Value); /// Explicit conversion from ForceMagnitude. 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 139b8b8..ab09a1a 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 @@ -24,21 +24,21 @@ public record GaugePressure : PhysicalQuantity, T>, IVector0 /// The value in Pascal. /// A new GaugePressure instance. /// Thrown when the resulting magnitude would be negative. - public static GaugePressure FromPascal(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static GaugePressure FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new GaugePressure from a value in Bar. /// /// The value in Bar. /// A new GaugePressure instance. /// Thrown when the resulting magnitude would be negative. - public static GaugePressure FromBar(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); + public static GaugePressure FromBars(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); /// /// Creates a new GaugePressure from a value in Atmosphere. /// /// The value in Atmosphere. /// A new GaugePressure instance. /// Thrown when the resulting magnitude would be negative. - public static GaugePressure FromAtmosphere(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); + public static GaugePressure FromAtmospheres(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); /// /// Creates a new GaugePressure from a value in Psi. /// 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 73332f5..508f00c 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 @@ -24,49 +24,49 @@ public record HalfLife : PhysicalQuantity, T>, IVector0The value in Second. /// A new HalfLife instance. /// Thrown when the resulting magnitude would be negative. - public static HalfLife FromSecond(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static HalfLife FromSeconds(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new HalfLife from a value in Millisecond. /// /// The value in Millisecond. /// A new HalfLife instance. /// Thrown when the resulting magnitude would be negative. - public static HalfLife FromMillisecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static HalfLife FromMilliseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new HalfLife from a value in Microsecond. /// /// The value in Microsecond. /// A new HalfLife instance. /// Thrown when the resulting magnitude would be negative. - public static HalfLife FromMicrosecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static HalfLife FromMicroseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new HalfLife from a value in Minute. /// /// The value in Minute. /// A new HalfLife instance. /// Thrown when the resulting magnitude would be negative. - public static HalfLife FromMinute(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); + public static HalfLife FromMinutes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); /// /// Creates a new HalfLife from a value in Hour. /// /// The value in Hour. /// A new HalfLife instance. /// Thrown when the resulting magnitude would be negative. - public static HalfLife FromHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); + public static HalfLife FromHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); /// /// Creates a new HalfLife from a value in Day. /// /// The value in Day. /// A new HalfLife instance. /// Thrown when the resulting magnitude would be negative. - public static HalfLife FromDay(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); + public static HalfLife FromDays(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); /// /// Creates a new HalfLife from a value in Year. /// /// The value in Year. /// A new HalfLife instance. /// Thrown when the resulting magnitude would be negative. - public static HalfLife FromYear(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); + public static HalfLife FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); /// Implicit conversion to Duration. public static implicit operator Duration(HalfLife value) => Duration.Create(value.Value); /// Explicit conversion from Duration. 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 c0fbce2..7917a63 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 @@ -23,13 +23,13 @@ public record Heading : PhysicalQuantity, T>, IVector1, /// /// The value in Radian. /// A new Heading instance. - public static Heading FromRadian(T value) => Create(value); + public static Heading FromRadians(T value) => Create(value); /// /// Creates a new Heading from a value in Degree. /// /// The value in Degree. /// A new Heading instance. - public static Heading FromDegree(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); + public static Heading FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); /// Implicit conversion to SignedAngle. public static implicit operator SignedAngle(Heading value) => SignedAngle.Create(value.Value); /// Explicit conversion from SignedAngle. 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 45c4f46..ab48f0e 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 @@ -24,28 +24,28 @@ public record Heat : PhysicalQuantity, T>, IVector0, T> /// The value in Joule. /// A new Heat instance. /// Thrown when the resulting magnitude would be negative. - public static Heat FromJoule(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Heat FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Heat from a value in ElectronVolt. /// /// The value in ElectronVolt. /// A new Heat instance. /// Thrown when the resulting magnitude would be negative. - public static Heat FromElectronVolt(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); + public static Heat FromElectronVolts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); /// /// Creates a new Heat from a value in Calorie. /// /// The value in Calorie. /// A new Heat instance. /// Thrown when the resulting magnitude would be negative. - public static Heat FromCalorie(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); + 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 KilowattHour. /// /// The value in KilowattHour. /// A new Heat instance. /// Thrown when the resulting magnitude would be negative. - public static Heat FromKilowattHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); + public static Heat FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); /// Implicit conversion to Energy. public static implicit operator Energy(Heat value) => Energy.Create(value.Value); /// Explicit conversion from Energy. 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 b2390a9..0ae9a4c 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 @@ -24,7 +24,7 @@ public record HeatFlowRate : PhysicalQuantity, T>, IVector0The value in Watt. /// A new HeatFlowRate instance. /// Thrown when the resulting magnitude would be negative. - public static HeatFlowRate FromWatt(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static HeatFlowRate FromWatts(T value) => Create(Vector0Guards.EnsureNonNegative(value, 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 d09e775..aec6afa 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 @@ -24,77 +24,77 @@ public record Height : PhysicalQuantity, T>, IVector0, T> /// The value in Meter. /// A new Height instance. /// Thrown when the resulting magnitude would be negative. - public static Height FromMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Height FromMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Height from a value in Kilometer. /// /// The value in Kilometer. /// A new Height instance. /// Thrown when the resulting magnitude would be negative. - public static Height FromKilometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); + public static Height FromKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Height from a value in Centimeter. /// /// The value in Centimeter. /// A new Height instance. /// Thrown when the resulting magnitude would be negative. - public static Height FromCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); + public static Height FromCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); /// /// Creates a new Height from a value in Millimeter. /// /// The value in Millimeter. /// A new Height instance. /// Thrown when the resulting magnitude would be negative. - public static Height FromMillimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Height FromMillimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Height from a value in Micrometer. /// /// The value in Micrometer. /// A new Height instance. /// Thrown when the resulting magnitude would be negative. - public static Height FromMicrometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Height FromMicrometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Height from a value in Nanometer. /// /// The value in Nanometer. /// A new Height instance. /// Thrown when the resulting magnitude would be negative. - public static Height FromNanometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); + public static Height FromNanometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Creates a new Height from a value in Angstrom. /// /// The value in Angstrom. /// A new Height instance. /// Thrown when the resulting magnitude would be negative. - public static Height FromAngstrom(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); + public static Height FromAngstroms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); /// /// Creates a new Height from a value in Foot. /// /// The value in Foot. /// A new Height instance. /// Thrown when the resulting magnitude would be negative. - public static Height FromFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); + public static Height FromFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); /// /// Creates a new Height from a value in Inch. /// /// The value in Inch. /// A new Height instance. /// Thrown when the resulting magnitude would be negative. - public static Height FromInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); + public static Height FromInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); /// /// Creates a new Height from a value in Yard. /// /// The value in Yard. /// A new Height instance. /// Thrown when the resulting magnitude would be negative. - public static Height FromYard(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); + public static Height FromYards(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); /// /// Creates a new Height from a value in Mile. /// /// The value in Mile. /// A new Height instance. /// Thrown when the resulting magnitude would be negative. - public static Height FromMile(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); + public static Height FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); /// Implicit conversion to Length. public static implicit operator Length(Height value) => Length.Create(value.Value); /// Explicit conversion from Length. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Inductance.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Inductance.g.cs index 541b0f7..31f43d9 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Inductance.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Inductance.g.cs @@ -23,7 +23,7 @@ public record Inductance : PhysicalQuantity, T>, IVector0The value in Henry. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Inductance FromHenry(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Inductance FromHenries(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two Inductance values, returning the absolute difference as a non-negative Inductance. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 f50cc38..741b517 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 @@ -24,28 +24,28 @@ public record KineticEnergy : PhysicalQuantity, T>, IVector0 /// The value in Joule. /// A new KineticEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static KineticEnergy FromJoule(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static KineticEnergy FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new KineticEnergy from a value in ElectronVolt. /// /// The value in ElectronVolt. /// A new KineticEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static KineticEnergy FromElectronVolt(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); + public static KineticEnergy FromElectronVolts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); /// /// Creates a new KineticEnergy from a value in Calorie. /// /// The value in Calorie. /// A new KineticEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static KineticEnergy FromCalorie(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); + 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 KilowattHour. /// /// The value in KilowattHour. /// A new KineticEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static KineticEnergy FromKilowattHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); + public static KineticEnergy FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); /// Implicit conversion to Energy. public static implicit operator Energy(KineticEnergy value) => Energy.Create(value.Value); /// Explicit conversion from Energy. 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 3cd5a9e..c895b94 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 @@ -24,49 +24,49 @@ public record Latency : PhysicalQuantity, T>, IVector0, /// The value in Second. /// A new Latency instance. /// Thrown when the resulting magnitude would be negative. - public static Latency FromSecond(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Latency FromSeconds(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Latency from a value in Millisecond. /// /// The value in Millisecond. /// A new Latency instance. /// Thrown when the resulting magnitude would be negative. - public static Latency FromMillisecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Latency FromMilliseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Latency from a value in Microsecond. /// /// The value in Microsecond. /// A new Latency instance. /// Thrown when the resulting magnitude would be negative. - public static Latency FromMicrosecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Latency FromMicroseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Latency from a value in Minute. /// /// The value in Minute. /// A new Latency instance. /// Thrown when the resulting magnitude would be negative. - public static Latency FromMinute(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); + public static Latency FromMinutes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); /// /// Creates a new Latency from a value in Hour. /// /// The value in Hour. /// A new Latency instance. /// Thrown when the resulting magnitude would be negative. - public static Latency FromHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); + public static Latency FromHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); /// /// Creates a new Latency from a value in Day. /// /// The value in Day. /// A new Latency instance. /// Thrown when the resulting magnitude would be negative. - public static Latency FromDay(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); + public static Latency FromDays(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); /// /// Creates a new Latency from a value in Year. /// /// The value in Year. /// A new Latency instance. /// Thrown when the resulting magnitude would be negative. - public static Latency FromYear(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); + public static Latency FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); /// Implicit conversion to Duration. public static implicit operator Duration(Latency value) => Duration.Create(value.Value); /// Explicit conversion from Duration. 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 90ab186..501e71a 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 @@ -23,77 +23,77 @@ public record Length : PhysicalQuantity, T>, IVector0, T> /// The value in Meter. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Length FromMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Length FromMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in Kilometer. /// /// The value in Kilometer. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Length FromKilometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); + public static Length FromKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new from a value in Centimeter. /// /// The value in Centimeter. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Length FromCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); + public static Length FromCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); /// /// Creates a new from a value in Millimeter. /// /// The value in Millimeter. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Length FromMillimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Length FromMillimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new from a value in Micrometer. /// /// The value in Micrometer. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Length FromMicrometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Length FromMicrometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new from a value in Nanometer. /// /// The value in Nanometer. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Length FromNanometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); + public static Length FromNanometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Creates a new from a value in Angstrom. /// /// The value in Angstrom. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Length FromAngstrom(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); + public static Length FromAngstroms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); /// /// Creates a new from a value in Foot. /// /// The value in Foot. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Length FromFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); + public static Length FromFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); /// /// Creates a new from a value in Inch. /// /// The value in Inch. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Length FromInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); + public static Length FromInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); /// /// Creates a new from a value in Yard. /// /// The value in Yard. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Length FromYard(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); + public static Length FromYards(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); /// /// Creates a new from a value in Mile. /// /// The value in Mile. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Length FromMile(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); + public static Length FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); /// /// Subtracts two Length values, returning the absolute difference as a non-negative Length. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 1182668..2009c01 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 @@ -24,7 +24,7 @@ public record Lift : PhysicalQuantity, T>, IVector0, T> /// The value in Newton. /// A new Lift instance. /// Thrown when the resulting magnitude would be negative. - public static Lift FromNewton(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Lift FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// Implicit conversion to ForceMagnitude. public static implicit operator ForceMagnitude(Lift value) => ForceMagnitude.Create(value.Value); /// Explicit conversion from ForceMagnitude. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/LuminousFlux.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/LuminousFlux.g.cs index 07fd68e..6d95f4c 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/LuminousFlux.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/LuminousFlux.g.cs @@ -23,7 +23,7 @@ public record LuminousFlux : PhysicalQuantity, T>, IVector0The value in Lumen. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static LuminousFlux FromLumen(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static LuminousFlux FromLumens(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two LuminousFlux values, returning the absolute difference as a non-negative LuminousFlux. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 e093a3a..9b05c6c 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 @@ -23,7 +23,7 @@ public record LuminousIntensity : PhysicalQuantity, T>, /// The value in Candela. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static LuminousIntensity FromCandela(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static LuminousIntensity FromCandelas(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two LuminousIntensity values, returning the absolute difference as a non-negative LuminousIntensity. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 a74aa87..91c349e 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 @@ -31,14 +31,14 @@ public record MachNumber : PhysicalQuantity, T>, IVector0The value in Radian. /// A new MachNumber instance. /// Thrown when the resulting magnitude would be negative. - public static MachNumber FromRadian(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static MachNumber FromRadians(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new MachNumber from a value in Degree. /// /// The value in Degree. /// A new MachNumber instance. /// Thrown when the resulting magnitude would be negative. - public static MachNumber FromDegree(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); + public static MachNumber FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); /// Implicit conversion to Ratio. public static implicit operator Ratio(MachNumber value) => Ratio.Create(value.Value); /// Explicit conversion from Ratio. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MagneticFlux.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MagneticFlux.g.cs index 32a30c9..4643b96 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MagneticFlux.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MagneticFlux.g.cs @@ -23,7 +23,7 @@ public record MagneticFlux : PhysicalQuantity, T>, IVector0The value in Weber. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static MagneticFlux FromWeber(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static MagneticFlux FromWebers(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two MagneticFlux values, returning the absolute difference as a non-negative MagneticFlux. /// Magnitude subtraction stays a magnitude (per the unified-vector model). diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MagneticFluxDensityMagnitude.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MagneticFluxDensityMagnitude.g.cs index 3585c44..4c52225 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MagneticFluxDensityMagnitude.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MagneticFluxDensityMagnitude.g.cs @@ -23,7 +23,7 @@ public record MagneticFluxDensityMagnitude : PhysicalQuantityThe value in Tesla. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static MagneticFluxDensityMagnitude FromTesla(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static MagneticFluxDensityMagnitude FromTeslas(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in Gauss. /// 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 f750b8e..b7db814 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 @@ -23,35 +23,35 @@ public record Mass : PhysicalQuantity, T>, IVector0, T> /// The value in Kilogram. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Mass FromKilogram(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Mass FromKilograms(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in Gram. /// /// The value in Gram. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Mass FromGram(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Mass FromGrams(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new from a value in Ton. /// /// The value in Ton. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Mass FromTon(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.TonToKilograms)), nameof(value))); + public static Mass FromTons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.TonToKilograms)), nameof(value))); /// /// Creates a new from a value in Pound. /// /// The value in Pound. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Mass FromPound(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundToKilograms)), nameof(value))); + public static Mass FromPounds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundToKilograms)), nameof(value))); /// /// Creates a new from a value in Ounce. /// /// The value in Ounce. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Mass FromOunce(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.OunceToKilograms)), nameof(value))); + public static Mass FromOunces(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.OunceToKilograms)), nameof(value))); /// /// Subtracts two Mass values, returning the absolute difference as a non-negative Mass. /// Magnitude subtraction stays a magnitude (per the unified-vector model). diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Momentum1D.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Momentum1D.g.cs index e866ea1..3e9d4e5 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Momentum1D.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Momentum1D.g.cs @@ -22,7 +22,7 @@ public record Momentum1D : PhysicalQuantity, T>, IVector1 /// The value in NewtonSecond. /// A new instance. - public static Momentum1D FromNewtonSecond(T value) => Create(value); + public static Momentum1D FromNewtonSeconds(T value) => Create(value); /// /// Gets the magnitude of this quantity as a . /// diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MomentumMagnitude.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MomentumMagnitude.g.cs index 7ccd5de..5ff4d39 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MomentumMagnitude.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/MomentumMagnitude.g.cs @@ -23,7 +23,7 @@ public record MomentumMagnitude : PhysicalQuantity, T>, /// The value in NewtonSecond. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static MomentumMagnitude FromNewtonSecond(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static MomentumMagnitude FromNewtonSeconds(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two MomentumMagnitude values, returning the absolute difference as a non-negative MomentumMagnitude. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 24c9c17..718cd79 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 @@ -24,7 +24,7 @@ public record NormalForce : PhysicalQuantity, T>, IVector0The value in Newton. /// A new NormalForce instance. /// Thrown when the resulting magnitude would be negative. - public static NormalForce FromNewton(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static NormalForce FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// Implicit conversion to ForceMagnitude. public static implicit operator ForceMagnitude(NormalForce value) => ForceMagnitude.Create(value.Value); /// Explicit conversion from ForceMagnitude. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/NuclearCrossSection.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/NuclearCrossSection.g.cs index 875e493..fad4ff3 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/NuclearCrossSection.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/NuclearCrossSection.g.cs @@ -23,7 +23,7 @@ public record NuclearCrossSection : PhysicalQuantity, /// The value in Barn. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static NuclearCrossSection FromBarn(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static NuclearCrossSection FromBarns(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two NuclearCrossSection values, returning the absolute difference as a non-negative NuclearCrossSection. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 03bd9fd..04e5348 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 @@ -23,67 +23,67 @@ public record Offset : PhysicalQuantity, T>, IVector1, T> /// /// The value in Meter. /// A new Offset instance. - public static Offset FromMeter(T value) => Create(value); + public static Offset FromMeters(T value) => Create(value); /// /// Creates a new Offset from a value in Kilometer. /// /// The value in Kilometer. /// A new Offset instance. - public static Offset FromKilometer(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Kilo))); + public static Offset FromKilometers(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Kilo))); /// /// Creates a new Offset from a value in Centimeter. /// /// The value in Centimeter. /// A new Offset instance. - public static Offset FromCentimeter(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Centi))); + public static Offset FromCentimeters(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Centi))); /// /// Creates a new Offset from a value in Millimeter. /// /// The value in Millimeter. /// A new Offset instance. - public static Offset FromMillimeter(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Milli))); + public static Offset FromMillimeters(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Milli))); /// /// Creates a new Offset from a value in Micrometer. /// /// The value in Micrometer. /// A new Offset instance. - public static Offset FromMicrometer(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Micro))); + public static Offset FromMicrometers(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Micro))); /// /// Creates a new Offset from a value in Nanometer. /// /// The value in Nanometer. /// A new Offset instance. - public static Offset FromNanometer(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Nano))); + public static Offset FromNanometers(T value) => Create((value * T.CreateChecked(MetricMagnitudes.Nano))); /// /// Creates a new Offset from a value in Angstrom. /// /// The value in Angstrom. /// A new Offset instance. - public static Offset FromAngstrom(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters))); + public static Offset FromAngstroms(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters))); /// /// Creates a new Offset from a value in Foot. /// /// The value in Foot. /// A new Offset instance. - public static Offset FromFoot(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters))); + public static Offset FromFeet(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters))); /// /// Creates a new Offset from a value in Inch. /// /// The value in Inch. /// A new Offset instance. - public static Offset FromInch(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters))); + public static Offset FromInches(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters))); /// /// Creates a new Offset from a value in Yard. /// /// The value in Yard. /// A new Offset instance. - public static Offset FromYard(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.YardToMeters))); + public static Offset FromYards(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.YardToMeters))); /// /// Creates a new Offset from a value in Mile. /// /// The value in Mile. /// A new Offset instance. - public static Offset FromMile(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.MileToMeters))); + public static Offset FromMiles(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.MileToMeters))); /// Implicit conversion to Displacement1D. public static implicit operator Displacement1D(Offset value) => Displacement1D.Create(value.Value); /// Explicit conversion from Displacement1D. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/OpticalPower.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/OpticalPower.g.cs index 9b25a8d..4daf8ff 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/OpticalPower.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/OpticalPower.g.cs @@ -23,7 +23,7 @@ public record OpticalPower : PhysicalQuantity, T>, IVector0The value in Diopter. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static OpticalPower FromDiopter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static OpticalPower FromDiopters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two OpticalPower values, returning the absolute difference as a non-negative OpticalPower. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 0adc8ab..9b55e76 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 @@ -24,77 +24,77 @@ public record Perimeter : PhysicalQuantity, T>, IVector0The value in Meter. /// A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. - public static Perimeter FromMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Perimeter FromMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Perimeter from a value in Kilometer. /// /// The value in Kilometer. /// A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. - public static Perimeter FromKilometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); + public static Perimeter FromKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Perimeter from a value in Centimeter. /// /// The value in Centimeter. /// A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. - public static Perimeter FromCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); + public static Perimeter FromCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); /// /// Creates a new Perimeter from a value in Millimeter. /// /// The value in Millimeter. /// A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. - public static Perimeter FromMillimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Perimeter FromMillimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Perimeter from a value in Micrometer. /// /// The value in Micrometer. /// A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. - public static Perimeter FromMicrometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Perimeter FromMicrometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Perimeter from a value in Nanometer. /// /// The value in Nanometer. /// A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. - public static Perimeter FromNanometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); + public static Perimeter FromNanometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Creates a new Perimeter from a value in Angstrom. /// /// The value in Angstrom. /// A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. - public static Perimeter FromAngstrom(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); + public static Perimeter FromAngstroms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); /// /// Creates a new Perimeter from a value in Foot. /// /// The value in Foot. /// A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. - public static Perimeter FromFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); + public static Perimeter FromFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); /// /// Creates a new Perimeter from a value in Inch. /// /// The value in Inch. /// A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. - public static Perimeter FromInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); + public static Perimeter FromInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); /// /// Creates a new Perimeter from a value in Yard. /// /// The value in Yard. /// A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. - public static Perimeter FromYard(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); + public static Perimeter FromYards(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); /// /// Creates a new Perimeter from a value in Mile. /// /// The value in Mile. /// A new Perimeter instance. /// Thrown when the resulting magnitude would be negative. - public static Perimeter FromMile(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); + public static Perimeter FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); /// Implicit conversion to Length. public static implicit operator Length(Perimeter value) => Length.Create(value.Value); /// Explicit conversion from Length. 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 c3bb2d8..601bf0e 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 @@ -24,49 +24,49 @@ public record Period : PhysicalQuantity, T>, IVector0, T> /// The value in Second. /// A new Period instance. /// Thrown when the resulting magnitude would be negative. - public static Period FromSecond(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Period FromSeconds(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Period from a value in Millisecond. /// /// The value in Millisecond. /// A new Period instance. /// Thrown when the resulting magnitude would be negative. - public static Period FromMillisecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Period FromMilliseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Period from a value in Microsecond. /// /// The value in Microsecond. /// A new Period instance. /// Thrown when the resulting magnitude would be negative. - public static Period FromMicrosecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Period FromMicroseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Period from a value in Minute. /// /// The value in Minute. /// A new Period instance. /// Thrown when the resulting magnitude would be negative. - public static Period FromMinute(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); + public static Period FromMinutes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); /// /// Creates a new Period from a value in Hour. /// /// The value in Hour. /// A new Period instance. /// Thrown when the resulting magnitude would be negative. - public static Period FromHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); + public static Period FromHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); /// /// Creates a new Period from a value in Day. /// /// The value in Day. /// A new Period instance. /// Thrown when the resulting magnitude would be negative. - public static Period FromDay(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); + public static Period FromDays(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); /// /// Creates a new Period from a value in Year. /// /// The value in Year. /// A new Period instance. /// Thrown when the resulting magnitude would be negative. - public static Period FromYear(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); + public static Period FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); /// Implicit conversion to Duration. public static implicit operator Duration(Period value) => Duration.Create(value.Value); /// Explicit conversion from Duration. 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 1e85175..2947e62 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 @@ -23,13 +23,13 @@ public record Phase : PhysicalQuantity, T>, IVector1, T> /// /// The value in Radian. /// A new Phase instance. - public static Phase FromRadian(T value) => Create(value); + public static Phase FromRadians(T value) => Create(value); /// /// Creates a new Phase from a value in Degree. /// /// The value in Degree. /// A new Phase instance. - public static Phase FromDegree(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); + public static Phase FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); /// Implicit conversion to SignedAngle. public static implicit operator SignedAngle(Phase value) => SignedAngle.Create(value.Value); /// Explicit conversion from SignedAngle. 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 473d6e4..2b8b3f2 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 @@ -24,28 +24,28 @@ public record PotentialEnergy : PhysicalQuantity, T>, IVec /// The value in Joule. /// A new PotentialEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static PotentialEnergy FromJoule(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static PotentialEnergy FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new PotentialEnergy from a value in ElectronVolt. /// /// The value in ElectronVolt. /// A new PotentialEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static PotentialEnergy FromElectronVolt(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); + public static PotentialEnergy FromElectronVolts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); /// /// Creates a new PotentialEnergy from a value in Calorie. /// /// The value in Calorie. /// A new PotentialEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static PotentialEnergy FromCalorie(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); + 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 KilowattHour. /// /// The value in KilowattHour. /// A new PotentialEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static PotentialEnergy FromKilowattHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); + public static PotentialEnergy FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); /// Implicit conversion to Energy. public static implicit operator Energy(PotentialEnergy value) => Energy.Create(value.Value); /// Explicit conversion from Energy. 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 bec8741..2b03d11 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 @@ -23,7 +23,7 @@ public record Power : PhysicalQuantity, T>, IVector0, T> /// The value in Watt. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Power FromWatt(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Power FromWatts(T value) => Create(Vector0Guards.EnsureNonNegative(value, 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 6b184a4..5b8b848 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 @@ -23,21 +23,21 @@ public record Pressure : PhysicalQuantity, T>, IVector0The value in Pascal. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Pressure FromPascal(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Pressure FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in Bar. /// /// The value in Bar. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Pressure FromBar(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); + public static Pressure FromBars(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); /// /// Creates a new from a value in Atmosphere. /// /// The value in Atmosphere. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Pressure FromAtmosphere(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); + public static Pressure FromAtmospheres(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); /// /// Creates a new from a value in Psi. /// 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 fe5d715..dc355b4 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 @@ -23,7 +23,7 @@ public record RadioactiveActivity : PhysicalQuantity, /// The value in Becquerel. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static RadioactiveActivity FromBecquerel(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static RadioactiveActivity FromBecquerels(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two RadioactiveActivity values, returning the absolute difference as a non-negative RadioactiveActivity. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 76feccf..950b537 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 @@ -24,77 +24,77 @@ public record Radius : PhysicalQuantity, T>, IVector0, T> /// The value in Meter. /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. - public static Radius FromMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Radius FromMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Radius from a value in Kilometer. /// /// The value in Kilometer. /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. - public static Radius FromKilometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); + public static Radius FromKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Radius from a value in Centimeter. /// /// The value in Centimeter. /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. - public static Radius FromCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); + public static Radius FromCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); /// /// Creates a new Radius from a value in Millimeter. /// /// The value in Millimeter. /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. - public static Radius FromMillimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Radius FromMillimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Radius from a value in Micrometer. /// /// The value in Micrometer. /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. - public static Radius FromMicrometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Radius FromMicrometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Radius from a value in Nanometer. /// /// The value in Nanometer. /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. - public static Radius FromNanometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); + public static Radius FromNanometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Creates a new Radius from a value in Angstrom. /// /// The value in Angstrom. /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. - public static Radius FromAngstrom(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); + public static Radius FromAngstroms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); /// /// Creates a new Radius from a value in Foot. /// /// The value in Foot. /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. - public static Radius FromFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); + public static Radius FromFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); /// /// Creates a new Radius from a value in Inch. /// /// The value in Inch. /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. - public static Radius FromInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); + public static Radius FromInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); /// /// Creates a new Radius from a value in Yard. /// /// The value in Yard. /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. - public static Radius FromYard(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); + public static Radius FromYards(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); /// /// Creates a new Radius from a value in Mile. /// /// The value in Mile. /// A new Radius instance. /// Thrown when the resulting magnitude would be negative. - public static Radius FromMile(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); + public static Radius FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); /// Implicit conversion to Length. public static implicit operator Length(Radius value) => Length.Create(value.Value); /// Explicit conversion from Length. 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 44f6886..80ca235 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 @@ -30,14 +30,14 @@ public record Ratio : PhysicalQuantity, T>, IVector0, T> /// The value in Radian. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Ratio FromRadian(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Ratio FromRadians(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in Degree. /// /// The value in Degree. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Ratio FromDegree(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); + public static Ratio FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); /// /// Subtracts two Ratio values, returning the absolute difference as a non-negative Ratio. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 db93620..7b86bc9 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 @@ -31,14 +31,14 @@ public record RefractiveIndex : PhysicalQuantity, T>, IVec /// The value in Radian. /// A new RefractiveIndex instance. /// Thrown when the resulting magnitude would be negative. - public static RefractiveIndex FromRadian(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static RefractiveIndex FromRadians(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new RefractiveIndex from a value in Degree. /// /// The value in Degree. /// A new RefractiveIndex instance. /// Thrown when the resulting magnitude would be negative. - public static RefractiveIndex FromDegree(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); + public static RefractiveIndex FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); /// Implicit conversion to Ratio. public static implicit operator Ratio(RefractiveIndex value) => Ratio.Create(value.Value); /// Explicit conversion from Ratio. 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 bf8bd68..482d8e5 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 @@ -23,7 +23,7 @@ public record Resistance : PhysicalQuantity, T>, IVector0The value in Ohm. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Resistance FromOhm(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Resistance FromOhms(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two Resistance values, returning the absolute difference as a non-negative Resistance. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 056918b..00d2ce5 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 @@ -24,49 +24,49 @@ public record ReverberationTime : PhysicalQuantity, T>, /// The value in Second. /// A new ReverberationTime instance. /// Thrown when the resulting magnitude would be negative. - public static ReverberationTime FromSecond(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static ReverberationTime FromSeconds(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new ReverberationTime from a value in Millisecond. /// /// The value in Millisecond. /// A new ReverberationTime instance. /// Thrown when the resulting magnitude would be negative. - public static ReverberationTime FromMillisecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static ReverberationTime FromMilliseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new ReverberationTime from a value in Microsecond. /// /// The value in Microsecond. /// A new ReverberationTime instance. /// Thrown when the resulting magnitude would be negative. - public static ReverberationTime FromMicrosecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static ReverberationTime FromMicroseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new ReverberationTime from a value in Minute. /// /// The value in Minute. /// A new ReverberationTime instance. /// Thrown when the resulting magnitude would be negative. - public static ReverberationTime FromMinute(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); + public static ReverberationTime FromMinutes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); /// /// Creates a new ReverberationTime from a value in Hour. /// /// The value in Hour. /// A new ReverberationTime instance. /// Thrown when the resulting magnitude would be negative. - public static ReverberationTime FromHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); + public static ReverberationTime FromHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); /// /// Creates a new ReverberationTime from a value in Day. /// /// The value in Day. /// A new ReverberationTime instance. /// Thrown when the resulting magnitude would be negative. - public static ReverberationTime FromDay(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); + public static ReverberationTime FromDays(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); /// /// Creates a new ReverberationTime from a value in Year. /// /// The value in Year. /// A new ReverberationTime instance. /// Thrown when the resulting magnitude would be negative. - public static ReverberationTime FromYear(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); + public static ReverberationTime FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); /// Implicit conversion to Duration. public static implicit operator Duration(ReverberationTime value) => Duration.Create(value.Value); /// Explicit conversion from Duration. 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 b878b98..2f7c33a 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 @@ -31,14 +31,14 @@ public record ReynoldsNumber : PhysicalQuantity, T>, IVecto /// The value in Radian. /// A new ReynoldsNumber instance. /// Thrown when the resulting magnitude would be negative. - public static ReynoldsNumber FromRadian(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static ReynoldsNumber FromRadians(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new ReynoldsNumber from a value in Degree. /// /// The value in Degree. /// A new ReynoldsNumber instance. /// Thrown when the resulting magnitude would be negative. - public static ReynoldsNumber FromDegree(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); + public static ReynoldsNumber FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); /// Implicit conversion to Ratio. public static implicit operator Ratio(ReynoldsNumber value) => Ratio.Create(value.Value); /// Explicit conversion from Ratio. 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 cacec42..f985541 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 @@ -23,13 +23,13 @@ public record Rotation : PhysicalQuantity, T>, IVector1 /// The value in Radian. /// A new Rotation instance. - public static Rotation FromRadian(T value) => Create(value); + public static Rotation FromRadians(T value) => Create(value); /// /// Creates a new Rotation from a value in Degree. /// /// The value in Degree. /// A new Rotation instance. - public static Rotation FromDegree(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); + public static Rotation FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); /// Implicit conversion to SignedAngle. public static implicit operator SignedAngle(Rotation value) => SignedAngle.Create(value.Value); /// Explicit conversion from SignedAngle. 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 f6a362f..503f5de 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 @@ -24,21 +24,21 @@ public record ShearModulus : PhysicalQuantity, T>, IVector0The value in Pascal. /// A new ShearModulus instance. /// Thrown when the resulting magnitude would be negative. - public static ShearModulus FromPascal(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static ShearModulus FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new ShearModulus from a value in Bar. /// /// The value in Bar. /// A new ShearModulus instance. /// Thrown when the resulting magnitude would be negative. - public static ShearModulus FromBar(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); + public static ShearModulus FromBars(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); /// /// Creates a new ShearModulus from a value in Atmosphere. /// /// The value in Atmosphere. /// A new ShearModulus instance. /// Thrown when the resulting magnitude would be negative. - public static ShearModulus FromAtmosphere(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); + public static ShearModulus FromAtmospheres(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); /// /// Creates a new ShearModulus from a value in Psi. /// 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 e9d7e80..57acbac 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 @@ -22,13 +22,13 @@ public record SignedAngle : PhysicalQuantity, T>, IVector1 /// The value in Radian. /// A new instance. - public static SignedAngle FromRadian(T value) => Create(value); + public static SignedAngle FromRadians(T value) => Create(value); /// /// Creates a new from a value in Degree. /// /// The value in Degree. /// A new instance. - public static SignedAngle FromDegree(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); + public static SignedAngle FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); /// /// Gets the magnitude of this quantity as a . /// 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 7e915f2..71fe246 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 @@ -28,13 +28,13 @@ public record SignedRatio : PhysicalQuantity, T>, IVector1 /// The value in Radian. /// A new instance. - public static SignedRatio FromRadian(T value) => Create(value); + public static SignedRatio FromRadians(T value) => Create(value); /// /// Creates a new from a value in Degree. /// /// The value in Degree. /// A new instance. - public static SignedRatio FromDegree(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); + public static SignedRatio FromDegrees(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians))); /// /// Gets the magnitude of this quantity as a . /// 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 d9b70c7..107ef03 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 @@ -31,14 +31,14 @@ public record SpecificGravity : PhysicalQuantity, T>, IVec /// The value in Radian. /// A new SpecificGravity instance. /// Thrown when the resulting magnitude would be negative. - public static SpecificGravity FromRadian(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static SpecificGravity FromRadians(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new SpecificGravity from a value in Degree. /// /// The value in Degree. /// A new SpecificGravity instance. /// Thrown when the resulting magnitude would be negative. - public static SpecificGravity FromDegree(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); + public static SpecificGravity FromDegrees(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DegreeToRadians)), nameof(value))); /// Implicit conversion to Ratio. public static implicit operator Ratio(SpecificGravity value) => Ratio.Create(value.Value); /// Explicit conversion from Ratio. 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 452abc6..b1c3552 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 @@ -24,21 +24,21 @@ public record Stress : PhysicalQuantity, T>, IVector0, T> /// The value in Pascal. /// A new Stress instance. /// Thrown when the resulting magnitude would be negative. - public static Stress FromPascal(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Stress FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Stress from a value in Bar. /// /// The value in Bar. /// A new Stress instance. /// Thrown when the resulting magnitude would be negative. - public static Stress FromBar(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); + public static Stress FromBars(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); /// /// Creates a new Stress from a value in Atmosphere. /// /// The value in Atmosphere. /// A new Stress instance. /// Thrown when the resulting magnitude would be negative. - public static Stress FromAtmosphere(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); + public static Stress FromAtmospheres(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); /// /// Creates a new Stress from a value in Psi. /// 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 d9b69d4..5038ded 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 @@ -24,21 +24,21 @@ public record SurfaceArea : PhysicalQuantity, T>, IVector0The value in SquareMeter. /// A new SurfaceArea instance. /// Thrown when the resulting magnitude would be negative. - public static SurfaceArea FromSquareMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static SurfaceArea FromSquareMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new SurfaceArea from a value in SquareFoot. /// /// The value in SquareFoot. /// A new SurfaceArea instance. /// Thrown when the resulting magnitude would be negative. - public static SurfaceArea FromSquareFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareFootToSquareMeters)), nameof(value))); + public static SurfaceArea FromSquareFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareFootToSquareMeters)), nameof(value))); /// /// Creates a new SurfaceArea from a value in SquareInch. /// /// The value in SquareInch. /// A new SurfaceArea instance. /// Thrown when the resulting magnitude would be negative. - public static SurfaceArea FromSquareInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareInchToSquareMeters)), nameof(value))); + public static SurfaceArea FromSquareInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.SquareInchToSquareMeters)), nameof(value))); /// Implicit conversion to Area. public static implicit operator Area(SurfaceArea value) => Area.Create(value.Value); /// Explicit conversion from Area. 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 9dca398..8af9d38 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 @@ -23,7 +23,7 @@ public record Temperature : PhysicalQuantity, T>, IVector0The value in Kelvin. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Temperature FromKelvin(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Temperature FromKelvins(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in Celsius. /// 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 a76485d..9f7707b 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 @@ -22,7 +22,7 @@ public record TemperatureDelta : PhysicalQuantity, T>, IV /// /// The value in Kelvin. /// A new instance. - public static TemperatureDelta FromKelvin(T value) => Create(value); + public static TemperatureDelta FromKelvins(T value) => Create(value); /// /// Creates a new from a value in Celsius. /// 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 2337ef3..1f24aeb 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 @@ -23,7 +23,7 @@ public record TemperatureDrop : PhysicalQuantity, T>, IVec /// /// The value in Kelvin. /// A new TemperatureDrop instance. - public static TemperatureDrop FromKelvin(T value) => Create(value); + public static TemperatureDrop FromKelvins(T value) => Create(value); /// /// Creates a new TemperatureDrop from a value in Celsius. /// 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 4d75cdc..431d2a1 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 @@ -23,7 +23,7 @@ public record TemperatureRise : PhysicalQuantity, T>, IVec /// /// The value in Kelvin. /// A new TemperatureRise instance. - public static TemperatureRise FromKelvin(T value) => Create(value); + public static TemperatureRise FromKelvins(T value) => Create(value); /// /// Creates a new TemperatureRise from a value in Celsius. /// 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 1c51816..3824faa 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 @@ -24,7 +24,7 @@ public record Tension : PhysicalQuantity, T>, IVector0, /// The value in Newton. /// A new Tension instance. /// Thrown when the resulting magnitude would be negative. - public static Tension FromNewton(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Tension FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// Implicit conversion to ForceMagnitude. public static implicit operator ForceMagnitude(Tension value) => ForceMagnitude.Create(value.Value); /// Explicit conversion from ForceMagnitude. 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 d49084b..78d32ab 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 @@ -24,28 +24,28 @@ public record ThermalEnergy : PhysicalQuantity, T>, IVector0 /// The value in Joule. /// A new ThermalEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static ThermalEnergy FromJoule(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static ThermalEnergy FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new ThermalEnergy from a value in ElectronVolt. /// /// The value in ElectronVolt. /// A new ThermalEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static ThermalEnergy FromElectronVolt(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); + public static ThermalEnergy FromElectronVolts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); /// /// Creates a new ThermalEnergy from a value in Calorie. /// /// The value in Calorie. /// A new ThermalEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static ThermalEnergy FromCalorie(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); + 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 KilowattHour. /// /// The value in KilowattHour. /// A new ThermalEnergy instance. /// Thrown when the resulting magnitude would be negative. - public static ThermalEnergy FromKilowattHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); + public static ThermalEnergy FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); /// Implicit conversion to Energy. public static implicit operator Energy(ThermalEnergy value) => Energy.Create(value.Value); /// Explicit conversion from Energy. 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 10c90e8..d29ea25 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 @@ -24,77 +24,77 @@ public record Thickness : PhysicalQuantity, T>, IVector0The value in Meter. /// A new Thickness instance. /// Thrown when the resulting magnitude would be negative. - public static Thickness FromMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Thickness FromMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Thickness from a value in Kilometer. /// /// The value in Kilometer. /// A new Thickness instance. /// Thrown when the resulting magnitude would be negative. - public static Thickness FromKilometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); + public static Thickness FromKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Thickness from a value in Centimeter. /// /// The value in Centimeter. /// A new Thickness instance. /// Thrown when the resulting magnitude would be negative. - public static Thickness FromCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); + public static Thickness FromCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); /// /// Creates a new Thickness from a value in Millimeter. /// /// The value in Millimeter. /// A new Thickness instance. /// Thrown when the resulting magnitude would be negative. - public static Thickness FromMillimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Thickness FromMillimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Thickness from a value in Micrometer. /// /// The value in Micrometer. /// A new Thickness instance. /// Thrown when the resulting magnitude would be negative. - public static Thickness FromMicrometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Thickness FromMicrometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Thickness from a value in Nanometer. /// /// The value in Nanometer. /// A new Thickness instance. /// Thrown when the resulting magnitude would be negative. - public static Thickness FromNanometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); + public static Thickness FromNanometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Creates a new Thickness from a value in Angstrom. /// /// The value in Angstrom. /// A new Thickness instance. /// Thrown when the resulting magnitude would be negative. - public static Thickness FromAngstrom(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); + public static Thickness FromAngstroms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); /// /// Creates a new Thickness from a value in Foot. /// /// The value in Foot. /// A new Thickness instance. /// Thrown when the resulting magnitude would be negative. - public static Thickness FromFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); + public static Thickness FromFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); /// /// Creates a new Thickness from a value in Inch. /// /// The value in Inch. /// A new Thickness instance. /// Thrown when the resulting magnitude would be negative. - public static Thickness FromInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); + public static Thickness FromInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); /// /// Creates a new Thickness from a value in Yard. /// /// The value in Yard. /// A new Thickness instance. /// Thrown when the resulting magnitude would be negative. - public static Thickness FromYard(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); + public static Thickness FromYards(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); /// /// Creates a new Thickness from a value in Mile. /// /// The value in Mile. /// A new Thickness instance. /// Thrown when the resulting magnitude would be negative. - public static Thickness FromMile(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); + public static Thickness FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); /// Implicit conversion to Length. public static implicit operator Length(Thickness value) => Length.Create(value.Value); /// Explicit conversion from Length. 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 e6757c7..ca85037 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 @@ -24,7 +24,7 @@ public record Thrust : PhysicalQuantity, T>, IVector0, T> /// The value in Newton. /// A new Thrust instance. /// Thrown when the resulting magnitude would be negative. - public static Thrust FromNewton(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Thrust FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// Implicit conversion to ForceMagnitude. public static implicit operator ForceMagnitude(Thrust value) => ForceMagnitude.Create(value.Value); /// Explicit conversion from ForceMagnitude. 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 2a1e058..f9421b3 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 @@ -24,49 +24,49 @@ public record TimeConstant : PhysicalQuantity, T>, IVector0The value in Second. /// A new TimeConstant instance. /// Thrown when the resulting magnitude would be negative. - public static TimeConstant FromSecond(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static TimeConstant FromSeconds(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new TimeConstant from a value in Millisecond. /// /// The value in Millisecond. /// A new TimeConstant instance. /// Thrown when the resulting magnitude would be negative. - public static TimeConstant FromMillisecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static TimeConstant FromMilliseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new TimeConstant from a value in Microsecond. /// /// The value in Microsecond. /// A new TimeConstant instance. /// Thrown when the resulting magnitude would be negative. - public static TimeConstant FromMicrosecond(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static TimeConstant FromMicroseconds(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new TimeConstant from a value in Minute. /// /// The value in Minute. /// A new TimeConstant instance. /// Thrown when the resulting magnitude would be negative. - public static TimeConstant FromMinute(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); + public static TimeConstant FromMinutes(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MinuteToSeconds)), nameof(value))); /// /// Creates a new TimeConstant from a value in Hour. /// /// The value in Hour. /// A new TimeConstant instance. /// Thrown when the resulting magnitude would be negative. - public static TimeConstant FromHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); + public static TimeConstant FromHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.HourToSeconds)), nameof(value))); /// /// Creates a new TimeConstant from a value in Day. /// /// The value in Day. /// A new TimeConstant instance. /// Thrown when the resulting magnitude would be negative. - public static TimeConstant FromDay(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); + public static TimeConstant FromDays(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.DayToSeconds)), nameof(value))); /// /// Creates a new TimeConstant from a value in Year. /// /// The value in Year. /// A new TimeConstant instance. /// Thrown when the resulting magnitude would be negative. - public static TimeConstant FromYear(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); + public static TimeConstant FromYears(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YearToSeconds)), nameof(value))); /// Implicit conversion to Duration. public static implicit operator Duration(TimeConstant value) => Duration.Create(value.Value); /// Explicit conversion from Duration. diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Torque1D.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Torque1D.g.cs index 5d5c6bb..c94fc55 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Torque1D.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/Torque1D.g.cs @@ -22,13 +22,13 @@ public record Torque1D : PhysicalQuantity, T>, IVector1 /// The value in NewtonMeter. /// A new instance. - public static Torque1D FromNewtonMeter(T value) => Create(value); + public static Torque1D FromNewtonMeters(T value) => Create(value); /// /// Creates a new from a value in PoundFoot. /// /// The value in PoundFoot. /// A new instance. - public static Torque1D FromPoundFoot(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.PoundFootToNewtonMeters))); + public static Torque1D FromPoundFeet(T value) => Create((value * T.CreateChecked(Units.ConversionConstants.PoundFootToNewtonMeters))); /// /// Gets the magnitude of this quantity as a . /// diff --git a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TorqueMagnitude.g.cs b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TorqueMagnitude.g.cs index a33f73c..1b1d72b 100644 --- a/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TorqueMagnitude.g.cs +++ b/Semantics.Quantities/Generated/Semantics.SourceGenerators/Semantics.SourceGenerators.QuantitiesGenerator/TorqueMagnitude.g.cs @@ -23,14 +23,14 @@ public record TorqueMagnitude : PhysicalQuantity, T>, IVec /// The value in NewtonMeter. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static TorqueMagnitude FromNewtonMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static TorqueMagnitude FromNewtonMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in PoundFoot. /// /// The value in PoundFoot. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static TorqueMagnitude FromPoundFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundFootToNewtonMeters)), nameof(value))); + public static TorqueMagnitude FromPoundFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.PoundFootToNewtonMeters)), nameof(value))); /// /// Subtracts two TorqueMagnitude values, returning the absolute difference as a non-negative TorqueMagnitude. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 6d30b69..83443a7 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 @@ -22,7 +22,7 @@ public record Voltage : PhysicalQuantity, T>, IVector1, /// /// The value in Volt. /// A new instance. - public static Voltage FromVolt(T value) => Create(value); + public static Voltage FromVolts(T value) => Create(value); /// /// Gets the magnitude of this quantity as a . /// 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 fc2e7c4..4e91e25 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 @@ -24,7 +24,7 @@ public record VoltageDrop : PhysicalQuantity, T>, IVector0The value in Volt. /// A new VoltageDrop instance. /// Thrown when the resulting magnitude would be negative. - public static VoltageDrop FromVolt(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static VoltageDrop FromVolts(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// Implicit conversion to VoltageMagnitude. public static implicit operator VoltageMagnitude(VoltageDrop value) => VoltageMagnitude.Create(value.Value); /// Explicit conversion from VoltageMagnitude. 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 d7748ec..37b79ca 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 @@ -23,7 +23,7 @@ public record VoltageMagnitude : PhysicalQuantity, T>, IV /// The value in Volt. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static VoltageMagnitude FromVolt(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static VoltageMagnitude FromVolts(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Subtracts two VoltageMagnitude values, returning the absolute difference as a non-negative VoltageMagnitude. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 45487ab..20ffcbb 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 @@ -23,28 +23,28 @@ public record Volume : PhysicalQuantity, T>, IVector0, T> /// The value in CubicMeter. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Volume FromCubicMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Volume FromCubicMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new from a value in Liter. /// /// The value in Liter. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Volume FromLiter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.LiterToCubicMeters)), nameof(value))); + public static Volume FromLiters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.LiterToCubicMeters)), nameof(value))); /// /// Creates a new from a value in Milliliter. /// /// The value in Milliliter. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Volume FromMilliliter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Volume FromMilliliters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new from a value in Gallon. /// /// The value in Gallon. /// A new instance. /// Thrown when the resulting magnitude would be negative. - public static Volume FromGallon(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GallonToCubicMeters)), nameof(value))); + public static Volume FromGallons(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.GallonToCubicMeters)), nameof(value))); /// /// Subtracts two Volume values, returning the absolute difference as a non-negative Volume. /// Magnitude subtraction stays a magnitude (per the unified-vector model). 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 7f0d0ca..b2131e4 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 @@ -24,77 +24,77 @@ public record Wavelength : PhysicalQuantity, T>, IVector0The value in Meter. /// A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. - public static Wavelength FromMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Wavelength FromMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Wavelength from a value in Kilometer. /// /// The value in Kilometer. /// A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. - public static Wavelength FromKilometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); + public static Wavelength FromKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Wavelength from a value in Centimeter. /// /// The value in Centimeter. /// A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. - public static Wavelength FromCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); + public static Wavelength FromCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); /// /// Creates a new Wavelength from a value in Millimeter. /// /// The value in Millimeter. /// A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. - public static Wavelength FromMillimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Wavelength FromMillimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Wavelength from a value in Micrometer. /// /// The value in Micrometer. /// A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. - public static Wavelength FromMicrometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Wavelength FromMicrometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Wavelength from a value in Nanometer. /// /// The value in Nanometer. /// A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. - public static Wavelength FromNanometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); + public static Wavelength FromNanometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Creates a new Wavelength from a value in Angstrom. /// /// The value in Angstrom. /// A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. - public static Wavelength FromAngstrom(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); + public static Wavelength FromAngstroms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); /// /// Creates a new Wavelength from a value in Foot. /// /// The value in Foot. /// A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. - public static Wavelength FromFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); + public static Wavelength FromFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); /// /// Creates a new Wavelength from a value in Inch. /// /// The value in Inch. /// A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. - public static Wavelength FromInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); + public static Wavelength FromInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); /// /// Creates a new Wavelength from a value in Yard. /// /// The value in Yard. /// A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. - public static Wavelength FromYard(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); + public static Wavelength FromYards(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); /// /// Creates a new Wavelength from a value in Mile. /// /// The value in Mile. /// A new Wavelength instance. /// Thrown when the resulting magnitude would be negative. - public static Wavelength FromMile(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); + public static Wavelength FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); /// Implicit conversion to Length. public static implicit operator Length(Wavelength value) => Length.Create(value.Value); /// Explicit conversion from Length. 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 ebea78a..ca2efd9 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 @@ -24,7 +24,7 @@ public record Weight : PhysicalQuantity, T>, IVector0, T> /// The value in Newton. /// A new Weight instance. /// Thrown when the resulting magnitude would be negative. - public static Weight FromNewton(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Weight FromNewtons(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// Implicit conversion to ForceMagnitude. public static implicit operator ForceMagnitude(Weight value) => ForceMagnitude.Create(value.Value); /// Explicit conversion from ForceMagnitude. 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 cb79279..cdc6941 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 @@ -24,77 +24,77 @@ public record Width : PhysicalQuantity, T>, IVector0, T> /// The value in Meter. /// A new Width instance. /// Thrown when the resulting magnitude would be negative. - public static Width FromMeter(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Width FromMeters(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Width from a value in Kilometer. /// /// The value in Kilometer. /// A new Width instance. /// Thrown when the resulting magnitude would be negative. - public static Width FromKilometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); + public static Width FromKilometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Kilo)), nameof(value))); /// /// Creates a new Width from a value in Centimeter. /// /// The value in Centimeter. /// A new Width instance. /// Thrown when the resulting magnitude would be negative. - public static Width FromCentimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); + public static Width FromCentimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Centi)), nameof(value))); /// /// Creates a new Width from a value in Millimeter. /// /// The value in Millimeter. /// A new Width instance. /// Thrown when the resulting magnitude would be negative. - public static Width FromMillimeter(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); + public static Width FromMillimeters(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Milli)), nameof(value))); /// /// Creates a new Width from a value in Micrometer. /// /// The value in Micrometer. /// A new Width instance. /// Thrown when the resulting magnitude would be negative. - public static Width FromMicrometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); + public static Width FromMicrometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Micro)), nameof(value))); /// /// Creates a new Width from a value in Nanometer. /// /// The value in Nanometer. /// A new Width instance. /// Thrown when the resulting magnitude would be negative. - public static Width FromNanometer(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); + public static Width FromNanometers(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(MetricMagnitudes.Nano)), nameof(value))); /// /// Creates a new Width from a value in Angstrom. /// /// The value in Angstrom. /// A new Width instance. /// Thrown when the resulting magnitude would be negative. - public static Width FromAngstrom(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); + public static Width FromAngstroms(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AngstromToMeters)), nameof(value))); /// /// Creates a new Width from a value in Foot. /// /// The value in Foot. /// A new Width instance. /// Thrown when the resulting magnitude would be negative. - public static Width FromFoot(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); + public static Width FromFeet(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.FeetToMeters)), nameof(value))); /// /// Creates a new Width from a value in Inch. /// /// The value in Inch. /// A new Width instance. /// Thrown when the resulting magnitude would be negative. - public static Width FromInch(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); + public static Width FromInches(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.InchesToMeters)), nameof(value))); /// /// Creates a new Width from a value in Yard. /// /// The value in Yard. /// A new Width instance. /// Thrown when the resulting magnitude would be negative. - public static Width FromYard(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); + public static Width FromYards(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.YardToMeters)), nameof(value))); /// /// Creates a new Width from a value in Mile. /// /// The value in Mile. /// A new Width instance. /// Thrown when the resulting magnitude would be negative. - public static Width FromMile(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); + public static Width FromMiles(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.MileToMeters)), nameof(value))); /// Implicit conversion to Length. public static implicit operator Length(Width value) => Length.Create(value.Value); /// Explicit conversion from Length. 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 463de55..0f71c18 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 @@ -24,28 +24,28 @@ public record Work : PhysicalQuantity, T>, IVector0, T> /// The value in Joule. /// A new Work instance. /// Thrown when the resulting magnitude would be negative. - public static Work FromJoule(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static Work FromJoules(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new Work from a value in ElectronVolt. /// /// The value in ElectronVolt. /// A new Work instance. /// Thrown when the resulting magnitude would be negative. - public static Work FromElectronVolt(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); + public static Work FromElectronVolts(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.ElectronVoltToJoules)), nameof(value))); /// /// Creates a new Work from a value in Calorie. /// /// The value in Calorie. /// A new Work instance. /// Thrown when the resulting magnitude would be negative. - public static Work FromCalorie(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.CalorieToJoules)), nameof(value))); + 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 KilowattHour. /// /// The value in KilowattHour. /// A new Work instance. /// Thrown when the resulting magnitude would be negative. - public static Work FromKilowattHour(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); + public static Work FromKilowattHours(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.KilowattHourToJoules)), nameof(value))); /// Implicit conversion to Energy. public static implicit operator Energy(Work value) => Energy.Create(value.Value); /// Explicit conversion from Energy. 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 10a347d..acf1e77 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 @@ -24,21 +24,21 @@ public record YoungsModulus : PhysicalQuantity, T>, IVector0 /// The value in Pascal. /// A new YoungsModulus instance. /// Thrown when the resulting magnitude would be negative. - public static YoungsModulus FromPascal(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); + public static YoungsModulus FromPascals(T value) => Create(Vector0Guards.EnsureNonNegative(value, nameof(value))); /// /// Creates a new YoungsModulus from a value in Bar. /// /// The value in Bar. /// A new YoungsModulus instance. /// Thrown when the resulting magnitude would be negative. - public static YoungsModulus FromBar(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); + public static YoungsModulus FromBars(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.BarToPascals)), nameof(value))); /// /// Creates a new YoungsModulus from a value in Atmosphere. /// /// The value in Atmosphere. /// A new YoungsModulus instance. /// Thrown when the resulting magnitude would be negative. - public static YoungsModulus FromAtmosphere(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); + public static YoungsModulus FromAtmospheres(T value) => Create(Vector0Guards.EnsureNonNegative((value * T.CreateChecked(Units.ConversionConstants.AtmosphereToPascals)), nameof(value))); /// /// Creates a new YoungsModulus from a value in Psi. /// diff --git a/Semantics.SourceGenerators/Generators/QuantitiesGenerator.cs b/Semantics.SourceGenerators/Generators/QuantitiesGenerator.cs index ac77981..47d9f3a 100644 --- a/Semantics.SourceGenerators/Generators/QuantitiesGenerator.cs +++ b/Semantics.SourceGenerators/Generators/QuantitiesGenerator.cs @@ -473,6 +473,16 @@ private static void AddUnitFactories( ? $" => Create(Vector0Guards.EnsureNonNegative({conversionExpr}, nameof(value)));" : $" => Create({conversionExpr});"; + // Issue #49: factory names use the plural form. Prefer an explicit FactoryName from + // units.json (covers irregular plurals like Foot→Feet, mass nouns like Hertz, and + // already-plural compounds like MetersPerSecond). Fall back to "{Name}s" for units + // that haven't been migrated yet — wrong for those edge cases but produces a build + // rather than a hard failure. + string factorySuffix = unitMap.TryGetValue(unitName, out UnitDefinition? unitDef) + && !string.IsNullOrEmpty(unitDef?.FactoryName) + ? unitDef!.FactoryName + : unitName + "s"; + List comments = [ "/// ", @@ -490,7 +500,7 @@ private static void AddUnitFactories( { Comments = comments, Keywords = ["public", "static", fullType], - Name = $"From{unitName}", + Name = $"From{factorySuffix}", Parameters = [new ParameterTemplate { Type = "T", Name = "value" }], BodyFactory = (b) => b.Write(body), }); diff --git a/Semantics.SourceGenerators/Metadata/units.json b/Semantics.SourceGenerators/Metadata/units.json index 89e0b77..5d47591 100644 --- a/Semantics.SourceGenerators/Metadata/units.json +++ b/Semantics.SourceGenerators/Metadata/units.json @@ -8,225 +8,258 @@ "name": "Meter", "symbol": "m", "description": "Meter - SI base unit of length.", - "system": "SIBase" + "system": "SIBase", + "factoryName": "Meters" }, { "name": "Kilometer", "symbol": "km", "description": "Kilometer - 1000 meters.", "system": "SIDerived", - "magnitude": "Kilo" + "magnitude": "Kilo", + "factoryName": "Kilometers" }, { "name": "Centimeter", "symbol": "cm", "description": "Centimeter - 0.01 meters.", "system": "SIDerived", - "magnitude": "Centi" + "magnitude": "Centi", + "factoryName": "Centimeters" }, { "name": "Millimeter", "symbol": "mm", "description": "Millimeter - 0.001 meters.", "system": "SIDerived", - "magnitude": "Milli" + "magnitude": "Milli", + "factoryName": "Millimeters" }, { "name": "Foot", "symbol": "ft", "description": "Foot - Imperial unit of length.", "system": "Imperial", - "conversionFactor": "FeetToMeters" + "conversionFactor": "FeetToMeters", + "factoryName": "Feet" }, { "name": "Inch", "symbol": "in", "description": "Inch - Imperial unit of length.", "system": "Imperial", - "conversionFactor": "InchesToMeters" + "conversionFactor": "InchesToMeters", + "factoryName": "Inches" }, { "name": "Micrometer", "symbol": "μm", "description": "Micrometer - 0.000001 meters.", "system": "SIDerived", - "magnitude": "Micro" + "magnitude": "Micro", + "factoryName": "Micrometers" }, { "name": "Nanometer", "symbol": "nm", "description": "Nanometer - 0.000000001 meters.", "system": "SIDerived", - "magnitude": "Nano" + "magnitude": "Nano", + "factoryName": "Nanometers" }, { "name": "Angstrom", "symbol": "Å", "description": "Angstrom - 10⁻¹⁰ meters, used for atomic scales.", "system": "Other", - "conversionFactor": "AngstromToMeters" + "conversionFactor": "AngstromToMeters", + "factoryName": "Angstroms" }, { "name": "Yard", "symbol": "yd", "description": "Yard - Imperial unit of length.", "system": "Imperial", - "conversionFactor": "YardToMeters" + "conversionFactor": "YardToMeters", + "factoryName": "Yards" }, { "name": "Mile", "symbol": "mi", "description": "Mile - Imperial unit of length.", "system": "Imperial", - "conversionFactor": "MileToMeters" + "conversionFactor": "MileToMeters", + "factoryName": "Miles" }, { "name": "Kilogram", "symbol": "kg", "description": "Kilogram - SI base unit of mass.", - "system": "SIBase" + "system": "SIBase", + "factoryName": "Kilograms" }, { "name": "Gram", "symbol": "g", "description": "Gram - 0.001 kilograms.", "system": "SIDerived", - "magnitude": "Milli" + "magnitude": "Milli", + "factoryName": "Grams" }, { "name": "Ton", "symbol": "t", "description": "Metric ton - 1000 kilograms.", "system": "SIDerived", - "conversionFactor": "TonToKilograms" + "conversionFactor": "TonToKilograms", + "factoryName": "Tons" }, { "name": "Pound", "symbol": "lb", "description": "Pound - Imperial unit of mass.", "system": "Imperial", - "conversionFactor": "PoundToKilograms" + "conversionFactor": "PoundToKilograms", + "factoryName": "Pounds" }, { "name": "Ounce", "symbol": "oz", "description": "Ounce - Imperial unit of mass.", "system": "Imperial", - "conversionFactor": "OunceToKilograms" + "conversionFactor": "OunceToKilograms", + "factoryName": "Ounces" }, { "name": "Second", "symbol": "s", "description": "Second - SI base unit of time.", - "system": "SIBase" + "system": "SIBase", + "factoryName": "Seconds" }, { "name": "Minute", "symbol": "min", "description": "Minute - 60 seconds.", "system": "Other", - "conversionFactor": "MinuteToSeconds" + "conversionFactor": "MinuteToSeconds", + "factoryName": "Minutes" }, { "name": "Hour", "symbol": "h", "description": "Hour - 3600 seconds.", "system": "Other", - "conversionFactor": "HourToSeconds" + "conversionFactor": "HourToSeconds", + "factoryName": "Hours" }, { "name": "Day", "symbol": "d", "description": "Day - 86400 seconds.", "system": "Other", - "conversionFactor": "DayToSeconds" + "conversionFactor": "DayToSeconds", + "factoryName": "Days" }, { "name": "Year", "symbol": "yr", "description": "Year - 365.25 days (31557600 seconds).", "system": "Other", - "conversionFactor": "YearToSeconds" + "conversionFactor": "YearToSeconds", + "factoryName": "Years" }, { "name": "Millisecond", "symbol": "ms", "description": "Millisecond - 0.001 seconds.", "system": "SIDerived", - "magnitude": "Milli" + "magnitude": "Milli", + "factoryName": "Milliseconds" }, { "name": "Microsecond", "symbol": "μs", "description": "Microsecond - 0.000001 seconds.", "system": "SIDerived", - "magnitude": "Micro" + "magnitude": "Micro", + "factoryName": "Microseconds" }, { "name": "SquareMeter", "symbol": "m²", "description": "Square meter - SI derived unit of area.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "SquareMeters" }, { "name": "SquareFoot", "symbol": "ft²", "description": "Square foot - Imperial unit of area.", "system": "Imperial", - "conversionFactor": "SquareFootToSquareMeters" + "conversionFactor": "SquareFootToSquareMeters", + "factoryName": "SquareFeet" }, { "name": "SquareInch", "symbol": "in²", "description": "Square inch - Imperial unit of area.", "system": "Imperial", - "conversionFactor": "SquareInchToSquareMeters" + "conversionFactor": "SquareInchToSquareMeters", + "factoryName": "SquareInches" }, { "name": "CubicMeter", "symbol": "m³", "description": "Cubic meter - SI derived unit of volume.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "CubicMeters" }, { "name": "Liter", "symbol": "L", "description": "Liter - 0.001 cubic meters.", "system": "SIDerived", - "conversionFactor": "LiterToCubicMeters" + "conversionFactor": "LiterToCubicMeters", + "factoryName": "Liters" }, { "name": "Milliliter", "symbol": "mL", "description": "Milliliter - 0.001 liters.", "system": "SIDerived", - "magnitude": "Milli" + "magnitude": "Milli", + "factoryName": "Milliliters" }, { "name": "Gallon", "symbol": "gal", "description": "US gallon - Imperial unit of volume.", "system": "Imperial", - "conversionFactor": "GallonToCubicMeters" + "conversionFactor": "GallonToCubicMeters", + "factoryName": "Gallons" }, { "name": "Dimensionless", "symbol": "1", "description": "Dimensionless - Pure number or ratio with no physical units.", - "system": "SIBase" + "system": "SIBase", + "factoryName": "Dimensionless" }, { "name": "Radian", "symbol": "rad", "description": "Radian - SI derived unit of plane angle.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Radians" }, { "name": "Degree", "symbol": "°", "description": "Degree - Common unit of plane angle.", "system": "Other", - "conversionFactor": "DegreeToRadians" + "conversionFactor": "DegreeToRadians", + "factoryName": "Degrees" } ] }, @@ -238,143 +271,165 @@ "name": "Newton", "symbol": "N", "description": "Newton - SI derived unit of force.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Newtons" }, { "name": "Pascal", "symbol": "Pa", "description": "Pascal - SI derived unit of pressure.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Pascals" }, { "name": "MetersPerSecond", "symbol": "m/s", "description": "Meters per second - SI derived unit of velocity.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "MetersPerSecond" }, { "name": "MetersPerSecondSquared", "symbol": "m/s²", "description": "Meters per second squared - SI derived unit of acceleration.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "MetersPerSecondSquared" }, { "name": "Bar", "symbol": "bar", "description": "Bar - Metric unit of pressure.", "system": "SIDerived", - "conversionFactor": "BarToPascals" + "conversionFactor": "BarToPascals", + "factoryName": "Bars" }, { "name": "Atmosphere", "symbol": "atm", "description": "Standard atmosphere - Unit of pressure.", "system": "Other", - "conversionFactor": "AtmosphereToPascals" + "conversionFactor": "AtmosphereToPascals", + "factoryName": "Atmospheres" }, { "name": "Psi", "symbol": "psi", "description": "Pounds per square inch - Imperial unit of pressure.", "system": "Imperial", - "conversionFactor": "PsiToPascals" + "conversionFactor": "PsiToPascals", + "factoryName": "Psi" }, { "name": "KilometersPerHour", "symbol": "km/h", "description": "Kilometers per hour - Common unit of velocity.", "system": "SIDerived", - "conversionFactor": "KilometersPerHourToMetersPerSecond" + "conversionFactor": "KilometersPerHourToMetersPerSecond", + "factoryName": "KilometersPerHour" }, { "name": "MilesPerHour", "symbol": "mph", "description": "Miles per hour - Imperial unit of velocity.", "system": "Imperial", - "conversionFactor": "MilesPerHourToMetersPerSecond" + "conversionFactor": "MilesPerHourToMetersPerSecond", + "factoryName": "MilesPerHour" }, { "name": "Joule", "symbol": "J", "description": "Joule - SI derived unit of energy.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Joules" }, { "name": "Watt", "symbol": "W", "description": "Watt - SI derived unit of power.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Watts" }, { "name": "Calorie", "symbol": "cal", "description": "Calorie - Thermochemical calorie, energy unit.", "system": "Other", - "conversionFactor": "CalorieToJoules" + "conversionFactor": "CalorieToJoules", + "factoryName": "Calories" }, { "name": "KilowattHour", "symbol": "kWh", "description": "Kilowatt-hour - Common unit of electrical energy.", "system": "SIDerived", - "conversionFactor": "KilowattHourToJoules" + "conversionFactor": "KilowattHourToJoules", + "factoryName": "KilowattHours" }, { "name": "Horsepower", "symbol": "hp", "description": "Mechanical horsepower - Imperial unit of power.", "system": "Imperial", - "conversionFactor": "HorsepowerToWatts" + "conversionFactor": "HorsepowerToWatts", + "factoryName": "Horsepower" }, { "name": "NewtonSecond", "symbol": "N⋅s", "description": "Newton-second - SI derived unit of momentum.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "NewtonSeconds" }, { "name": "ElectronVolt", "symbol": "eV", "description": "Electron volt - Energy unit equal to electron charge times one volt.", "system": "Other", - "conversionFactor": "ElectronVoltToJoules" + "conversionFactor": "ElectronVoltToJoules", + "factoryName": "ElectronVolts" }, { "name": "NewtonMeter", "symbol": "N⋅m", "description": "Newton-meter - SI derived unit of torque.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "NewtonMeters" }, { "name": "PoundFoot", "symbol": "lb⋅ft", "description": "Pound-foot - Imperial unit of torque.", "system": "Imperial", - "conversionFactor": "PoundFootToNewtonMeters" + "conversionFactor": "PoundFootToNewtonMeters", + "factoryName": "PoundFeet" }, { "name": "KilogramMeterSquared", "symbol": "kg⋅m²", "description": "Kilogram-meter squared - SI derived unit of moment of inertia.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "KilogramMeterSquared" }, { "name": "KilogramMeterSquaredPerSecond", "symbol": "kg⋅m²/s", "description": "Kilogram-meter squared per second - SI derived unit of angular momentum.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "KilogramMeterSquaredPerSecond" }, { "name": "MetersPerSecondCubed", "symbol": "m/s³", "description": "Meters per second cubed - SI derived unit of jerk.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "MetersPerSecondCubed" }, { "name": "MetersPerSecondQuartic", "symbol": "m/s⁴", "description": "Meters per second to the fourth - SI derived unit of snap.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "MetersPerSecondQuartic" } ] }, @@ -386,14 +441,16 @@ "name": "Kelvin", "symbol": "K", "description": "Kelvin - SI base unit of thermodynamic temperature.", - "system": "SIBase" + "system": "SIBase", + "factoryName": "Kelvins" }, { "name": "Celsius", "symbol": "°C", "description": "Celsius - Common temperature scale.", "system": "SIDerived", - "offset": "CelsiusToKelvinOffset" + "offset": "CelsiusToKelvinOffset", + "factoryName": "Celsius" }, { "name": "Fahrenheit", @@ -401,37 +458,43 @@ "description": "Fahrenheit - Imperial temperature scale.", "system": "Imperial", "conversionFactor": "FahrenheitScale", - "offset": "FahrenheitToKelvinOffset" + "offset": "FahrenheitToKelvinOffset", + "factoryName": "Fahrenheit" }, { "name": "JoulePerKelvin", "symbol": "J/K", "description": "Joule per kelvin - SI derived unit of entropy and heat capacity.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "JoulePerKelvin" }, { "name": "JoulePerKilogramKelvin", "symbol": "J/(kg·K)", "description": "Joule per kilogram kelvin - SI derived unit of specific heat capacity.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "JoulePerKilogramKelvin" }, { "name": "WattPerMeterKelvin", "symbol": "W/(m·K)", "description": "Watt per meter kelvin - SI derived unit of thermal conductivity.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "WattPerMeterKelvin" }, { "name": "WattPerSquareMeterKelvin", "symbol": "W/(m²·K)", "description": "Watt per square meter kelvin - SI derived unit of heat transfer coefficient.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "WattPerSquareMeterKelvin" }, { "name": "PerKelvin", "symbol": "K⁻¹", "description": "Per kelvin - SI derived unit of thermal expansion coefficient.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "PerKelvin" } ] }, @@ -443,68 +506,79 @@ "name": "Ampere", "symbol": "A", "description": "Ampere - SI base unit of electric current.", - "system": "SIBase" + "system": "SIBase", + "factoryName": "Amperes" }, { "name": "Volt", "symbol": "V", "description": "Volt - SI derived unit of electric potential.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Volts" }, { "name": "VoltPerMeter", "symbol": "V/m", "description": "Volt per meter - SI derived unit of electric field strength.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "VoltPerMeter" }, { "name": "Ohm", "symbol": "Ω", "description": "Ohm - SI derived unit of electric resistance.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Ohms" }, { "name": "Coulomb", "symbol": "C", "description": "Coulomb - SI derived unit of electric charge.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Coulombs" }, { "name": "Farad", "symbol": "F", "description": "Farad - SI derived unit of electric capacitance.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Farads" }, { "name": "Siemens", "symbol": "S", "description": "Siemens - SI derived unit of electric conductance.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Siemens" }, { "name": "Tesla", "symbol": "T", "description": "Tesla - SI derived unit of magnetic flux density.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Teslas" }, { "name": "Gauss", "symbol": "G", "description": "Gauss - CGS unit of magnetic flux density.", "system": "CGS", - "conversionFactor": "GaussToTesla" + "conversionFactor": "GaussToTesla", + "factoryName": "Gauss" }, { "name": "Weber", "symbol": "Wb", "description": "Weber - SI derived unit of magnetic flux.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Webers" }, { "name": "Henry", "symbol": "H", "description": "Henry - SI derived unit of inductance.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Henries" } ] }, @@ -516,26 +590,30 @@ "name": "RadiansPerSecond", "symbol": "rad/s", "description": "Radians per second - SI derived unit of angular velocity.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "RadiansPerSecond" }, { "name": "RevolutionsPerMinute", "symbol": "rpm", "description": "Revolutions per minute - Common unit of angular velocity.", "system": "Other", - "conversionFactor": "RevolutionsPerMinuteToRadiansPerSecond" + "conversionFactor": "RevolutionsPerMinuteToRadiansPerSecond", + "factoryName": "RevolutionsPerMinute" }, { "name": "RadiansPerSecondSquared", "symbol": "rad/s²", "description": "Radians per second squared - SI derived unit of angular acceleration.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "RadiansPerSecondSquared" }, { "name": "RadiansPerSecondCubed", "symbol": "rad/s³", "description": "Radians per second cubed - SI derived unit of angular jerk.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "RadiansPerSecondCubed" } ] }, @@ -547,7 +625,8 @@ "name": "Hertz", "symbol": "Hz", "description": "Hertz - SI derived unit of frequency.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Hertz" } ] }, @@ -559,25 +638,29 @@ "name": "Candela", "symbol": "cd", "description": "Candela - SI base unit of luminous intensity.", - "system": "SIBase" + "system": "SIBase", + "factoryName": "Candelas" }, { "name": "Lumen", "symbol": "lm", "description": "Lumen - SI derived unit of luminous flux.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Lumens" }, { "name": "Lux", "symbol": "lx", "description": "Lux - SI derived unit of illuminance.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Lux" }, { "name": "Diopter", "symbol": "D", "description": "Diopter - SI unit of optical power.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Diopters" } ] }, @@ -589,32 +672,37 @@ "name": "Becquerel", "symbol": "Bq", "description": "Becquerel - SI derived unit of radioactive activity.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Becquerels" }, { "name": "Gray", "symbol": "Gy", "description": "Gray - SI derived unit of absorbed dose.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Grays" }, { "name": "Sievert", "symbol": "Sv", "description": "Sievert - SI derived unit of equivalent dose.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Sieverts" }, { "name": "Barn", "symbol": "b", "description": "Barn - Unit of nuclear cross section.", "system": "Other", - "conversionFactor": "BarnToSquareMeters" + "conversionFactor": "BarnToSquareMeters", + "factoryName": "Barns" }, { "name": "CoulombPerKilogram", "symbol": "C/kg", "description": "Coulomb per kilogram - SI derived unit of radiation exposure.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "CoulombPerKilogram" } ] }, @@ -626,7 +714,8 @@ "name": "KilogramPerCubicMeter", "symbol": "kg/m³", "description": "Kilogram per cubic meter - SI derived unit of density.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "KilogramPerCubicMeter" } ] }, @@ -638,14 +727,16 @@ "name": "Mole", "symbol": "mol", "description": "Mole - SI base unit of amount of substance.", - "system": "SIBase" + "system": "SIBase", + "factoryName": "Moles" }, { "name": "Molar", "symbol": "M", "description": "Molar - Moles per liter concentration.", "system": "SIDerived", - "conversionFactor": "MolarToCubicMeter" + "conversionFactor": "MolarToCubicMeter", + "factoryName": "Molars" } ] }, @@ -657,52 +748,60 @@ "name": "SquareMeterPerSecond", "symbol": "m²/s", "description": "Square meter per second - SI derived unit of kinematic viscosity.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "SquareMeterPerSecond" }, { "name": "Stokes", "symbol": "St", "description": "Stokes - CGS unit of kinematic viscosity.", "system": "CGS", - "conversionFactor": "StokesToSquareMeterPerSecond" + "conversionFactor": "StokesToSquareMeterPerSecond", + "factoryName": "Stokes" }, { "name": "PascalSecond", "symbol": "Pa·s", "description": "Pascal second - SI derived unit of dynamic viscosity.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "PascalSeconds" }, { "name": "Poise", "symbol": "P", "description": "Poise - CGS unit of dynamic viscosity.", "system": "CGS", - "conversionFactor": "PoiseToPascalSecond" + "conversionFactor": "PoiseToPascalSecond", + "factoryName": "Poise" }, { "name": "CubicMeterPerSecond", "symbol": "m³/s", "description": "Cubic meter per second - SI derived unit of volumetric flow rate.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "CubicMeterPerSecond" }, { "name": "LiterPerSecond", "symbol": "L/s", "description": "Liter per second - Common unit of volumetric flow rate.", "system": "SIDerived", - "conversionFactor": "LiterPerSecondToCubicMeterPerSecond" + "conversionFactor": "LiterPerSecondToCubicMeterPerSecond", + "factoryName": "LiterPerSecond" }, { "name": "KilogramPerSecond", "symbol": "kg/s", "description": "Kilogram per second - SI derived unit of mass flow rate.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "KilogramPerSecond" }, { "name": "NewtonPerMeter", "symbol": "N/m", "description": "Newton per meter - SI derived unit of surface tension.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "NewtonPerMeter" } ] }, @@ -714,39 +813,45 @@ "name": "KilogramPerMole", "symbol": "kg/mol", "description": "Kilogram per mole - SI derived unit of molar mass.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "KilogramPerMole" }, { "name": "GramPerMole", "symbol": "g/mol", "description": "Gram per mole - Common unit of molar mass.", "system": "SIDerived", - "conversionFactor": "GramPerMoleToKilogramPerMole" + "conversionFactor": "GramPerMoleToKilogramPerMole", + "factoryName": "GramPerMole" }, { "name": "Katal", "symbol": "kat", "description": "Katal - SI derived unit of catalytic activity.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "Katals" }, { "name": "MolePerCubicMeterSecond", "symbol": "mol/(m³·s)", "description": "Mole per cubic meter second - SI derived unit of reaction rate.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "MolePerCubicMeterSecond" }, { "name": "JoulePerMole", "symbol": "J/mol", "description": "Joule per mole - SI derived unit of molar energy.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "JoulePerMole" }, { "name": "KilojoulePerMole", "symbol": "kJ/mol", "description": "Kilojoule per mole - Common unit of molar energy.", "system": "SIDerived", - "conversionFactor": "KilojoulePerMoleToJoulePerMole" + "conversionFactor": "KilojoulePerMoleToJoulePerMole", + "factoryName": "KilojoulePerMole" } ] }, @@ -758,13 +863,15 @@ "name": "WattPerSquareMeter", "symbol": "W/m²", "description": "Watt per square meter - SI derived unit of irradiance and sound intensity.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "WattPerSquareMeter" }, { "name": "PascalSecondPerMeter", "symbol": "Pa·s/m", "description": "Pascal second per meter - SI derived unit of acoustic impedance.", - "system": "SIDerived" + "system": "SIDerived", + "factoryName": "PascalSecondPerMeter" } ] } diff --git a/Semantics.SourceGenerators/Models/UnitsMetadata.cs b/Semantics.SourceGenerators/Models/UnitsMetadata.cs index 91fe600..f981b17 100644 --- a/Semantics.SourceGenerators/Models/UnitsMetadata.cs +++ b/Semantics.SourceGenerators/Models/UnitsMetadata.cs @@ -27,4 +27,13 @@ public class UnitDefinition public string Magnitude { get; set; } = "1"; public string ConversionFactor { get; set; } = "1"; public string Offset { get; set; } = "0"; + + /// + /// Plural-form identifier used when emitting From{FactoryName} factories per #49. + /// Empty string means "fall back to the rule built into the generator" — currently + /// Name + "s", which is correct for regular units (Meter→Meters, Newton→Newtons) + /// but wrong for irregulars (Foot, Inch), already-plural compounds (MetersPerSecond), + /// and mass nouns (Hertz, Lux, Siemens). Set this explicitly for those cases. + /// + public string FactoryName { get; set; } = string.Empty; } diff --git a/Semantics.Test/Quantities/MultiUnitFactoryTests.cs b/Semantics.Test/Quantities/MultiUnitFactoryTests.cs index ac9076a..a055608 100644 --- a/Semantics.Test/Quantities/MultiUnitFactoryTests.cs +++ b/Semantics.Test/Quantities/MultiUnitFactoryTests.cs @@ -20,129 +20,129 @@ public sealed class MultiUnitFactoryTests // ---- Length ---- [TestMethod] - public void Length_FromMeter_Identity() + public void Length_FromMeters_Identity() { - Length l = Length.FromMeter(1.0); + Length l = Length.FromMeters(1.0); Assert.AreEqual(1.0, l.Value, Tolerance); } [TestMethod] - public void Length_FromKilometer_Scales_By_1000() + public void Length_FromKilometers_Scales_By_1000() { - Length l = Length.FromKilometer(1.0); + Length l = Length.FromKilometers(1.0); Assert.AreEqual(1000.0, l.Value, Tolerance); } [TestMethod] - public void Length_FromCentimeter_Scales_By_0_01() + public void Length_FromCentimeters_Scales_By_0_01() { - Length l = Length.FromCentimeter(1.0); + Length l = Length.FromCentimeters(1.0); Assert.AreEqual(0.01, l.Value, Tolerance); } [TestMethod] - public void Length_FromMillimeter_Scales_By_0_001() + public void Length_FromMillimeters_Scales_By_0_001() { - Length l = Length.FromMillimeter(1.0); + Length l = Length.FromMillimeters(1.0); Assert.AreEqual(0.001, l.Value, Tolerance); } [TestMethod] - public void Length_FromFoot_Uses_FeetToMeters_Constant() + public void Length_FromFeet_Uses_FeetToMeters_Constant() { - Length l = Length.FromFoot(1.0); + Length l = Length.FromFeet(1.0); Assert.AreEqual(0.3048, l.Value, Tolerance); } [TestMethod] - public void Length_FromInch_Uses_InchesToMeters_Constant() + public void Length_FromInches_Uses_InchesToMeters_Constant() { - Length l = Length.FromInch(1.0); + Length l = Length.FromInches(1.0); Assert.AreEqual(0.0254, l.Value, Tolerance); } [TestMethod] - public void Length_FromMile_Uses_MileToMeters_Constant() + public void Length_FromMiles_Uses_MileToMeters_Constant() { - Length l = Length.FromMile(1.0); + Length l = Length.FromMiles(1.0); Assert.AreEqual(1609.344, l.Value, Tolerance); } // ---- Mass ---- [TestMethod] - public void Mass_FromKilogram_Identity() + public void Mass_FromKilograms_Identity() { - Mass m = Mass.FromKilogram(1.0); + Mass m = Mass.FromKilograms(1.0); Assert.AreEqual(1.0, m.Value, Tolerance); } [TestMethod] - public void Mass_FromGram_Scales_By_0_001() + public void Mass_FromGrams_Scales_By_0_001() { - Mass m = Mass.FromGram(1.0); + Mass m = Mass.FromGrams(1.0); Assert.AreEqual(0.001, m.Value, Tolerance); } [TestMethod] - public void Mass_FromPound_Uses_PoundToKilograms_Constant() + public void Mass_FromPounds_Uses_PoundToKilograms_Constant() { - Mass m = Mass.FromPound(1.0); + Mass m = Mass.FromPounds(1.0); Assert.AreEqual(0.45359237, m.Value, Tolerance); } // ---- Time / Duration ---- [TestMethod] - public void Duration_FromMinute_Equals_60_Seconds() + public void Duration_FromMinutes_Equals_60_Seconds() { - Duration d = Duration.FromMinute(1.0); + Duration d = Duration.FromMinutes(1.0); Assert.AreEqual(60.0, d.Value, Tolerance); } [TestMethod] - public void Duration_FromHour_Equals_3600_Seconds() + public void Duration_FromHours_Equals_3600_Seconds() { - Duration d = Duration.FromHour(1.0); + Duration d = Duration.FromHours(1.0); Assert.AreEqual(3600.0, d.Value, Tolerance); } // ---- Semantic overloads inherit their dimension's full unit set ---- [TestMethod] - public void Distance_FromKilometer_Scales_By_1000() + public void Distance_FromKilometers_Scales_By_1000() { - Distance d = Distance.FromKilometer(1.0); + Distance d = Distance.FromKilometers(1.0); Assert.AreEqual(1000.0, d.Value, Tolerance); } [TestMethod] - public void Diameter_FromMillimeter_Scales_By_0_001() + public void Diameter_FromMillimeters_Scales_By_0_001() { - Diameter d = Diameter.FromMillimeter(1.0); + Diameter d = Diameter.FromMillimeters(1.0); Assert.AreEqual(0.001, d.Value, Tolerance); } [TestMethod] - public void Wavelength_FromNanometer_Uses_Nano_Magnitude() + public void Wavelength_FromNanometers_Uses_Nano_Magnitude() { - Wavelength w = Wavelength.FromNanometer(550.0); + Wavelength w = Wavelength.FromNanometers(550.0); Assert.AreEqual(550.0e-9, w.Value, 1e-15); } // ---- Storage genericity ---- [TestMethod] - public void Length_FromKilometer_Works_With_Float() + public void Length_FromKilometers_Works_With_Float() { - Length l = Length.FromKilometer(1.0f); + Length l = Length.FromKilometers(1.0f); Assert.AreEqual(1000.0f, l.Value, 1e-3f); } [TestMethod] - public void Length_FromFoot_Works_With_Decimal() + public void Length_FromFeet_Works_With_Decimal() { - Length l = Length.FromFoot(1m); + Length l = Length.FromFeet(1m); Assert.AreEqual(0.3048m, l.Value); } } diff --git a/Semantics.Test/Quantities/SemanticOverloadTests.cs b/Semantics.Test/Quantities/SemanticOverloadTests.cs index 0d256af..77cfc28 100644 --- a/Semantics.Test/Quantities/SemanticOverloadTests.cs +++ b/Semantics.Test/Quantities/SemanticOverloadTests.cs @@ -21,7 +21,7 @@ public sealed class SemanticOverloadTests [TestMethod] public void Weight_Widens_Implicitly_To_ForceMagnitude() { - Weight w = Weight.FromNewton(686.0); + Weight w = Weight.FromNewtons(686.0); ForceMagnitude baseValue = w; // implicit conversion Assert.AreEqual(686.0, baseValue.Value, Tolerance); } @@ -29,7 +29,7 @@ public void Weight_Widens_Implicitly_To_ForceMagnitude() [TestMethod] public void Distance_Widens_Implicitly_To_Length() { - Distance d = Distance.FromMeter(42.0); + Distance d = Distance.FromMeters(42.0); Length len = d; Assert.AreEqual(42.0, len.Value, Tolerance); } @@ -37,7 +37,7 @@ public void Distance_Widens_Implicitly_To_Length() [TestMethod] public void Diameter_Widens_Implicitly_To_Length() { - Diameter diam = Diameter.FromMeter(10.0); + Diameter diam = Diameter.FromMeters(10.0); Length len = diam; Assert.AreEqual(10.0, len.Value, Tolerance); } @@ -47,7 +47,7 @@ public void Diameter_Widens_Implicitly_To_Length() [TestMethod] public void ForceMagnitude_Narrows_Explicitly_To_Weight() { - ForceMagnitude fm = ForceMagnitude.FromNewton(686.0); + ForceMagnitude fm = ForceMagnitude.FromNewtons(686.0); Weight w = (Weight)fm; Assert.AreEqual(686.0, w.Value, Tolerance); } @@ -55,7 +55,7 @@ public void ForceMagnitude_Narrows_Explicitly_To_Weight() [TestMethod] public void Length_Narrows_Explicitly_To_Distance() { - Length len = Length.FromMeter(42.0); + Length len = Length.FromMeters(42.0); Distance d = (Distance)len; Assert.AreEqual(42.0, d.Value, Tolerance); } @@ -65,7 +65,7 @@ public void Length_Narrows_Explicitly_To_Distance() [TestMethod] public void Weight_From_ForceMagnitude_Constructs() { - ForceMagnitude fm = ForceMagnitude.FromNewton(100.0); + ForceMagnitude fm = ForceMagnitude.FromNewtons(100.0); Weight w = Weight.From(fm); Assert.AreEqual(100.0, w.Value, Tolerance); } @@ -73,7 +73,7 @@ public void Weight_From_ForceMagnitude_Constructs() [TestMethod] public void Distance_From_Length_Constructs() { - Length len = Length.FromMeter(7.0); + Length len = Length.FromMeters(7.0); Distance d = Distance.From(len); Assert.AreEqual(7.0, d.Value, Tolerance); } @@ -83,7 +83,7 @@ public void Distance_From_Length_Constructs() [TestMethod] public void Weight_RoundTrip_Through_ForceMagnitude_Preserves_Value() { - Weight original = Weight.FromNewton(123.456); + Weight original = Weight.FromNewtons(123.456); ForceMagnitude widened = original; Weight narrowed = (Weight)widened; Assert.AreEqual(original.Value, narrowed.Value, Tolerance); @@ -94,7 +94,7 @@ public void Weight_RoundTrip_Through_ForceMagnitude_Preserves_Value() [TestMethod] public void Diameter_ToRadius_Halves_Value() { - Diameter d = Diameter.FromMeter(10.0); + Diameter d = Diameter.FromMeters(10.0); Radius r = d.ToRadius(); Assert.AreEqual(5.0, r.Value, Tolerance); } @@ -102,7 +102,7 @@ public void Diameter_ToRadius_Halves_Value() [TestMethod] public void Diameter_FromRadius_Doubles_Value() { - Radius r = Radius.FromMeter(5.0); + Radius r = Radius.FromMeters(5.0); Diameter d = Diameter.FromRadius(r); Assert.AreEqual(10.0, d.Value, Tolerance); } @@ -110,7 +110,7 @@ public void Diameter_FromRadius_Doubles_Value() [TestMethod] public void Diameter_RoundTrip_Through_Radius_Preserves_Value() { - Diameter d = Diameter.FromMeter(20.0); + Diameter d = Diameter.FromMeters(20.0); Radius r = d.ToRadius(); Diameter back = Diameter.FromRadius(r); Assert.AreEqual(d.Value, back.Value, Tolerance); @@ -125,8 +125,8 @@ public void Diameter_RoundTrip_Through_Radius_Preserves_Value() [TestMethod] public void Weight_Minus_Weight_Currently_Returns_Force1D_PendingFix52() { - Weight a = Weight.FromNewton(100.0); - Weight b = Weight.FromNewton(150.0); + Weight a = Weight.FromNewtons(100.0); + Weight b = Weight.FromNewtons(150.0); Force1D diff = a - b; // current generator behaviour; #52 plans Weight of |a - b|. Assert.AreEqual(-50.0, diff.Value, Tolerance); } @@ -136,7 +136,7 @@ public void Weight_Minus_Weight_Currently_Returns_Force1D_PendingFix52() [TestMethod] public void Diameter_ToRadius_Works_With_Float_Storage() { - Diameter d = Diameter.FromMeter(10.0f); + Diameter d = Diameter.FromMeters(10.0f); Radius r = d.ToRadius(); Assert.AreEqual(5.0f, r.Value, 1e-6f); } @@ -144,7 +144,7 @@ public void Diameter_ToRadius_Works_With_Float_Storage() [TestMethod] public void Diameter_ToRadius_Works_With_Decimal_Storage() { - Diameter d = Diameter.FromMeter(10m); + Diameter d = Diameter.FromMeters(10m); Radius r = d.ToRadius(); Assert.AreEqual(5m, r.Value); } diff --git a/Semantics.Test/Quantities/Vector0InvariantTests.cs b/Semantics.Test/Quantities/Vector0InvariantTests.cs index 186e2f8..d053a41 100644 --- a/Semantics.Test/Quantities/Vector0InvariantTests.cs +++ b/Semantics.Test/Quantities/Vector0InvariantTests.cs @@ -27,16 +27,16 @@ public void Speed_FromMetersPerSecond_Negative_Throws() => _ = Assert.ThrowsExactly(() => Speed.FromMetersPerSecond(-1.0)); [TestMethod] - public void Mass_FromKilogram_Negative_Throws() - => _ = Assert.ThrowsExactly(() => Mass.FromKilogram(-0.5)); + public void Mass_FromKilograms_Negative_Throws() + => _ = Assert.ThrowsExactly(() => Mass.FromKilograms(-0.5)); [TestMethod] - public void Length_FromMeter_Negative_Throws() - => _ = Assert.ThrowsExactly(() => Length.FromMeter(-3.0)); + public void Length_FromMeters_Negative_Throws() + => _ = Assert.ThrowsExactly(() => Length.FromMeters(-3.0)); [TestMethod] - public void Energy_FromJoule_Negative_Throws() - => _ = Assert.ThrowsExactly(() => Energy.FromJoule(-100.0)); + public void Energy_FromJoules_Negative_Throws() + => _ = Assert.ThrowsExactly(() => Energy.FromJoules(-100.0)); [TestMethod] public void Speed_FromMetersPerSecond_Zero_Allowed() @@ -46,21 +46,21 @@ public void Speed_FromMetersPerSecond_Zero_Allowed() } [TestMethod] - public void Mass_FromKilogram_Positive_Returns_Same_Value() + public void Mass_FromKilograms_Positive_Returns_Same_Value() { - Mass m = Mass.FromKilogram(2.5); + Mass m = Mass.FromKilograms(2.5); Assert.AreEqual(2.5, m.Value, Tolerance); } // V0 overloads inherit non-negativity from their dimension. [TestMethod] - public void Distance_FromMeter_Negative_Throws() - => _ = Assert.ThrowsExactly(() => Distance.FromMeter(-1.0)); + public void Distance_FromMeters_Negative_Throws() + => _ = Assert.ThrowsExactly(() => Distance.FromMeters(-1.0)); [TestMethod] - public void Weight_FromNewton_Negative_Throws() - => _ = Assert.ThrowsExactly(() => Weight.FromNewton(-9.81)); + public void Weight_FromNewtons_Negative_Throws() + => _ = Assert.ThrowsExactly(() => Weight.FromNewtons(-9.81)); // V1 quantities are signed and accept any input. @@ -72,29 +72,29 @@ public void Velocity1D_FromMetersPerSecond_Negative_Allowed() } [TestMethod] - public void TemperatureDelta_FromKelvin_Negative_Allowed() + public void TemperatureDelta_FromKelvins_Negative_Allowed() { - TemperatureDelta dt = TemperatureDelta.FromKelvin(-10.0); + TemperatureDelta dt = TemperatureDelta.FromKelvins(-10.0); Assert.AreEqual(-10.0, dt.Value, Tolerance); } // Storage-type genericity for the guard. [TestMethod] - public void Mass_FromKilogram_Negative_Throws_With_Float() - => _ = Assert.ThrowsExactly(() => Mass.FromKilogram(-1.0f)); + public void Mass_FromKilograms_Negative_Throws_With_Float() + => _ = Assert.ThrowsExactly(() => Mass.FromKilograms(-1.0f)); [TestMethod] - public void Mass_FromKilogram_Negative_Throws_With_Decimal() - => _ = Assert.ThrowsExactly(() => Mass.FromKilogram(-1m)); + public void Mass_FromKilograms_Negative_Throws_With_Decimal() + => _ = Assert.ThrowsExactly(() => Mass.FromKilograms(-1m)); // =========================================================== #52: Absolute subtraction [TestMethod] public void Mass_Minus_Larger_Mass_Returns_Mass_Of_Absolute_Difference() { - Mass small = Mass.FromKilogram(3.0); - Mass large = Mass.FromKilogram(5.0); + Mass small = Mass.FromKilograms(3.0); + Mass large = Mass.FromKilograms(5.0); Mass diff = small - large; Assert.AreEqual(2.0, diff.Value, Tolerance); Assert.IsInstanceOfType>(diff); @@ -103,8 +103,8 @@ public void Mass_Minus_Larger_Mass_Returns_Mass_Of_Absolute_Difference() [TestMethod] public void Mass_Minus_Smaller_Mass_Returns_Positive_Mass() { - Mass large = Mass.FromKilogram(5.0); - Mass small = Mass.FromKilogram(3.0); + Mass large = Mass.FromKilograms(5.0); + Mass small = Mass.FromKilograms(3.0); Mass diff = large - small; Assert.AreEqual(2.0, diff.Value, Tolerance); } @@ -121,8 +121,8 @@ public void Speed_Minus_Speed_Returns_Speed_Of_Absolute_Difference() [TestMethod] public void Length_Minus_Length_Returns_Length() { - Length a = Length.FromMeter(7.0); - Length b = Length.FromMeter(2.0); + Length a = Length.FromMeters(7.0); + Length b = Length.FromMeters(2.0); Length diff = a - b; Assert.AreEqual(5.0, diff.Value, Tolerance); } @@ -132,8 +132,8 @@ public void Length_Minus_Length_Returns_Length() [TestMethod] public void Weight_Minus_Weight_Stays_Weight_With_Absolute_Difference() { - Weight a = Weight.FromNewton(100.0); - Weight b = Weight.FromNewton(150.0); + Weight a = Weight.FromNewtons(100.0); + Weight b = Weight.FromNewtons(150.0); Weight diff = a - b; Assert.AreEqual(50.0, diff.Value, Tolerance); Assert.IsInstanceOfType>(diff); @@ -142,8 +142,8 @@ public void Weight_Minus_Weight_Stays_Weight_With_Absolute_Difference() [TestMethod] public void Distance_Minus_Distance_Stays_Distance() { - Distance a = Distance.FromMeter(2.5); - Distance b = Distance.FromMeter(7.5); + Distance a = Distance.FromMeters(2.5); + Distance b = Distance.FromMeters(7.5); Distance diff = a - b; Assert.AreEqual(5.0, diff.Value, Tolerance); Assert.IsInstanceOfType>(diff); @@ -154,8 +154,8 @@ public void Distance_Minus_Distance_Stays_Distance() [TestMethod] public void Mass_Minus_Mass_With_Float_Storage() { - Mass a = Mass.FromKilogram(1.0f); - Mass b = Mass.FromKilogram(4.0f); + Mass a = Mass.FromKilograms(1.0f); + Mass b = Mass.FromKilograms(4.0f); Mass diff = a - b; Assert.AreEqual(3.0f, diff.Value, 1e-6f); } @@ -163,8 +163,8 @@ public void Mass_Minus_Mass_With_Float_Storage() [TestMethod] public void Mass_Minus_Mass_With_Decimal_Storage() { - Mass a = Mass.FromKilogram(1m); - Mass b = Mass.FromKilogram(4m); + Mass a = Mass.FromKilograms(1m); + Mass b = Mass.FromKilograms(4m); Mass diff = a - b; Assert.AreEqual(3m, diff.Value); } diff --git a/Semantics.Test/Quantities/VectorQuantityTests.cs b/Semantics.Test/Quantities/VectorQuantityTests.cs index 492952d..cd7307f 100644 --- a/Semantics.Test/Quantities/VectorQuantityTests.cs +++ b/Semantics.Test/Quantities/VectorQuantityTests.cs @@ -148,8 +148,8 @@ public void Force3D_Negation_Inverts_Each_Component() [TestMethod] public void Mass_Plus_Mass_Returns_Mass() { - Mass a = Mass.FromKilogram(3.0); - Mass b = Mass.FromKilogram(5.0); + Mass a = Mass.FromKilograms(3.0); + Mass b = Mass.FromKilograms(5.0); Mass sum = a + b; Assert.AreEqual(8.0, sum.Value, Tolerance); Assert.IsInstanceOfType>(sum); @@ -173,8 +173,8 @@ public void Speed_Plus_Speed_Returns_Speed() [Ignore("Locked in #52: V0 - V0 should return the same V0 of T.Abs(a - b). Generator currently emits unsigned subtraction.")] public void Mass_Minus_Mass_Returns_Absolute_Difference_Pending52() { - Mass a = Mass.FromKilogram(3.0); - Mass b = Mass.FromKilogram(5.0); + Mass a = Mass.FromKilograms(3.0); + Mass b = Mass.FromKilograms(5.0); Mass diff = a - b; Assert.AreEqual(2.0, diff.Value, Tolerance); } @@ -196,7 +196,7 @@ public void Speed_From_Negative_Throws_Pending50() public void Mass_From_Negative_Throws_Pending50() { _ = Assert.ThrowsExactly( - () => Mass.FromKilogram(-1.0)); + () => Mass.FromKilograms(-1.0)); } // -------------------------------------------------- Magnitude on V1 diff --git a/docs/complete-library-guide.md b/docs/complete-library-guide.md index f12200c..6a8f474 100644 --- a/docs/complete-library-guide.md +++ b/docs/complete-library-guide.md @@ -144,17 +144,17 @@ The model and its rationale live in `strategy-unified-vector-quantities.md`. Rul ```csharp // Vector0 — magnitudes (non-negative) var speed = Speed.FromMetersPerSecond(15.0); -var mass = Mass.FromKilogram(10.0); -var distance = Distance.FromMeter(5.0); -var energy = Energy.FromJoule(1_000.0); +var mass = Mass.FromKilograms(10.0); +var distance = Distance.FromMeters(5.0); +var energy = Energy.FromJoules(1_000.0); // Vector1 — signed scalar var v1 = Velocity1D.FromMetersPerSecond(-3.5); -var temp = Temperature.FromKelvin(300.0); +var temp = Temperature.FromKelvins(300.0); // Vector3 — directional -var force3d = Force3D.FromNewton(0.0, 0.0, -9.8); -var disp3d = Displacement3D.FromMeter(3.0, 4.0, 0.0); +var force3d = Force3D.FromNewtons(0.0, 0.0, -9.8); +var disp3d = Displacement3D.FromMeters(3.0, 4.0, 0.0); ``` ### Operators and dimensional analysis @@ -163,9 +163,9 @@ Cross-dimensional operators are declared in `dimensions.json` and emitted automa ```csharp // V0 × V0 (magnitudes) -var force = mass * Acceleration.FromMeter(9.8); // Mass × Accel = Force -var work = ForceMagnitude.FromNewton(10.0) * distance; // F·d = Energy -var power = work / Duration.FromSecond(2.0); // W/t = Power +var force = mass * Acceleration.FromMeters(9.8); // Mass × Accel = Force +var work = ForceMagnitude.FromNewtons(10.0) * distance; // F·d = Energy +var power = work / Duration.FromSeconds(2.0); // W/t = Power // Vector ops var workScalar = force3d.Dot(disp3d); // Energy @@ -183,7 +183,7 @@ Several dimensions declare narrower-named overloads with implicit widening: ```csharp var w = Weight.From(force); // Weight is a ForceMagnitude var fm = ForceMagnitude.From(w); // implicit widening also OK -var d = Distance.FromMeter(10.0); +var d = Distance.FromMeters(10.0); var rad = Radius.From(d); var dia = rad.ToDiameter(); // 20m via metadata-defined relationship ``` diff --git a/docs/physics-domains-guide.md b/docs/physics-domains-guide.md index f97162b..5e1a381 100644 --- a/docs/physics-domains-guide.md +++ b/docs/physics-domains-guide.md @@ -29,10 +29,10 @@ Seven base dimensions: - `LuminousIntensity` — V0. ```csharp -var height = Height.FromMeter(1.75); -var atomic = AtomicMass.FromKilogram(1.66e-27); -var lifetime = Lifetime.FromSecond(3600); -var temp = Temperature.FromKelvin(298.15); +var height = Height.FromMeters(1.75); +var atomic = AtomicMass.FromKilograms(1.66e-27); +var lifetime = Lifetime.FromSeconds(3600); +var temp = Temperature.FromKelvins(298.15); ``` ## Geometry and kinematics @@ -57,7 +57,7 @@ var sampling = SamplingRate.FromHertz(48_000); - `MomentOfInertia` — V0. ```csharp -var heading = Heading.FromRadian(Math.PI / 2); // V0 overload of AngularDisplacement +var heading = Heading.FromRadians(Math.PI / 2); // V0 overload of AngularDisplacement var omega3d = AngularVelocity3D.FromRadianPerSecond(0.0, 0.0, 1.5); ``` @@ -71,9 +71,9 @@ var omega3d = AngularVelocity3D.FromRadianPerSecond(0.0, 0.0, 1.5); - `Density` — V0. ```csharp -var weight = Weight.From(ForceMagnitude.FromNewton(686.0)); -var drag = Drag.FromNewton(20.0); -var pe = PotentialEnergy.FromJoule(500.0); +var weight = Weight.From(ForceMagnitude.FromNewtons(686.0)); +var drag = Drag.FromNewtons(20.0); +var pe = PotentialEnergy.FromJoules(500.0); ``` ## Thermal @@ -96,8 +96,8 @@ Heat itself is currently expressed via `Energy` (and its `ThermalEnergy` overloa - `MagneticFlux` — V0. ```csharp -var v = Voltage.FromVolt(12.0); -var i = ElectricCurrent.FromAmpere(2.0); +var v = Voltage.FromVolts(12.0); +var i = ElectricCurrent.FromAmperes(2.0); var r = v / i; // ElectricResistance var p = v * i; // Power ``` @@ -110,8 +110,8 @@ var p = v * i; // Power - `Irradiance` — V0 with overloads `RadiantExitance`, `Radiance`, `RadiantIntensity`. ```csharp -var flux = LuminousFlux.FromLumen(800.0); -var lux = flux / Area.FromSquareMeter(4.0); // Illuminance +var flux = LuminousFlux.FromLumens(800.0); +var lux = flux / Area.FromSquareMeters(4.0); // Illuminance ``` ## Acoustic @@ -143,8 +143,8 @@ var T = f.Period(); // Time - `MolarEnergy` — V0 with overloads `ActivationEnergy`, `EnthalpyOfReaction`. ```csharp -var n = AmountOfSubstance.FromMole(0.5); -var V = Volume.FromCubicMeter(0.002); // 2 L +var n = AmountOfSubstance.FromMoles(0.5); +var V = Volume.FromCubicMeters(0.002); // 2 L var M = n / V; // Concentration ``` @@ -172,22 +172,22 @@ Speed s = v.Magnitude(); // 5.0, always >= 0 ### Cross product (V3 only) ```csharp -Force3D F = Force3D.FromNewton(0.0, 10.0, 0.0); -Displacement3D r = Displacement3D.FromMeter(0.5, 0.0, 0.0); +Force3D F = Force3D.FromNewtons(0.0, 10.0, 0.0); +Displacement3D r = Displacement3D.FromMeters(0.5, 0.0, 0.0); Torque3D τ = F.Cross(r); ``` ### Dot product ```csharp -Energy work = Force3D.FromNewton(10.0, 0.0, 0.0) - .Dot(Displacement3D.FromMeter(2.0, 0.0, 0.0)); // 20 J +Energy work = Force3D.FromNewtons(10.0, 0.0, 0.0) + .Dot(Displacement3D.FromMeters(2.0, 0.0, 0.0)); // 20 J ``` ### Semantic overload narrowing ```csharp -ForceMagnitude raw = ForceMagnitude.FromNewton(686.0); +ForceMagnitude raw = ForceMagnitude.FromNewtons(686.0); Weight weight = Weight.From(raw); // explicit narrow ForceMagnitude back = weight; // implicit widen ``` @@ -196,9 +196,9 @@ ForceMagnitude back = weight; // implicit widen ```csharp var R = PhysicalConstants.Generic.GasConstant(); // J/(mol·K) -var n = AmountOfSubstance.FromMole(1.0); -var T = Temperature.FromKelvin(273.15); -var P = Pressure.FromPascal(101_325.0); +var n = AmountOfSubstance.FromMoles(1.0); +var T = Temperature.FromKelvins(273.15); +var P = Pressure.FromPascals(101_325.0); // PV = nRT → V = nRT / P // (constants flow into operators because everything stores SI base units) diff --git a/docs/strategy-unified-vector-quantities.md b/docs/strategy-unified-vector-quantities.md index 86bc80a..55232cd 100644 --- a/docs/strategy-unified-vector-quantities.md +++ b/docs/strategy-unified-vector-quantities.md @@ -58,6 +58,20 @@ IQuantity // Root: all quantities └── ... ``` +### Form Coverage Matrix + +Not every dimension declares every form. The coverage is intentional and follows three patterns; new dimensions should pick the matching one: + +| Dimension family | Forms | Rationale | +|---|---|---| +| Linear motion: `Length`, `Velocity`, `Acceleration`, `Jerk`, `Snap`, `Force`, `Momentum`, `Displacement`, `ElectricField` | V0–V4 | Pure linear vectors; every dimensionality is meaningful. | +| Angular motion: `AngularDisplacement`, `AngularVelocity`, `AngularAcceleration`, `AngularJerk`, `Torque`, `AngularMomentum` | V0, V1, V3 | Pseudovectors. 2D / 4D forms aren't physically meaningful; skip them. | +| Electric current: `ElectricCurrent` | V0, V1, V3 | Same as angular — no 2D current. | +| Scalar-only: `Mass`, `Energy`, `Area`, `Volume`, `Time`, `Frequency`, `RadioactiveActivity`, `MomentOfInertia`, etc. | V0 (sometimes + V1) | Inherently scalar. Add V1 only when a signed *delta* makes physical sense (e.g. `Temperature` (V0) + `TemperatureDelta` (V1), `ElectricCharge` is V1 because charge is signed). | +| Dimensionless / angular ratios: `Dimensionless` | V0 (`Ratio`) + V1 (`SignedRatio`) | Lets ratios that semantically must be non-negative (e.g. `MachNumber`, `RefractiveIndex`) be V0 overloads of `Ratio`, and signed ratios use `SignedRatio`. | + +When you declare a relationship (`integrals` / `derivatives` / `dotProducts` / `crossProducts`) the generator only emits operators for forms that exist on **both** sides — e.g. a dot product between two dimensions that both declare V3 emits the V3 dot product, while V2 is silently skipped if either side is missing. Keep this in mind when adding a new dimension: if you need it to participate in a particular relationship form, it must declare that form. + ## Semantic Relationships ### Magnitude Extraction