示例#1
0
        private static DerivedQuantity multiplyBaseQuantities(BaseQuantity a, BaseQuantity b)
        {
            var derivedA = new DerivedQuantity(a, 1);
            var derivedB = new DerivedQuantity(b, 1);

            return(multiplyDerivedQuantities(derivedA, derivedB));
        }
示例#2
0
 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;
 }
示例#3
0
 public DerivedQuantity(BaseQuantity baseQuantity, double exponent)
 {
     _name     = null;
     _symbol   = null;
     _uiSymbol = null;
     Dimension = getDimension(baseQuantity, exponent);
     IsNamed   = false;
 }
示例#4
0
 //Exponentiation Operators
 private static DerivedQuantity exponentiateBaseQuantity(BaseQuantity a, double b)
 => new DerivedQuantity(a, b);
示例#5
0
        private static DerivedQuantity multiplyBaseByDerivedQuantities(BaseQuantity a, DerivedQuantity b)
        {
            var derivedA = new DerivedQuantity(a, 1);

            return(multiplyDerivedQuantities(derivedA, b));
        }
示例#6
0
        bool IEquatable <DerivedQuantityDimensionMember> .Equals(DerivedQuantityDimensionMember other)
        {
            bool baseQuantityMatches = BaseQuantity.Equals(other.BaseQuantity);

            return(baseQuantityMatches && Exponent == other.Exponent);
        }
示例#7
0
 private DerivedQuantityDimension getDimension(BaseQuantity baseQuantity, double exponent) =>
 private static DerivedQuantityDimension generateDimensionFromBaseQuantity(BaseQuantity baseQuantity,
                                                                           double exponent) => new DerivedQuantityDimension(new DerivedQuantityDimensionMember(baseQuantity ??