public static double Calc3DSpaceDiagonalDistance(
            double width, double height, double depth, DiagonalFormat diagonalFormat)
        {
            switch (diagonalFormat)
            {
                case DiagonalFormat.Xyz:
                    return CalcDistance3D(0, 0, 0, width, height, depth);

                case DiagonalFormat.Xy:
                    return CalcDistance2D(0, 0, width, height);

                case DiagonalFormat.Xz:
                    return CalcDistance2D(0, 0, width, depth);

                case DiagonalFormat.Yz:
                    return CalcDistance2D(0, 0, height, depth);

                default:
                    throw new ArgumentException("Invalid diagonal format."); // should never happen
            }
        }
        public static double Calc3DSpaceDiagonalDistance(
            double width, double height, double depth, DiagonalFormat diagonalFormat)
        {
            switch (diagonalFormat)
            {
            case DiagonalFormat.Xyz:
                return(CalcDistance3D(0, 0, 0, width, height, depth));

            case DiagonalFormat.Xy:
                return(CalcDistance2D(0, 0, width, height));

            case DiagonalFormat.Xz:
                return(CalcDistance2D(0, 0, width, depth));

            case DiagonalFormat.Yz:
                return(CalcDistance2D(0, 0, height, depth));

            default:
                throw new ArgumentException("Invalid diagonal format.");     // should never happen
            }
        }