Ejemplo n.º 1
0
        /// <summary>
        /// Division operation, calculates value dividend/divisor with unit that derives from dividend unit
        /// </summary>
        /// <param name="volumeStream">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 Velocity operator /(VolumeStream volumeStream, Area area)
        {
            // generator : MultiplyAlgebraGenerator.CreateCodeForLeftFractionValue
            // Velocity operator /(VolumeStream volumeStream, Area area)
            // scenario with hint
            // .Is<VolumeStream, Area, Velocity>("/")
            // hint location GetBasicOperatorHints, line 31
            var volumeStreamUnit = volumeStream.Unit;
            var tmp1             = volumeStreamUnit.CounterUnit;
            var resultUnit       = new VelocityUnit(tmp1.GetLengthUnit(), volumeStreamUnit.DenominatorUnit);
            var areaConverted    = area.ConvertTo(tmp1.GetAreaUnit());
            var value            = volumeStream.Value / areaConverted.Value;

            return(new Velocity(value, resultUnit));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Division operation, calculates value dividend/divisor with unit that derives from dividend unit
        /// </summary>
        /// <param name="volumeStream">a dividend (counter) - a value that is being divided</param>
        /// <param name="velocity">a divisor (denominator) - a value which dividend is divided by</param>
        public static Area operator /(VolumeStream volumeStream, Velocity velocity)
        {
            // generator : MultiplyAlgebraGenerator.CreateOperator
            // scenario with hint
            // .Is<VolumeStream, Velocity, Area>("/")
            // hint location GetBasicOperatorHints, line 31
            var volumeStreamUnit  = volumeStream.Unit;
            var tmp1              = volumeStreamUnit.CounterUnit;
            var targetRightUnit   = new VelocityUnit(tmp1.GetLengthUnit(), volumeStreamUnit.DenominatorUnit);
            var velocityConverted = velocity.ConvertTo(targetRightUnit);
            var value             = volumeStream.Value / velocityConverted.Value;

            return(new Area(value, tmp1.GetAreaUnit()));
            // scenario F1
        }
Ejemplo n.º 3
0
 public bool Equals(VelocityUnit other)
 {
     return(CounterUnit.Equals(other.CounterUnit) && DenominatorUnit.Equals(other.DenominatorUnit));
 }