Пример #1
0
        public static decimal CalculateVolume(decimal height, decimal width, decimal length, _3DBases b)
        {
            switch (b)
            {
            case _3DBases.Square:
                return(Math.Round(Square.CalculateArea(height) * length, 3));

            case _3DBases.Triangle:
                return(Math.Round(EquilateralTriangle.CalculateArea(height, width) * length, 3));

            default:
                return(123456m);
            }
        }
Пример #2
0
        public static decimal CalculateVolume(decimal length, decimal width, decimal height, _3DBases b)
        {
            switch (b)
            {
            case _3DBases.Square:
                return((1m / 3m) * Square.CalculateArea(length) * height);

            case _3DBases.Triangle:
                return((1m / 3m) * EquilateralTriangle.CalculateArea(length, width) * height);

            default:
                return(123456m);
            }
        }
Пример #3
0
        public static decimal CalculateArea(decimal height, decimal width, decimal length, _3DBases b)
        {
            switch (b)
            {
            case _3DBases.Square:
                return((Square.CalculateArea(height) * 2) + (Rectangle.CalculateArea(height, length) * 4));

            case _3DBases.Triangle:
                return((EquilateralTriangle.CalculateArea(height, width) * 2) + (Rectangle.CalculateArea(width, length) * 3));

            default:
                return(123456m);
            }
        }
Пример #4
0
        public static decimal CalculateArea(decimal length, decimal width, decimal height, _3DBases b)
        {
            switch (b)
            {
            case _3DBases.Square:
                return(Square.CalculateArea(length) + (0.5m * Square.CalculatePerimeter(length) * Right_AngledTriangle.CalculateHypotenuse(height, 0.5m * length)));

            case _3DBases.Triangle:
                return(EquilateralTriangle.CalculateArea(length, width) + (0.5m * EquilateralTriangle.CalculatePerimeter(width) * Right_AngledTriangle.CalculateHypotenuse(width, height)));

            default:
                return(123456m);
            }
        }