Ejemplo n.º 1
0
        /// <summary>
        /// Returns the minimum of this instance and the specified measurement.
        /// </summary>
        /// <param name="that">The other measurement.</param>
        /// <returns></returns>
        public static T Min <T>(IMeasurement <T> t1, IMeasurement <T> t2) where T : IMeasurement <T>
        {
            Validate.NonNull(t1, nameof(t1));
            Validate.NonNull(t2, nameof(t2));

            if (t1.ToMeasurement().CompareTo(t2.ToMeasurement()) <= 0)
            {
                return(t1.ToMeasurement());
            }
            else
            {
                return(t2.ToMeasurement());
            }
        }
        public static Distance Divide(this IMeasurement <Volume> volume, IMeasurement <Area> area)
        {
            Validate.NonNull(volume, nameof(volume));
            Validate.NonNull(area, nameof(area));

            return(volume.ToMeasurement().Select((x, y) => y.Divide(area).Multiply(x)));
        }
        public static Area Divide(this IMeasurement <Volume> volume, IMeasurement <Distance> distance)
        {
            Validate.NonNull(volume, nameof(volume));
            Validate.NonNull(distance, nameof(distance));

            return(volume.ToMeasurement().Select((x, y) => y.Divide(distance).Multiply(x)));
        }