Ejemplo n.º 1
0
        static void Main()
        {
            IMathUtility mathUtility = new MathUtils();
            IFileUtility fileUtility = new FileUtils();

            Console.WriteLine(fileUtility.GetFileExtension("example"));
            Console.WriteLine(fileUtility.GetFileExtension("example.pdf"));
            Console.WriteLine(fileUtility.GetFileExtension("example.new.pdf"));

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

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

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

            Console.WriteLine("Volume = {0:f2}", mathUtility.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", mathUtility.CalcDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", mathUtility.CalcDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", mathUtility.CalcDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", mathUtility.CalcDiagonalYZ());
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            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.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}",
                              MathUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));

            double x = 3;
            double y = 4;
            double z = 5;

            Console.WriteLine("Volume = {0:f2}", MathUtils.CalcVolume(x, y, z));
            Console.WriteLine("Diagonal XYZ = {0:f2}", MathUtils.CalcDistance3D(x, y, z));
            Console.WriteLine("Diagonal XY = {0:f2}", MathUtils.CalcDistance2D(x, y));
            Console.WriteLine("Diagonal XZ = {0:f2}", MathUtils.CalcDistance2D(x, z));
            Console.WriteLine("Diagonal YZ = {0:f2}", MathUtils.CalcDistance2D(y, z));
        }
Ejemplo n.º 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}",
                              MathUtils.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}",
                              MathUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));

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

            Console.WriteLine("Volume = {0:f2}", MathUtils.CalcVolume(width, height, depth));
            Console.WriteLine("Diagonal XYZ = {0:f2}", MathUtils.GetVectorMagnitude3D(width, height, depth));
            Console.WriteLine("Diagonal XY = {0:f2}", MathUtils.GetVectorMagnitude2D(width, height));
            Console.WriteLine("Diagonal XZ = {0:f2}", MathUtils.GetVectorMagnitude2D(width, depth));
            Console.WriteLine("Diagonal YZ = {0:f2}", MathUtils.GetVectorMagnitude2D(depth, height));
        }
Ejemplo n.º 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"));

            double x1 = 1;
            double y1 = -2;
            double x2 = 3;
            double y2 = 4;

            Console.WriteLine("Distance in the 2D space = {0:f2}",
                              MathUtils.CalcDistance2D(x1, y1, x2, y2));

            x1 = 5;
            y1 = 2;
            double z1 = -1;

            x2 = 3;
            y2 = -6;
            double z2 = 4;

            Console.WriteLine("Distance in the 3D space = {0:f2}",
                              MathUtils.CalcDistance3D(x1, y1, z1, x2, y2, z2));

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

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

            MathUtils.Width  = 3;
            MathUtils.Height = 4;
            MathUtils.Depth  = 5;
            Console.WriteLine("Volume = {0:f2}", MathUtils.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", MathUtils.CalcDiagonalXyz());
            Console.WriteLine("Diagonal XY = {0:f2}", MathUtils.CalcDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", MathUtils.CalcDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", MathUtils.CalcDiagonalYZ());
        }