public static void Main()
        {
            Console.WriteLine(FileUtilities.GetFileExtension("example"));
            Console.WriteLine(FileUtilities.GetFileExtension("example.pdf"));
            Console.WriteLine(FileUtilities.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileUtilities.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileUtilities.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileUtilities.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine(
                "Distance in the 2D space = {0:f2}",
                CalculateDistanceBetweenTwoPoints.In2DSpace(1, -2, 3, 4));
            Console.WriteLine(
                "Distance in the 3D space = {0:f2}",
                CalculateDistanceBetweenTwoPoints.In3DSpace(5, 2, -1, 3, -6, 4));

            Parallelepiped parallelepiped = new Parallelepiped(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", parallelepiped.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", parallelepiped.CalcDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", parallelepiped.CalcDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", parallelepiped.CalcDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", parallelepiped.CalcDiagonalYZ());
        }
Example #2
0
        static void Main()
        {
            Console.WriteLine(FileExtension.GetFileExtension("example"));
            Console.WriteLine(FileExtension.GetFileExtension("example.pdf"));
            Console.WriteLine(FileExtension.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileName.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileName.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileName.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:f2}",
                DistanceTwoPoints.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}",
                DistanceTwoPoints.CalcDistance3D(5, 2, -1, 3, -6, 4));

            try
            {
                Parallelepiped parallelepiped = new Parallelepiped(3, 4, 5);
                Console.WriteLine("Volume = {0:f2}", ParallelepipedVolume.CalcVolume(parallelepiped));
                Console.WriteLine("Diagonal XYZ = {0:f2}", ParallelepipedDiagonals.CalcDiagonalXYZ(parallelepiped));
                Console.WriteLine("Diagonal XY = {0:f2}", ParallelepipedDiagonals.CalcDiagonalXY(parallelepiped));
                Console.WriteLine("Diagonal XZ = {0:f2}", ParallelepipedDiagonals.CalcDiagonalXZ(parallelepiped));
                Console.WriteLine("Diagonal YZ = {0:f2}", ParallelepipedDiagonals.CalcDiagonalYZ(parallelepiped));
            }
            catch (ArgumentOutOfRangeException e)
            {
                Console.WriteLine(e.Message);
            }            
        }
Example #3
0
        static void Main()
        {
            var fileNames = new string[] { "example", "example.pdf", "example.new.pdf" };
            foreach (var fileName in fileNames)
            {
                string fileExtension = FileUtils.GetFileExtension(fileName);
                string fileNameWithoutExtension = FileUtils.GetFileNameWithoutExtension(fileName);

                Console.WriteLine(fileExtension);
                Console.WriteLine(fileNameWithoutExtension);
            }

            Console.WriteLine("Distance in the 2D space = {0:f2}", GeometryUtils.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", GeometryUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));

            Parallelepiped parallelepiped = new Parallelepiped(3, 4, 5);
            double paralVolume = parallelepiped.CalcVolume();
            double paralBodyDiagonal = parallelepiped.CalcBodyDiagonal();
            double paralDiagonalXY = parallelepiped.CalcDiagonalXY();
            double paralDiagonalXZ = parallelepiped.CalcDiagonalXZ();
            double paralDiagonalYZ = parallelepiped.CalcDiagonalYZ();

            Console.WriteLine("Volume = {0:f2}", paralVolume);
            Console.WriteLine("Diagonal XYZ = {0:f2}", paralBodyDiagonal);
            Console.WriteLine("Diagonal XY = {0:f2}", paralDiagonalXY);
            Console.WriteLine("Diagonal XZ = {0:f2}", paralDiagonalXZ);
            Console.WriteLine("Diagonal YZ = {0:f2}", paralDiagonalYZ);
        }
        public static void Main()
        {
            // throw ArgumentException
            // Console.WriteLine(GetFileName.GetFileExtension("example"));
            Console.WriteLine(GetFileName.GetFileExtension("example.pdf"));
            Console.WriteLine(GetFileName.GetFileExtension("example.new.pdf"));

            // throw ArgumentException
            // Console.WriteLine(GetFileName.GetFileNameWithoutExtension("example"));
            Console.WriteLine(GetFileName.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(GetFileName.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine(
                "Distance in the 2D space = {0:f2}",
                DistanceCalculations.CalculateDistance2D(1, -2, 3, 4));
            Console.WriteLine(
                "Distance in the 3D space = {0:f2}",
                DistanceCalculations.CalculateDistance3D(5, 2, -1, 3, -6, 4));

            var parallelepiped = new Parallelepiped(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", parallelepiped.CalculateVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", parallelepiped.CalculateDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}",    parallelepiped.CalculateDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", parallelepiped.CalculateDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", parallelepiped.CalculateDiagonalYZ());
            Console.Read();
        }
Example #5
0
        public static void Main()
        {
            Console.WriteLine(FileUtils.GetFileExtension("example"));
            Console.WriteLine(FileUtils.GetFileExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:f2}", Geometry2DUtils.CalcDistance(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", Geometry3DUtils.CalcDistance(5, 2, -1, 3, -6, 4));

            var parallelepiped = new Parallelepiped(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", parallelepiped.CalcVolume());
            var diagonalXYZ = Geometry3DUtils.CalcDistance(0, 0, 0, parallelepiped.Width, parallelepiped.Height, parallelepiped.Depth);

            Console.WriteLine("Diagonal XYZ = {0:f2}", diagonalXYZ);
            var diagonalXY = Geometry2DUtils.CalcDistance(0, parallelepiped.Width, 0, parallelepiped.Height);

            Console.WriteLine("Diagonal XY = {0:f2}", diagonalXY);
            var diagonalXZ = Geometry2DUtils.CalcDistance(0, parallelepiped.Width, 0, parallelepiped.Depth);

            Console.WriteLine("Diagonal XZ = {0:f2}", diagonalXZ);
            var diagonalYZ = Geometry2DUtils.CalcDistance(0, parallelepiped.Height, 0, parallelepiped.Depth);

            Console.WriteLine("Diagonal YZ = {0:f2}", diagonalYZ);
        }
        private static void Main()
        {
            Console.WriteLine(FileOperations.GetFileExtension("example"));
            Console.WriteLine(FileOperations.GetFileExtension("example.pdf"));
            Console.WriteLine(FileOperations.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileOperations.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileOperations.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileOperations.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:f2}", MeasurementsOperations.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", MeasurementsOperations.CalcDistance3D(5, 2, -1, 3, -6, 4));

            var parallelepiped = new Parallelepiped(3, 4, 5);
            Console.WriteLine("Volume = {0:f2}", MeasurementsOperations.CalcVolume(
                parallelepiped.Width, parallelepiped.Height, parallelepiped.Depth));
            Console.WriteLine("Diagonal XYZ = {0:f2}", MeasurementsOperations.CalcDiagonalXYZ(
                parallelepiped.Width, parallelepiped.Height, parallelepiped.Depth));
            Console.WriteLine("Diagonal XY = {0:f2}", MeasurementsOperations.CalcDiagonalXY(
                parallelepiped.Width, parallelepiped.Height));
            Console.WriteLine("Diagonal XZ = {0:f2}", MeasurementsOperations.CalcDiagonalXZ(
                parallelepiped.Width, parallelepiped.Depth));
            Console.WriteLine("Diagonal YZ = {0:f2}", MeasurementsOperations.CalcDiagonalYZ(
                parallelepiped.Height, parallelepiped.Depth));
        }
Example #7
0
        public static void Main()
        {
            Console.WriteLine(FileUtils.GetFileExtension("example."));
            Console.WriteLine(FileUtils.GetFileExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine(
                "Distance in the 2D space = {0:f2}",
                GeometryUtils.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine(
                "Distance in the 3D space = {0:f2}",
                GeometryUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));

            Parallelepiped parallelepiped = new Parallelepiped(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", parallelepiped.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", parallelepiped.CalcDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", parallelepiped.CalcDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", parallelepiped.CalcDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", parallelepiped.CalcDiagonalYZ());
        }
Example #8
0
        private static void Main()
        {
            Console.WriteLine(FileUtils.GetFileExtension("example"));
            Console.WriteLine(FileUtils.GetFileExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:f2}",
                              FigureUtils.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}",
                              FigureUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));

            Parallelepiped.Width  = 3;
            Parallelepiped.Height = 4;
            Parallelepiped.Depth  = 5;

            Console.WriteLine("Volume = {0:f2}", Parallelepiped.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", Parallelepiped.CalcDiagonalXyz());
            Console.WriteLine("Diagonal XY = {0:f2}", Parallelepiped.CalcDiagonalXy());
            Console.WriteLine("Diagonal XZ = {0:f2}", Parallelepiped.CalcDiagonalXz());
            Console.WriteLine("Diagonal YZ = {0:f2}", Parallelepiped.CalcDiagonalYz());
        }
        public static void Main()
        {
            Console.WriteLine(GetFileName.Extension("example"));
            Console.WriteLine(GetFileName.Extension("example.pdf"));
            Console.WriteLine(GetFileName.Extension("example.new.pdf"));

            Console.WriteLine(GetFileName.Filename("example"));
            Console.WriteLine(GetFileName.Filename("example.pdf"));
            Console.WriteLine(GetFileName.Filename("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:f2}", DistanceCalculator.CalculateDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", DistanceCalculator.CalculateDistance3D(5, 2, -1, 3, -6, 4));

            Parallelepiped box = new Parallelepiped(12.6, 4.85, 3.87);

            Console.WriteLine(box.ToString());

            var boxVolume = box.Volume();
            var boxDiagonalXyz = box.DiagonalXYZ();
            var boxDiagonalXy = box.DiagonalXY();
            var boxDiagonalXz = box.DiagonalXZ();
            var boxDiagonalYz = box.DiagonalYZ();

            Console.WriteLine("Volume = {0:f2}", boxVolume);
            Console.WriteLine("Diagonal XYZ = {0:f2}", boxDiagonalXyz);
            Console.WriteLine("Diagonal XY = {0:f2}", boxDiagonalXy);
            Console.WriteLine("Diagonal XZ = {0:f2}", boxDiagonalXz);
            Console.WriteLine("Diagonal YZ = {0:f2}", boxDiagonalYz);
        }
Example #10
0
        static void Main()
        {
            Console.WriteLine(FileExtension.GetFileExtension("example"));
            Console.WriteLine(FileExtension.GetFileExtension("example.pdf"));
            Console.WriteLine(FileExtension.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileName.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileName.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileName.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:f2}",
                              DistanceTwoPoints.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}",
                              DistanceTwoPoints.CalcDistance3D(5, 2, -1, 3, -6, 4));

            try
            {
                Parallelepiped parallelepiped = new Parallelepiped(3, 4, 5);
                Console.WriteLine("Volume = {0:f2}", ParallelepipedVolume.CalcVolume(parallelepiped));
                Console.WriteLine("Diagonal XYZ = {0:f2}", ParallelepipedDiagonals.CalcDiagonalXYZ(parallelepiped));
                Console.WriteLine("Diagonal XY = {0:f2}", ParallelepipedDiagonals.CalcDiagonalXY(parallelepiped));
                Console.WriteLine("Diagonal XZ = {0:f2}", ParallelepipedDiagonals.CalcDiagonalXZ(parallelepiped));
                Console.WriteLine("Diagonal YZ = {0:f2}", ParallelepipedDiagonals.CalcDiagonalYZ(parallelepiped));
            }
            catch (ArgumentOutOfRangeException e)
            {
                Console.WriteLine(e.Message);
            }
        }
        public static void Main()
        {
            Console.WriteLine(FileUtils.GetFileExtension("example"));
            Console.WriteLine(FileUtils.GetFileExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:f2}", Geometry2DUtils.CalcDistance(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", Geometry3DUtils.CalcDistance(5, 2, -1, 3, -6, 4));

            var parallelepiped = new Parallelepiped(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", parallelepiped.CalcVolume());
            var diagonalXYZ = Geometry3DUtils.CalcDistance(0, 0, 0, parallelepiped.Width, parallelepiped.Height, parallelepiped.Depth);
            Console.WriteLine("Diagonal XYZ = {0:f2}", diagonalXYZ);
            var diagonalXY = Geometry2DUtils.CalcDistance(0, parallelepiped.Width, 0, parallelepiped.Height);
            Console.WriteLine("Diagonal XY = {0:f2}", diagonalXY);
            var diagonalXZ = Geometry2DUtils.CalcDistance(0, parallelepiped.Width, 0, parallelepiped.Depth);
            Console.WriteLine("Diagonal XZ = {0:f2}", diagonalXZ);
            var diagonalYZ = Geometry2DUtils.CalcDistance(0, parallelepiped.Height, 0, parallelepiped.Depth);
            Console.WriteLine("Diagonal YZ = {0:f2}", diagonalYZ);
        }
Example #12
0
        static void Main()
        {
            var fileNames = new string[] { "example", "example.pdf", "example.new.pdf" };

            foreach (var fileName in fileNames)
            {
                string fileExtension            = FileUtils.GetFileExtension(fileName);
                string fileNameWithoutExtension = FileUtils.GetFileNameWithoutExtension(fileName);

                Console.WriteLine(fileExtension);
                Console.WriteLine(fileNameWithoutExtension);
            }

            Console.WriteLine("Distance in the 2D space = {0:f2}", GeometryUtils.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", GeometryUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));

            Parallelepiped parallelepiped    = new Parallelepiped(3, 4, 5);
            double         paralVolume       = parallelepiped.CalcVolume();
            double         paralBodyDiagonal = parallelepiped.CalcBodyDiagonal();
            double         paralDiagonalXY   = parallelepiped.CalcDiagonalXY();
            double         paralDiagonalXZ   = parallelepiped.CalcDiagonalXZ();
            double         paralDiagonalYZ   = parallelepiped.CalcDiagonalYZ();

            Console.WriteLine("Volume = {0:f2}", paralVolume);
            Console.WriteLine("Diagonal XYZ = {0:f2}", paralBodyDiagonal);
            Console.WriteLine("Diagonal XY = {0:f2}", paralDiagonalXY);
            Console.WriteLine("Diagonal XZ = {0:f2}", paralDiagonalXZ);
            Console.WriteLine("Diagonal YZ = {0:f2}", paralDiagonalYZ);
        }
Example #13
0
        public static void Main()
        {
            Console.WriteLine(GetFileName.Extension("example"));
            Console.WriteLine(GetFileName.Extension("example.pdf"));
            Console.WriteLine(GetFileName.Extension("example.new.pdf"));

            Console.WriteLine(GetFileName.Filename("example"));
            Console.WriteLine(GetFileName.Filename("example.pdf"));
            Console.WriteLine(GetFileName.Filename("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:f2}", DistanceCalculator.CalculateDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", DistanceCalculator.CalculateDistance3D(5, 2, -1, 3, -6, 4));

            Parallelepiped box = new Parallelepiped(12.6, 4.85, 3.87);

            Console.WriteLine(box.ToString());

            var boxVolume      = box.Volume();
            var boxDiagonalXyz = box.DiagonalXYZ();
            var boxDiagonalXy  = box.DiagonalXY();
            var boxDiagonalXz  = box.DiagonalXZ();
            var boxDiagonalYz  = box.DiagonalYZ();

            Console.WriteLine("Volume = {0:f2}", boxVolume);
            Console.WriteLine("Diagonal XYZ = {0:f2}", boxDiagonalXyz);
            Console.WriteLine("Diagonal XY = {0:f2}", boxDiagonalXy);
            Console.WriteLine("Diagonal XZ = {0:f2}", boxDiagonalXz);
            Console.WriteLine("Diagonal YZ = {0:f2}", boxDiagonalYz);
        }
Example #14
0
        public static void Main()
        {
            // Console.WriteLine(FileNameUtils.GetFileExtension("example")); //throws exception
            Console.WriteLine(FileNameUtils.GetFileExtension("example.pdf"));
            Console.WriteLine(FileNameUtils.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileNameUtils.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileNameUtils.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileNameUtils.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine(
                "Distance in the 2D space = {0:f2}",
                DistanceUtils.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine(
                "Distance in the 3D space = {0:f2}",
                DistanceUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));

            Parallelepiped parallelepiped = new Parallelepiped(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", parallelepiped.CalculateVolume());
            Console.WriteLine("Inner diagonal = {0:f2}", parallelepiped.CalculateInnerDiagonal());
            Console.WriteLine("First side diagonal = {0:f2}", parallelepiped.CalculateFirstSideDiagonal());
            Console.WriteLine("Second side diagonal = {0:f2}", parallelepiped.CalculateSecondSideDiagonal());
            Console.WriteLine("Third side diagonal = {0:f2}", parallelepiped.CalculateThirdSideDiagonal());
        }
Example #15
0
        public static double CalcDiagonalXYZ(Parallelepiped parallelepiped)
        {
            double distance = DistanceTwoPoints.CalcDistance3D(0, 0, 0,
                                                               parallelepiped.Width, parallelepiped.Height, parallelepiped.Depth);

            return(distance);
        }
Example #16
0
        public static void Main()
        {
            string firstFileExtension = File.GetFileExtension("example");
            Console.WriteLine(firstFileExtension);

            string secondFileExtension = File.GetFileExtension("example.pdf");
            Console.WriteLine(secondFileExtension);

            string thirdFileExtension = File.GetFileExtension("example.new.pdf");
            Console.WriteLine(thirdFileExtension);

            string firstFileName = File.GetFileNameWithoutExtension("example");
            Console.WriteLine(firstFileName);

            string secondFileName = File.GetFileNameWithoutExtension("example.pdf");
            Console.WriteLine(secondFileName);

            string thirdFileName = File.GetFileNameWithoutExtension("example.new.pdf");
            Console.WriteLine(thirdFileName);

            double distanceBetweenPoints2D = Geometry.CalculateDistance2D(1, -2, 3, 4);
            Console.WriteLine(DistancePrintMessage, "2D", distanceBetweenPoints2D);

            double distanceBetweenPoints3D = Geometry.CalculateDistance3D(5, 2, -1, 3, -6, 4);
            Console.WriteLine(DistancePrintMessage, "3D", distanceBetweenPoints3D);

            Parallelepiped figure = new Parallelepiped(3, 4, 5);

            double figureVolume = figure.CalculateVolume();
            Console.WriteLine("Volume = {0:f2}", figureVolume);

            double figureDiagonalXYZ = figure.CalculateDiagonalXYZ();
            Console.WriteLine("Diagonal XYZ = {0:f2}", figureDiagonalXYZ);

            double figureDiagonalXY = figure.CalculateDiagonalXY();
            Console.WriteLine("Diagonal XY = {0:f2}", figureDiagonalXY);

            double figureDiagonalXZ = figure.CalculateDiagonalXZ();
            Console.WriteLine("Diagonal XZ = {0:f2}", figureDiagonalXZ);

            double figureDiagonalYZ = figure.CalculateDiagonalYZ();
            Console.WriteLine("Diagonal YZ = {0:f2}", figureDiagonalYZ);
        }
        public static void Main()
        {
            Console.WriteLine(FileUtils.GetFileExtension("example"));
            Console.WriteLine(FileUtils.GetFileExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf"));
            Console.WriteLine();

            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf"));
            Console.WriteLine();

            Console.WriteLine("Distance in the 2D space = {0:f2}", DistanceCalculationUtils.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", DistanceCalculationUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));
            Console.WriteLine();

            var parallelepiped = new Parallelepiped(3, 4, 5);
            Console.WriteLine(parallelepiped.ToString());
        }
        public static void Main()
        {
            Console.WriteLine(FileUtils.GetFileExtension("example"));
            Console.WriteLine(FileUtils.GetFileExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:F2}", CalcDistance.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:F2}", CalcDistance.CalcDistance3D(5, 2, -1, 3, -6, 4));

            Parallelepiped parallelepiped = new Parallelepiped(3, 4, 5);
            Console.WriteLine("Volume = {0:F2}", parallelepiped.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:F2}", parallelepiped.CalcDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:F2}", parallelepiped.CalcDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:F2}", parallelepiped.CalcDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:F2}", parallelepiped.CalcDiagonalYZ());
        }
Example #19
0
        public static void Start()
        {
            var distance2D = MathExtensions.CalculateDistance2D(1, -2, 3, 4);

            Console.WriteLine($"Distance in the 2D space = {distance2D:f2}");

            var distance3D = MathExtensions.CalculateDistance3D(5, 2, -1, 3, -6, 4);

            Console.WriteLine($"Distance in the 3D space = {distance3D:f2}");

            var rectangle         = new Rectangle(3, 4);
            var rectangleDiagonal = MathExtensions.CalculateDiagonal2D(rectangle);

            Console.WriteLine($"Diagonal 2D = {rectangleDiagonal:f2}");

            var parallelepiped         = new Parallelepiped(3, 4, 5);
            var parallelepipedDiagonal = MathExtensions.CalculateDiagonal3D(parallelepiped);
            var parallelepipedVolume   = MathExtensions.CalculateVolume(parallelepiped);

            Console.WriteLine($"Diagonal 3D = {parallelepipedDiagonal:f2}");
            Console.WriteLine($"Volume = {parallelepipedVolume:f2}");
        }
        static void Main()
        {
            Console.WriteLine(FileUtil.GetFileExtension("example"));
            Console.WriteLine(FileUtil.GetFileExtension("example.pdf"));
            Console.WriteLine(FileUtil.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileUtil.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileUtil.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileUtil.GetFileNameWithoutExtension("example.new.pdf"));
            Console.WriteLine(Environment.NewLine);

            Console.WriteLine("Distance in the 2D space = {0:f2}", PolygonUtil.CalculateDistanceIn2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", PolygonUtil.CalculateDistanceIn3D(5, 2, -1, 3, -6, 4));
            Console.WriteLine(Environment.NewLine);

            Parallelepiped prism = new Parallelepiped(3,4,5);
            Console.WriteLine("Volume = {0:f2}", prism.CalculateVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", prism.CalculateDiagonalXyz());
            Console.WriteLine("Diagonal XY = {0:f2}", prism.CalculateDiagonalXy());
            Console.WriteLine("Diagonal XZ = {0:f2}", prism.CalculateDiagonalXz());
            Console.WriteLine("Diagonal YZ = {0:f2}", prism.CalculateDiagonalYz());
        }
        static void Main()
        {
            Console.WriteLine(FileExtension.GetFileExtension("example"));
            Console.WriteLine(FileExtension.GetFileExtension("example.pdf"));
            Console.WriteLine(FileExtension.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileExtension.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileExtension.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileExtension.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine("Distance in the 2D space = {0:f2}",
                DistanceTwoPoints.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}",
                DistanceTwoPoints.CalcDistance3D(5, 2, -1, 3, -6, 4));

            Parallelepiped parallelepiped = new Parallelepiped(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", ParallelepipdeVolume.CalcVolume(parallelepiped));
            Console.WriteLine("Diagonal XYZ = {0:f2}", ParallelepipedDiagonal.CalcDiagonalXYZ(parallelepiped));
            Console.WriteLine("Diagonal XY = {0:f2}", ParallelepipedDiagonal.CalcDiagonalXY(parallelepiped));
            Console.WriteLine("Diagonal XZ = {0:f2}", ParallelepipedDiagonal.CalcDiagonalXZ(parallelepiped));
            Console.WriteLine("Diagonal YZ = {0:f2}", ParallelepipedDiagonal.CalcDiagonalYZ(parallelepiped));
        }
        public static void Main()
        {
            Console.WriteLine(FileUtilities.GetFileExtension("example"));
            Console.WriteLine(FileUtilities.GetFileExtension("example.pdf"));
            Console.WriteLine(FileUtilities.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileUtilities.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileUtilities.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileUtilities.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine(
                "Distance in the 2D space = {0:f2}",
                CalculateDistanceBetweenTwoPoints.In2DSpace(1, -2, 3, 4));
            Console.WriteLine(
                "Distance in the 3D space = {0:f2}",
                CalculateDistanceBetweenTwoPoints.In3DSpace(5, 2, -1, 3, -6, 4));

            Parallelepiped parallelepiped = new Parallelepiped(3, 4, 5);
            Console.WriteLine("Volume = {0:f2}", parallelepiped.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", parallelepiped.CalcDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", parallelepiped.CalcDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", parallelepiped.CalcDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", parallelepiped.CalcDiagonalYZ());
        }
 public static double CalcDiagonalXYZ(Parallelepiped parallelepiped)
 {
     double distance = DistanceTwoPoints.CalcDistance3D(0, 0, 0, 
         parallelepiped.Width, parallelepiped.Height, parallelepiped.Depth);
     return distance;
 }