internal static void Main()
        {
            Console.WriteLine(FileNameUtils.GetFileExtension("example"));
            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));

            ParallelipipedUtils.Width  = 3;
            ParallelipipedUtils.Height = 4;
            ParallelipipedUtils.Depth  = 5;
            Console.WriteLine("Volume = {0:f2}", ParallelipipedUtils.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", ParallelipipedUtils.CalcDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", ParallelipipedUtils.CalcDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", ParallelipipedUtils.CalcDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", ParallelipipedUtils.CalcDiagonalYZ());
        }
예제 #2
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());
        }
예제 #3
0
        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}",
                              DistanceUtils.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}",
                              DistanceUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));

            double width  = 3;
            double height = 4;
            double depth  = 5;

            Console.WriteLine("Volume = {0:f2}", DistanceUtils.CalcVolume(width, height, depth));
            Console.WriteLine("Diagonal XYZ = {0:f2}", DistanceUtils.CalcDiagonalXYZ(width, height, depth));
            Console.WriteLine("Diagonal XY = {0:f2}", DistanceUtils.CalcDiagonalXY(width, height));
            Console.WriteLine("Diagonal XZ = {0:f2}", DistanceUtils.CalcDiagonalXZ(width, depth));
            Console.WriteLine("Diagonal YZ = {0:f2}", DistanceUtils.CalcDiagonalYZ(height, depth));
        }
예제 #4
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}", DistanceUtils.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", DistanceUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));

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

            Console.WriteLine("Volume = {0:f2}", figure.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", figure.CalcDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", figure.CalcDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", figure.CalcDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", figure.CalcDiagonalYZ());
        }
예제 #5
0
        private double CalculateDiagonal(double firstSide, double secondSide)
        {
            double distance = DistanceUtils.CalcDistance2D(0, 0, firstSide, secondSide);

            return(distance);
        }
        public double CalcDiagonalYZ()
        {
            double distance = DistanceUtils.CalcDistance2D(0, 0, this.Height, this.Depth);

            return(distance);
        }
        public double CalcDiagonalXZ()
        {
            double distance = DistanceUtils.CalcDistance2D(0, 0, this.Width, this.Depth);

            return(distance);
        }
        public double CalcDiagonalXY()
        {
            double distance = DistanceUtils.CalcDistance2D(0, 0, this.Width, this.Height);

            return(distance);
        }