示例#1
0
        public SpeedModel FromKilometersPerHour(double KMvalue)
        {
            _calculationValidation.LessThanZero(KMvalue);

            return(new SpeedModel
            {
                KilometersPerHour = KMvalue,
                Knots = KMvalue / 1.852,
                MilesPerHour = KMvalue / 1.609
            });
        }
        public PressureModel FromPascals(double PascalsValue)
        {
            _calculationValidation.LessThanZero(PascalsValue);

            return(new PressureModel
            {
                Pascals = PascalsValue,
                Bar = PascalsValue / 100000,
                Torrs = PascalsValue * 0.0075006
            });
        }
        public CalculationResultModel Ohm_VoltageCalculation(double current, double resistance)
        {
            _calculationValidation.LessThanZero(current, resistance, "Current", "Resistance");

            double Voltage = current * resistance;

            return(_resultCreation.SetResult(Voltage, ohmLaw.OhmLawFormula, "Voltage"));
        }
        public VolumeModel FromLiter(double literValue)
        {
            _calculationValidation.LessThanZero(literValue);

            return(new VolumeModel
            {
                Liter = literValue,
                Centiliter = literValue / 0.01,
                Milliliter = literValue / 0.001,
                CubicMeter = literValue / 1000,
                USGallon = literValue * 0.26417,
                USTablespoon = literValue * 67.628,
                USTeaspoon = literValue * 202.88,
                UKGallon = literValue * 0.21997,
                UKTablespoon = literValue * 70.390,
                UKTeaspoon = literValue * 281.56
            });
        }
示例#5
0
        public CalculationResultModel Weight(double vloume, double density)
        {
            _calculationValidation.LessThanZero(vloume, density, "Volume ", "Density");

            double Weight = vloume * density;

            return(_resultCreation.SetResult(Weight, calculationModel.WeightFormula, "Weight", calculationModel.WeightUnit.ToString()));
        }
示例#6
0
        public LengthModel FromKilometers(double KilometersValue)
        {
            _validation.LessThanZero(KilometersValue);

            return(new()
            {
                Kilometers = KilometersValue,
                Meters = KilometersValue / 0.001,
                Centimeters = KilometersValue / 0.00001,
                Millimeters = KilometersValue / 0.000001,
                Miles = KilometersValue * 0.62137,
                Foot = KilometersValue * 3280.8,
                Yards = KilometersValue * 1093.6,
                Inches = KilometersValue * 39370,
            });
        }
示例#7
0
        public TimeModel FromSecond(double secondValue)
        {
            _calculationValidation.LessThanZero(secondValue);

            return(new TimeModel
            {
                Second = secondValue,
                Minute = secondValue / 60,
                Hour = secondValue / 3600,
                Day = secondValue / 86400,
                Week = secondValue / 604800,
                Month = secondValue / 2628000
            });
        }
        public WeightModel FromTonnes(double tonnesValue)
        {
            _calculationValidation.LessThanZero(tonnesValue);

            return(new WeightModel
            {
                Tonnes = tonnesValue,
                Kilograms = tonnesValue / 0.001,
                Grams = tonnesValue / 0.000001,
                Milligrams = tonnesValue / 0.000000001,
                Pounds = tonnesValue * 2204.6,
                Ounces = tonnesValue * 35274
            });
        }