Beispiel #1
0
        /// <summary>
        /// Division operation, calculates value dividend/divisor with unit that derives from dividend unit
        /// </summary>
        /// <param name="mass">a dividend (counter) - a value that is being divided</param>
        /// <param name="planarDensity">a divisor (denominator) - a value which dividend is divided by</param>
        public static Area operator /(Mass mass, PlanarDensity planarDensity)
        {
            // generator : MultiplyAlgebraGenerator.CreateCodeForRightFractionValue
            // scenario A
            // planardensity unit will be synchronized with mass unit
            var unit = new PlanarDensityUnit(mass.Unit, planarDensity.Unit.DenominatorUnit);
            var planarDensityConverted = planarDensity.WithCounterUnit(mass.Unit);
            var value = mass.Value / planarDensityConverted.Value;

            return(new Area(value, planarDensity.Unit.DenominatorUnit));
        }
Beispiel #2
0
        /// <summary>
        /// Division operation, calculates value dividend/divisor with unit that derives from dividend unit
        /// </summary>
        /// <param name="mass">a dividend (counter) - a value that is being divided</param>
        /// <param name="area">a divisor (denominator) - a value which dividend is divided by</param>
        public static PlanarDensity operator /(Mass mass, Area area)
        {
            // generator : MultiplyAlgebraGenerator.CreateOperator
            // scenario with hint
            // .Is<Mass, Area, PlanarDensity>("/")
            // hint location GetBasicOperatorHints, line 31
            var resultUnit = new PlanarDensityUnit(mass.Unit, area.Unit);
            var value      = mass.Value / area.Value;

            return(new PlanarDensity(value, resultUnit));
            // scenario F3
        }
Beispiel #3
0
        /// <summary>
        /// Division operation, calculates value dividend/divisor with unit that derives from dividend unit
        /// </summary>
        /// <param name="linearDensity">a dividend (counter) - a value that is being divided</param>
        /// <param name="planarDensity">a divisor (denominator) - a value which dividend is divided by</param>
        public static Length operator /(LinearDensity linearDensity, PlanarDensity planarDensity)
        {
            // generator : MultiplyAlgebraGenerator.CreateOperator
            // scenario with hint
            // .Is<LinearDensity, PlanarDensity, Length>("/")
            // hint location GetBasicOperatorHints, line 31
            var linearDensityUnit = linearDensity.Unit;
            var tmp1                   = linearDensityUnit.DenominatorUnit;
            var targetRightUnit        = new PlanarDensityUnit(linearDensityUnit.CounterUnit, tmp1.GetAreaUnit());
            var planarDensityConverted = planarDensity.ConvertTo(targetRightUnit);
            var value                  = linearDensity.Value / planarDensityConverted.Value;

            return(new Length(value, tmp1));
            // scenario F1
        }
Beispiel #4
0
        /// <summary>
        /// Division operation, calculates value dividend/divisor with unit that derives from dividend unit
        /// </summary>
        /// <param name="linearDensity">a dividend (counter) - a value that is being divided</param>
        /// <param name="length">a divisor (denominator) - a value which dividend is divided by</param>
        public static PlanarDensity operator /(LinearDensity linearDensity, Length length)
        {
            // generator : MultiplyAlgebraGenerator.CreateCodeForLeftFractionValue
            // PlanarDensity operator /(LinearDensity linearDensity, Length length)
            // scenario with hint
            // .Is<LinearDensity, Length, PlanarDensity>("/")
            // hint location GetBasicOperatorHints, line 31
            var linearDensityUnit = linearDensity.Unit;
            var tmp1            = linearDensityUnit.DenominatorUnit;
            var resultUnit      = new PlanarDensityUnit(linearDensityUnit.CounterUnit, linearDensityUnit.DenominatorUnit.GetAreaUnit());
            var lengthConverted = length.ConvertTo(tmp1);
            var value           = linearDensity.Value / lengthConverted.Value;

            return(new PlanarDensity(value, resultUnit));
        }
 public bool Equals(PlanarDensityUnit other)
 {
     return(CounterUnit.Equals(other.CounterUnit) && DenominatorUnit.Equals(other.DenominatorUnit));
 }