private static DerivedQuantity multiplyBaseQuantities(BaseQuantity a, BaseQuantity b) { var derivedA = new DerivedQuantity(a, 1); var derivedB = new DerivedQuantity(b, 1); return(multiplyDerivedQuantities(derivedA, derivedB)); }
public DerivedQuantity(string name, string symbol, string uiSymbol, BaseQuantity baseQuantity, double exponent) { _name = name ?? throw new ArgumentNullException(nameof(name)); _symbol = symbol ?? throw new ArgumentNullException(nameof(symbol)); _uiSymbol = uiSymbol; Dimension = getDimension(baseQuantity, exponent); IsNamed = true; }
public DerivedQuantity(BaseQuantity baseQuantity, double exponent) { _name = null; _symbol = null; _uiSymbol = null; Dimension = getDimension(baseQuantity, exponent); IsNamed = false; }
//Exponentiation Operators private static DerivedQuantity exponentiateBaseQuantity(BaseQuantity a, double b) => new DerivedQuantity(a, b);
private static DerivedQuantity multiplyBaseByDerivedQuantities(BaseQuantity a, DerivedQuantity b) { var derivedA = new DerivedQuantity(a, 1); return(multiplyDerivedQuantities(derivedA, b)); }
bool IEquatable <DerivedQuantityDimensionMember> .Equals(DerivedQuantityDimensionMember other) { bool baseQuantityMatches = BaseQuantity.Equals(other.BaseQuantity); return(baseQuantityMatches && Exponent == other.Exponent); }
private DerivedQuantityDimension getDimension(BaseQuantity baseQuantity, double exponent) =>
private static DerivedQuantityDimension generateDimensionFromBaseQuantity(BaseQuantity baseQuantity, double exponent) => new DerivedQuantityDimension(new DerivedQuantityDimensionMember(baseQuantity ??