26.06.03
This commit is contained in:
@@ -1,231 +1,231 @@
|
||||
namespace QWERTYkez.Mensura.Units;
|
||||
//namespace QWERTYkez.Mensura.Units;
|
||||
|
||||
internal static class OperationsExtension
|
||||
{
|
||||
internal static TResult MultiplyProtected<T1, T2, TResult>(this T1 t1, T2 t2)
|
||||
where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
=> new() { Value = t1.Value * t2.Value };
|
||||
|
||||
internal static TResult MultiplyProtected<T1, T2, TResult>(this T1 t1, T2 t2, double multiplicator)
|
||||
where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
=> new() { Value = t1.Value * t2.Value * multiplicator };
|
||||
|
||||
internal static TResult DivideProtected<T1, T2, TResult>(this T1 t1, T2 t2)
|
||||
where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
=> new() { Value = t1.Value / t2.Value };
|
||||
|
||||
internal static TResult DivideProtected<T1, T2, TResult>(this T1 t1, T2 t2, double multiplicator)
|
||||
where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
=> new() { Value = t1.Value * multiplicator / t2.Value };
|
||||
}
|
||||
|
||||
internal static class Coefficients
|
||||
{
|
||||
internal static double MultiplyCoefficient<T1, T2, TResult>(T1 a, T2 b, TResult r)
|
||||
where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
=> r.Value / (a.Value * b.Value);
|
||||
|
||||
internal static double DivideCoefficient<T1, T2, TResult>(T1 a, T2 b, TResult r)
|
||||
where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
=> r.Value * b.Value / a.Value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct Length
|
||||
{
|
||||
[CollectionsOperatorsGenerator] public static Area operator *(Length left, Length right)
|
||||
=> left.MultiplyProtected<Length, Length, Area>(right, Coeff1);
|
||||
|
||||
static readonly double Coeff1 = Coefficients.MultiplyCoefficient(MilliMeter, MilliMeter, Area.MilliMeterSquared);
|
||||
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Volume operator *(Area left, Length right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Volume operator *(Length left, Area right)
|
||||
=> left.MultiplyProtected<Length, Area, Volume>(right, Coeff2);
|
||||
|
||||
static readonly double Coeff2 = Coefficients.MultiplyCoefficient(MilliMeter, Area.MilliMeterSquared, Volume.MilliMeterCubic);
|
||||
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Pressure operator *(Length left, UdelForce right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Pressure operator *(UdelForce left, Length right) => left.MultiplyProtected<UdelForce, Length, Pressure>(right, Coeff3);
|
||||
static readonly double Coeff3 = Coefficients.MultiplyCoefficient(a => a.PerMeterCubic.Newtons = 1, Length.Meter, Pressure.NewtonPerMeterSquared);
|
||||
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Force operator *(PogonForce left, Length right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Force operator *(Length left, PogonForce right) => left.MultiplyProtected<Length, PogonForce, Force>(right, Coeff4);
|
||||
static readonly double Coeff4 = Coefficients.MultiplyCoefficient(Length.Meter, b => b.PerMeter.Newtons = 1, Force.Newton);
|
||||
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Torque operator *(Force left, Length right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Torque operator *(Length left, Force right) => left.MultiplyProtected<Length, Force, Torque>(right, Coeff6);
|
||||
static readonly double Coeff6 = Coefficients.MultiplyCoefficient(Length.Meter, Force.Newton, Torque.Newton_Meter);
|
||||
}
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct Mass // Grams
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct Pressure // Pascals
|
||||
{
|
||||
[CollectionsOperatorsGenerator] public static Length operator /(Pressure left, UdelForce right) => left.DivideProtected<Pressure, UdelForce, Length>(right, Coeff1);
|
||||
static readonly double Coeff1 = Coefficients.DivideCoefficient(Pressure.Pascal, b => b.PerMeterCubic.Newtons = 1, Length.Meter);
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Force operator *(Pressure left, Area right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Force operator *(Area left, Pressure right) => left.MultiplyProtected<Area, Pressure, Force>(right, Coeff2);
|
||||
static readonly double Coeff2 = Coefficients.MultiplyCoefficient(Area.MeterSquared, Pressure.Pascal, Force.Newton);
|
||||
|
||||
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Length operator /(PogonForce left, Pressure right) => left.DivideProtected<PogonForce, Pressure, Length>(right, Coeff3);
|
||||
static readonly double Coeff3 = Coefficients.DivideCoefficient(a => a._PerMilliMeter.Newtons = 1, Pressure.NewtonPerMilliMeterSquared, Length.MilliMeter);
|
||||
|
||||
[CollectionsOperatorsGenerator] public static PogonForce operator *(Pressure left, Length right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static PogonForce operator *(Length left, Pressure right) => left.MultiplyProtected<Length, Pressure, PogonForce>(right, Coeff4);
|
||||
static readonly double Coeff4 = Coefficients.MultiplyCoefficient(Length.MilliMeter, Pressure.NewtonPerMilliMeterSquared, r => r._PerMilliMeter.Newtons = 1);
|
||||
}
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct Area // MilliMetersSquared
|
||||
{
|
||||
[CollectionsOperatorsGenerator] public static Torque operator *(PogonForce left, Area right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Torque operator *(Area left, PogonForce right) => left.MultiplyProtected<Area, PogonForce, Torque>(right, Coeff1);
|
||||
static readonly double Coeff1 = Coefficients.MultiplyCoefficient(Area.MeterSquared, b => b.PerMeter.Newtons = 1, Torque.Newton_Meter);
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Length operator /(Area left, Length right) => left.DivideProtected<Area, Length, Length>(right, Coeff2);
|
||||
static readonly double Coeff2 = Coefficients.DivideCoefficient(Area.MilliMeterSquared, Length.MilliMeter, Length.MilliMeter);
|
||||
}
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct Volume // MillimetersCubic
|
||||
{
|
||||
[CollectionsOperatorsGenerator] public static Mass operator *(Density left, Volume right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Mass operator *(Volume left, Density right) => left.MultiplyProtected<Volume, Density, Mass>(right, Coeff1);
|
||||
static readonly double Coeff1 = Coefficients.MultiplyCoefficient(Volume.MilliMeterCubic, b => b.PerMilliMeterCubic.Grams = 1, Time.Gram);
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Torque operator *(Pressure left, Volume right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Torque operator *(Volume left, Pressure right) => left.MultiplyProtected<Volume, Pressure, Torque>(right, Coeff2);
|
||||
static readonly double Coeff2 = Coefficients.MultiplyCoefficient(Volume.MeterCubic, Pressure.Pascal, Torque.Newton_Meter);
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Area operator /(Volume left, Length right) => left.DivideProtected<Volume, Length, Area>(right);
|
||||
[CollectionsOperatorsGenerator] public static Length operator /(Volume left, Area right) => left.DivideProtected<Volume, Area, Length>(right, Coeff3);
|
||||
static readonly double Coeff3 = Coefficients.DivideCoefficient(Volume.MilliMeterCubic, Length.MilliMeter, Area.MilliMeterSquared);
|
||||
}
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct Force // Newtons
|
||||
{
|
||||
[CollectionsOperatorsGenerator] public static Area operator /(Force left, Pressure right) => left.DivideProtected<Force, Pressure, Area>(right, Coeff1);
|
||||
static readonly double Coeff1 = Coefficients.DivideCoefficient(Force.Newton, Pressure.Pascal, Area.MeterSquared);
|
||||
[CollectionsOperatorsGenerator] public static Pressure operator /(Force left, Area right) => left.DivideProtected<Force, Area, Pressure>(right, Coeff2);
|
||||
static readonly double Coeff2 = Coefficients.DivideCoefficient(Force.Newton, Area.MeterSquared, Pressure.Pascal);
|
||||
|
||||
}
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct Torque // NewtonMeters
|
||||
{
|
||||
[CollectionsOperatorsGenerator] public static Length operator /(Torque left, Force right) => left.DivideProtected<Torque, Force, Length>(right, Coeff1);
|
||||
static readonly double Coeff1 = Coefficients.DivideCoefficient(Torque.Newton_Meter, Force.Newton, Length.Meter);
|
||||
[CollectionsOperatorsGenerator] public static Force operator /(Torque left, Length right) => left.DivideProtected<Torque, Length, Force>(right, Coeff2);
|
||||
static readonly double Coeff2 = Coefficients.DivideCoefficient(Torque.Newton_Meter, Length.Meter, Force.Newton);
|
||||
[CollectionsOperatorsGenerator] public static PogonForce operator /(Torque left, Area right) => left.DivideProtected<Torque, Area, PogonForce>(right, Coeff3);
|
||||
static readonly double Coeff3 = Coefficients.DivideCoefficient(Torque.Newton_Meter, Area.MilliMeterSquared, r => r.PerMilliMeter.KiloNewtons = 1);
|
||||
[CollectionsOperatorsGenerator] public static Pressure operator /(Torque left, Volume right) => left.DivideProtected<Torque, Volume, Pressure>(right, Coeff4);
|
||||
static readonly double Coeff4 = Coefficients.DivideCoefficient(Torque.Newton_Meter, Volume.MeterCubic, Pressure.Pascal);
|
||||
[CollectionsOperatorsGenerator] public static Volume operator /(Torque left, Pressure right) => left.DivideProtected<Torque, Pressure, Volume>(right, Coeff5);
|
||||
static readonly double Coeff5 = Coefficients.DivideCoefficient(Torque.Newton_Meter, Pressure.Pascal, Volume.MeterCubic);
|
||||
}
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct Frequency // Hertz
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct Time
|
||||
{
|
||||
[CollectionsOperatorsGenerator] public static Speed operator *(Boost left, Time right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Speed operator *(Time left, Boost right) => left.MultiplyProtected<Time, Boost, Speed>(right, Coeff1);
|
||||
static readonly double Coeff1 = Coefficients.MultiplyCoefficient(Time.Second, Boost.MeterPerSecondSquared, Speed.MeterPerSecond);
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Speed operator /(Length left, Time right) => left.DivideProtected<Length, Time, Speed>(right, Coeff2);
|
||||
static readonly double Coeff2 = Coefficients.DivideCoefficient(Length.Meter, Time.Second, Speed.MeterPerSecond);
|
||||
}
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct Speed
|
||||
{
|
||||
[CollectionsOperatorsGenerator] public static Length operator *(Speed left, Time right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Length operator *(Time left, Speed right) => left.MultiplyProtected<Time, Speed, Length>(right, Coeff1);
|
||||
static readonly double Coeff1 = Coefficients.MultiplyCoefficient(Time.Second, Speed.MeterPerSecond, Length.Meter);
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Boost operator /(Speed left, Time right) => left.DivideProtected<Speed, Time, Boost>(right, Coeff2);
|
||||
static readonly double Coeff2 = Coefficients.DivideCoefficient(Speed.MeterPerSecond, Time.Second, Boost.MeterPerSecondSquared);
|
||||
}
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct Boost
|
||||
{
|
||||
[CollectionsOperatorsGenerator] public static Force operator *(Mass left, Boost right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Force operator *(Boost left, Mass right) => left.MultiplyProtected<Boost, Mass, Force>(right, Coeff1);
|
||||
static readonly double Coeff1 = Coefficients.MultiplyCoefficient(Boost.MeterPerSecondSquared, Time.KiloGram, Force.Newton);
|
||||
|
||||
[CollectionsOperatorsGenerator] public static PogonForce operator *(PogonMass left, Boost right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static PogonForce operator *(Boost left, PogonMass right) => left.MultiplyProtected<Boost, PogonMass, PogonForce>(right, Coeff2);
|
||||
static readonly double Coeff2 = Coefficients.MultiplyCoefficient(Boost.MeterPerSecondSquared, b => b.PerMilliMeter.KiloGrams = 1, r => r.PerMilliMeter.Newtons = 1);
|
||||
|
||||
[CollectionsOperatorsGenerator] public static UdelForce operator *(Density left, Boost right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static UdelForce operator *(Boost left, Density right) => left.MultiplyProtected<Boost, Density, UdelForce>(right, Coeff3);
|
||||
static readonly double Coeff3 = Coefficients.MultiplyCoefficient(Boost.MeterPerSecondSquared, b => b.PerMilliMeterCubic.KiloGrams = 1, r => r.PerMilliMeterCubic.Newtons = 1);
|
||||
|
||||
|
||||
[CollectionsOperatorsGenerator] public static PogonMass operator /(PogonForce left, Boost right) => left.DivideProtected<PogonForce, Boost, PogonMass>(right, Coeff4);
|
||||
static readonly double Coeff4 = Coefficients.DivideCoefficient(a => a.PerMilliMeter.Newtons = 1, Boost.MeterPerSecondSquared, r => r.PerMilliMeter.KiloGrams = 1);
|
||||
|
||||
[CollectionsOperatorsGenerator] public static Density operator /(UdelForce left, Boost right) => left.DivideProtected<UdelForce, Boost, Density>(right, Coeff5);
|
||||
static readonly double Coeff5 = Coefficients.DivideCoefficient(a => a.PerMilliMeterCubic.Newtons = 1, Boost.MeterPerSecondSquared, r => r.PerMilliMeterCubic.KiloGrams = 1);
|
||||
|
||||
|
||||
[CollectionsOperatorsGenerator] public static MassPerSquare operator /(Pressure left, Boost right) => left.DivideProtected<Pressure, Boost, MassPerSquare>(right, Coeff6);
|
||||
static readonly double Coeff6 = Coefficients.DivideCoefficient(Pressure.Pascal, Boost.MeterPerSecondSquared, MassPerSquare.KiloGramPerMeterSquared);
|
||||
}
|
||||
|
||||
[CollectionsOperatorsGenerator] public readonly partial record struct MassPerSquare
|
||||
{
|
||||
[CollectionsOperatorsGenerator] public static Pressure operator *(Boost left, MassPerSquare right) => right * left;
|
||||
[CollectionsOperatorsGenerator] public static Pressure operator *(MassPerSquare left, Boost right) => left.MultiplyProtected<MassPerSquare, Boost, Pressure>(right, Coeff1);
|
||||
static readonly double Coeff1 = Coefficients.MultiplyCoefficient(MassPerSquare.KiloGramPerMeterSquared, Boost.MeterPerSecondSquared, Pressure.Pascal);
|
||||
}
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct PogonForce : Pogon<PogonForce, Force>
|
||||
//internal static class OperationsExtension
|
||||
//{
|
||||
// internal static TResult MultiplyProtected<T1, T2, TResult>(this T1 t1, T2 t2)
|
||||
// where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
// where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
// where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
// => new() { Value = t1.Value * t2.Value };
|
||||
|
||||
// internal static TResult MultiplyProtected<T1, T2, TResult>(this T1 t1, T2 t2, double multiplicator)
|
||||
// where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
// where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
// where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
// => new() { Value = t1.Value * t2.Value * multiplicator };
|
||||
|
||||
// internal static TResult DivideProtected<T1, T2, TResult>(this T1 t1, T2 t2)
|
||||
// where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
// where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
// where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
// => new() { Value = t1.Value / t2.Value };
|
||||
|
||||
// internal static TResult DivideProtected<T1, T2, TResult>(this T1 t1, T2 t2, double multiplicator)
|
||||
// where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
// where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
// where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
// => new() { Value = t1.Value * multiplicator / t2.Value };
|
||||
//}
|
||||
|
||||
//internal static class Coefficients
|
||||
//{
|
||||
// internal static double MultiplyCoefficient<T1, T2, TResult>(T1 a, T2 b, TResult r)
|
||||
// where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
// where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
// where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
// => r.Value / (a.Value * b.Value);
|
||||
|
||||
// internal static double DivideCoefficient<T1, T2, TResult>(T1 a, T2 b, TResult r)
|
||||
// where T1 : struct, IMensuraUnit<T1>, IEquatable<T1>, IMensuraUnit
|
||||
// where T2 : struct, IMensuraUnit<T2>, IEquatable<T2>, IMensuraUnit
|
||||
// where TResult : struct, IMensuraUnit<TResult>, IEquatable<TResult>, IMensuraUnit
|
||||
// => r.Value * b.Value / a.Value;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Length
|
||||
//{
|
||||
// [CollectionsOperatorsGenerator] public static Area operator *(Length left, Length right)
|
||||
// => left.MultiplyProtected<Length, Length, Area>(right, Coeff1);
|
||||
|
||||
// static readonly double Coeff1 = Coefficients.MultiplyCoefficient(MilliMeter, MilliMeter, Area.MilliMeterSquared);
|
||||
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static Volume operator *(Area left, Length right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Volume operator *(Length left, Area right)
|
||||
// => left.MultiplyProtected<Length, Area, Volume>(right, Coeff2);
|
||||
|
||||
// static readonly double Coeff2 = Coefficients.MultiplyCoefficient(MilliMeter, Area.MilliMeterSquared, Volume.MilliMeterCubic);
|
||||
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static Pressure operator *(Length left, UdelForce right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Pressure operator *(UdelForce left, Length right) => left.MultiplyProtected<UdelForce, Length, Pressure>(right, Coeff3);
|
||||
// static readonly double Coeff3 = Coefficients.MultiplyCoefficient(a => a.PerMeterCubic.Newtons = 1, Length.Meter, Pressure.NewtonPerMeterSquared);
|
||||
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static Force operator *(PogonForce left, Length right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Force operator *(Length left, PogonForce right) => left.MultiplyProtected<Length, PogonForce, Force>(right, Coeff4);
|
||||
// static readonly double Coeff4 = Coefficients.MultiplyCoefficient(Length.Meter, b => b.PerMeter.Newtons = 1, Force.Newton);
|
||||
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static Torque operator *(Force left, Length right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Torque operator *(Length left, Force right) => left.MultiplyProtected<Length, Force, Torque>(right, Coeff6);
|
||||
// static readonly double Coeff6 = Coefficients.MultiplyCoefficient(Length.Meter, Force.Newton, Torque.Newton_Meter);
|
||||
//}
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Mass // Grams
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct PogonMass : Pogon<PogonMass, Mass>
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Pressure // Pascals
|
||||
//{
|
||||
// [CollectionsOperatorsGenerator] public static Boost operator /(PogonForce left, PogonMass right) => left.DivideProtected<PogonForce, PogonMass, Boost>(right, Coeff1);
|
||||
// [CollectionsOperatorsGenerator] public static Length operator /(Pressure left, UdelForce right) => left.DivideProtected<Pressure, UdelForce, Length>(right, Coeff1);
|
||||
// static readonly double Coeff1 = Coefficients.DivideCoefficient(Pressure.Pascal, b => b.PerMeterCubic.Newtons = 1, Length.Meter);
|
||||
|
||||
// static readonly double Coeff1 = Coefficients.DivideCoefficient(a => a.PerMilliMeter.Newtons = 1, b => b.PerMilliMeter.KiloGrams = 1, Boost.MeterPerSecondSquared);
|
||||
// [CollectionsOperatorsGenerator] public static Force operator *(Pressure left, Area right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Force operator *(Area left, Pressure right) => left.MultiplyProtected<Area, Pressure, Force>(right, Coeff2);
|
||||
// static readonly double Coeff2 = Coefficients.MultiplyCoefficient(Area.MeterSquared, Pressure.Pascal, Force.Newton);
|
||||
|
||||
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static Length operator /(PogonForce left, Pressure right) => left.DivideProtected<PogonForce, Pressure, Length>(right, Coeff3);
|
||||
// static readonly double Coeff3 = Coefficients.DivideCoefficient(a => a._PerMilliMeter.Newtons = 1, Pressure.NewtonPerMilliMeterSquared, Length.MilliMeter);
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static PogonForce operator *(Pressure left, Length right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static PogonForce operator *(Length left, Pressure right) => left.MultiplyProtected<Length, Pressure, PogonForce>(right, Coeff4);
|
||||
// static readonly double Coeff4 = Coefficients.MultiplyCoefficient(Length.MilliMeter, Pressure.NewtonPerMilliMeterSquared, r => r._PerMilliMeter.Newtons = 1);
|
||||
//}
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct UdelForce : Udel<UdelForce, Force>
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Area // MilliMetersSquared
|
||||
//{
|
||||
// [CollectionsOperatorsGenerator] public static Torque operator *(PogonForce left, Area right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Torque operator *(Area left, PogonForce right) => left.MultiplyProtected<Area, PogonForce, Torque>(right, Coeff1);
|
||||
// static readonly double Coeff1 = Coefficients.MultiplyCoefficient(Area.MeterSquared, b => b.PerMeter.Newtons = 1, Torque.Newton_Meter);
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static Length operator /(Area left, Length right) => left.DivideProtected<Area, Length, Length>(right, Coeff2);
|
||||
// static readonly double Coeff2 = Coefficients.DivideCoefficient(Area.MilliMeterSquared, Length.MilliMeter, Length.MilliMeter);
|
||||
//}
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Volume // MillimetersCubic
|
||||
//{
|
||||
// [CollectionsOperatorsGenerator] public static Mass operator *(Density left, Volume right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Mass operator *(Volume left, Density right) => left.MultiplyProtected<Volume, Density, Mass>(right, Coeff1);
|
||||
// static readonly double Coeff1 = Coefficients.MultiplyCoefficient(Volume.MilliMeterCubic, b => b.PerMilliMeterCubic.Grams = 1, Time.Gram);
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static Torque operator *(Pressure left, Volume right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Torque operator *(Volume left, Pressure right) => left.MultiplyProtected<Volume, Pressure, Torque>(right, Coeff2);
|
||||
// static readonly double Coeff2 = Coefficients.MultiplyCoefficient(Volume.MeterCubic, Pressure.Pascal, Torque.Newton_Meter);
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static Area operator /(Volume left, Length right) => left.DivideProtected<Volume, Length, Area>(right);
|
||||
// [CollectionsOperatorsGenerator] public static Length operator /(Volume left, Area right) => left.DivideProtected<Volume, Area, Length>(right, Coeff3);
|
||||
// static readonly double Coeff3 = Coefficients.DivideCoefficient(Volume.MilliMeterCubic, Length.MilliMeter, Area.MilliMeterSquared);
|
||||
//}
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Force // Newtons
|
||||
//{
|
||||
// [CollectionsOperatorsGenerator] public static Area operator /(Force left, Pressure right) => left.DivideProtected<Force, Pressure, Area>(right, Coeff1);
|
||||
// static readonly double Coeff1 = Coefficients.DivideCoefficient(Force.Newton, Pressure.Pascal, Area.MeterSquared);
|
||||
// [CollectionsOperatorsGenerator] public static Pressure operator /(Force left, Area right) => left.DivideProtected<Force, Area, Pressure>(right, Coeff2);
|
||||
// static readonly double Coeff2 = Coefficients.DivideCoefficient(Force.Newton, Area.MeterSquared, Pressure.Pascal);
|
||||
|
||||
//}
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Density : Udel<Density, Mass>
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Torque // NewtonMeters
|
||||
//{
|
||||
// [CollectionsOperatorsGenerator] public static Length operator /(Torque left, Force right) => left.DivideProtected<Torque, Force, Length>(right, Coeff1);
|
||||
// static readonly double Coeff1 = Coefficients.DivideCoefficient(Torque.Newton_Meter, Force.Newton, Length.Meter);
|
||||
// [CollectionsOperatorsGenerator] public static Force operator /(Torque left, Length right) => left.DivideProtected<Torque, Length, Force>(right, Coeff2);
|
||||
// static readonly double Coeff2 = Coefficients.DivideCoefficient(Torque.Newton_Meter, Length.Meter, Force.Newton);
|
||||
// [CollectionsOperatorsGenerator] public static PogonForce operator /(Torque left, Area right) => left.DivideProtected<Torque, Area, PogonForce>(right, Coeff3);
|
||||
// static readonly double Coeff3 = Coefficients.DivideCoefficient(Torque.Newton_Meter, Area.MilliMeterSquared, r => r.PerMilliMeter.KiloNewtons = 1);
|
||||
// [CollectionsOperatorsGenerator] public static Pressure operator /(Torque left, Volume right) => left.DivideProtected<Torque, Volume, Pressure>(right, Coeff4);
|
||||
// static readonly double Coeff4 = Coefficients.DivideCoefficient(Torque.Newton_Meter, Volume.MeterCubic, Pressure.Pascal);
|
||||
// [CollectionsOperatorsGenerator] public static Volume operator /(Torque left, Pressure right) => left.DivideProtected<Torque, Pressure, Volume>(right, Coeff5);
|
||||
// static readonly double Coeff5 = Coefficients.DivideCoefficient(Torque.Newton_Meter, Pressure.Pascal, Volume.MeterCubic);
|
||||
//}
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Frequency // Hertz
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
//}
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Time
|
||||
//{
|
||||
// [CollectionsOperatorsGenerator] public static Speed operator *(Boost left, Time right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Speed operator *(Time left, Boost right) => left.MultiplyProtected<Time, Boost, Speed>(right, Coeff1);
|
||||
// static readonly double Coeff1 = Coefficients.MultiplyCoefficient(Time.Second, Boost.MeterPerSecondSquared, Speed.MeterPerSecond);
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static Speed operator /(Length left, Time right) => left.DivideProtected<Length, Time, Speed>(right, Coeff2);
|
||||
// static readonly double Coeff2 = Coefficients.DivideCoefficient(Length.Meter, Time.Second, Speed.MeterPerSecond);
|
||||
//}
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Speed
|
||||
//{
|
||||
// [CollectionsOperatorsGenerator] public static Length operator *(Speed left, Time right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Length operator *(Time left, Speed right) => left.MultiplyProtected<Time, Speed, Length>(right, Coeff1);
|
||||
// static readonly double Coeff1 = Coefficients.MultiplyCoefficient(Time.Second, Speed.MeterPerSecond, Length.Meter);
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static Boost operator /(Speed left, Time right) => left.DivideProtected<Speed, Time, Boost>(right, Coeff2);
|
||||
// static readonly double Coeff2 = Coefficients.DivideCoefficient(Speed.MeterPerSecond, Time.Second, Boost.MeterPerSecondSquared);
|
||||
//}
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct Boost
|
||||
//{
|
||||
// [CollectionsOperatorsGenerator] public static Force operator *(Mass left, Boost right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Force operator *(Boost left, Mass right) => left.MultiplyProtected<Boost, Mass, Force>(right, Coeff1);
|
||||
// static readonly double Coeff1 = Coefficients.MultiplyCoefficient(Boost.MeterPerSecondSquared, Time.KiloGram, Force.Newton);
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static PogonForce operator *(PogonMass left, Boost right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static PogonForce operator *(Boost left, PogonMass right) => left.MultiplyProtected<Boost, PogonMass, PogonForce>(right, Coeff2);
|
||||
// static readonly double Coeff2 = Coefficients.MultiplyCoefficient(Boost.MeterPerSecondSquared, b => b.PerMilliMeter.KiloGrams = 1, r => r.PerMilliMeter.Newtons = 1);
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static UdelForce operator *(Density left, Boost right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static UdelForce operator *(Boost left, Density right) => left.MultiplyProtected<Boost, Density, UdelForce>(right, Coeff3);
|
||||
// static readonly double Coeff3 = Coefficients.MultiplyCoefficient(Boost.MeterPerSecondSquared, b => b.PerMilliMeterCubic.KiloGrams = 1, r => r.PerMilliMeterCubic.Newtons = 1);
|
||||
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static PogonMass operator /(PogonForce left, Boost right) => left.DivideProtected<PogonForce, Boost, PogonMass>(right, Coeff4);
|
||||
// static readonly double Coeff4 = Coefficients.DivideCoefficient(a => a.PerMilliMeter.Newtons = 1, Boost.MeterPerSecondSquared, r => r.PerMilliMeter.KiloGrams = 1);
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static Density operator /(UdelForce left, Boost right) => left.DivideProtected<UdelForce, Boost, Density>(right, Coeff5);
|
||||
// static readonly double Coeff5 = Coefficients.DivideCoefficient(a => a.PerMilliMeterCubic.Newtons = 1, Boost.MeterPerSecondSquared, r => r.PerMilliMeterCubic.KiloGrams = 1);
|
||||
|
||||
|
||||
// [CollectionsOperatorsGenerator] public static MassPerSquare operator /(Pressure left, Boost right) => left.DivideProtected<Pressure, Boost, MassPerSquare>(right, Coeff6);
|
||||
// static readonly double Coeff6 = Coefficients.DivideCoefficient(Pressure.Pascal, Boost.MeterPerSecondSquared, MassPerSquare.KiloGramPerMeterSquared);
|
||||
//}
|
||||
|
||||
//[CollectionsOperatorsGenerator] public readonly partial record struct MassPerSquare
|
||||
//{
|
||||
// [CollectionsOperatorsGenerator] public static Pressure operator *(Boost left, MassPerSquare right) => right * left;
|
||||
// [CollectionsOperatorsGenerator] public static Pressure operator *(MassPerSquare left, Boost right) => left.MultiplyProtected<MassPerSquare, Boost, Pressure>(right, Coeff1);
|
||||
// static readonly double Coeff1 = Coefficients.MultiplyCoefficient(MassPerSquare.KiloGramPerMeterSquared, Boost.MeterPerSecondSquared, Pressure.Pascal);
|
||||
//}
|
||||
|
||||
////[CollectionsOperatorsGenerator] public readonly partial record struct PogonForce : Pogon<PogonForce, Force>
|
||||
////{
|
||||
|
||||
|
||||
////}
|
||||
|
||||
////[CollectionsOperatorsGenerator] public readonly partial record struct PogonMass : Pogon<PogonMass, Mass>
|
||||
////{
|
||||
//// [CollectionsOperatorsGenerator] public static Boost operator /(PogonForce left, PogonMass right) => left.DivideProtected<PogonForce, PogonMass, Boost>(right, Coeff1);
|
||||
|
||||
//// static readonly double Coeff1 = Coefficients.DivideCoefficient(a => a.PerMilliMeter.Newtons = 1, b => b.PerMilliMeter.KiloGrams = 1, Boost.MeterPerSecondSquared);
|
||||
////}
|
||||
|
||||
////[CollectionsOperatorsGenerator] public readonly partial record struct UdelForce : Udel<UdelForce, Force>
|
||||
////{
|
||||
|
||||
|
||||
////}
|
||||
|
||||
////[CollectionsOperatorsGenerator] public readonly partial record struct Density : Udel<Density, Mass>
|
||||
////{
|
||||
|
||||
|
||||
////}
|
||||
Reference in New Issue
Block a user