Пример #1
0
        private static void Main()
        {
            // Throws Exception correctly
            //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"));

            I2Dimentional firstPoint2D  = new Point2D(1, -2);
            I2Dimentional secondPoint2D = new Point2D(3, 4);

            Console.WriteLine(
                "Distance in the 2D space = {0:f2}",
                MathUtilities.CalculateDistance2D(firstPoint2D, secondPoint2D));

            I3Dimentional firstPoint3D  = new Point3D(5, 2, -1);
            I3Dimentional secondPoint3D = new Point3D(3, -6, 4);

            Console.WriteLine(
                "Distance in the 3D space = {0:f2}",
                MathUtilities.CalculateDistance3D(firstPoint3D, secondPoint3D));

            ICuboid cuboid = new Cuboid(3, 4, 5);

            Console.WriteLine(
                "Volume = {0:f2}",
                MathUtilities.CalculateCuboidVolume(cuboid));

            Console.WriteLine(
                "Diagonal XYZ = {0:f2}",
                MathUtilities.CalculateCuboidDiagonal(cuboid));

            I3Dimentional thirdPoint3D = new Point3D(3, 4, 5);

            Console.WriteLine(
                "Diagonal XY = {0:f2}",
                MathUtilities.CalculateRectangleDiagonal(thirdPoint3D.X, thirdPoint3D.Y));

            Console.WriteLine(
                "Diagonal XZ = {0:f2}",
                MathUtilities.CalculateRectangleDiagonal(thirdPoint3D.X, thirdPoint3D.Z));

            Console.WriteLine(
                "Diagonal YZ = {0:f2}",
                MathUtilities.CalculateRectangleDiagonal(thirdPoint3D.Y, thirdPoint3D.Z));
        }
Пример #2
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.CalculateDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", DistanceUtils.CalculateDistance3D(5, 2, -1, 3, -6, 4));

            Cuboid cuboid = new Cuboid(3, 4, 5);
            Console.WriteLine("Volume = {0:f2}", cuboid.CalculateVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", cuboid.CalculateDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", cuboid.CalculateDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", cuboid.CalculateDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", cuboid.CalculateDiagonalYZ());
        }
        public static void Main()
        {
            Console.WriteLine(StringUtilities.GetFileExtension("example"));
            Console.WriteLine(StringUtilities.GetFileExtension("example.pdf"));
            Console.WriteLine(StringUtilities.GetFileExtension("example.new.pdf"));

            Console.WriteLine(StringUtilities.GetFileNameWithoutExtension("example"));
            Console.WriteLine(StringUtilities.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(StringUtilities.GetFileNameWithoutExtension("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));

            Cuboid cube = new Cuboid(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", cube.GetVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", cube.GetDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", cube.GetDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", cube.GetDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", cube.GetDiagonalYZ());
        }
Пример #4
0
        public static void Main()
        {
            Console.WriteLine(FileNameParser.GetFileExtension("example"));
            Console.WriteLine(FileNameParser.GetFileExtension("example.pdf"));
            Console.WriteLine(FileNameParser.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileNameParser.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileNameParser.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileNameParser.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));

            Cuboid cube = new Cuboid(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", cube.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", cube.CalcDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", cube.CalcDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", cube.CalcDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", cube.CalcDiagonalYZ());
        }
        static void Main()
        {
            Console.WriteLine(FileUtils.GetFileExtension("example"));
            Console.WriteLine(FileUtils.GetFileExtension("example.cs"));
            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}",
                GeometryUtils2D.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}",
                GeometryUtils3D.CalcDistance3D(5, 2, -1, 3, -6, 4));

            Cuboid cuboid = new Cuboid(3, 4, 5);
            Console.WriteLine("Volume = {0:f2}", GeometryUtils3D.CalcVolume(cuboid.Width, cuboid.Height, cuboid.Depth));
            Console.WriteLine("Diagonal XYZ = {0:f2}", GeometryUtils3D.CalcDiagonalXYZ(cuboid.Width, cuboid.Height, cuboid.Depth));
            Console.WriteLine("Diagonal XY = {0:f2}", GeometryUtils2D.CalcDiagonalXY(cuboid.Width, cuboid.Height));
            Console.WriteLine("Diagonal XZ = {0:f2}", GeometryUtils2D.CalcDiagonalXZ(cuboid.Width, cuboid.Depth));
            Console.WriteLine("Diagonal YZ = {0:f2}", GeometryUtils2D.CalcDiagonalYZ(cuboid.Depth, cuboid.Height));
        }
Пример #6
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}",
                              MathUtils.CalculateDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}",
                              MathUtils.CalculateDistance3D(5, 2, -1, 3, -6, 4));

            ICuboid cuboid = new Cuboid(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", cuboid.CalculateVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", cuboid.CalculateDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", cuboid.CalculateDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", cuboid.CalculateDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", cuboid.CalculateDiagonalYZ());
        }