Пример #1
0
    // Use this for initialization
    void Start()
    {
        instance  = this;
        _grid     = GameObject.Find("Grid").GetComponent <RectGrid>();
        _renderer = _grid.gameObject.GetComponent <Parallelepiped>();
        xMin      = 0;  //(int)_renderer.From[0];
        xMax      = 20; //(int)_renderer.To[0];
        zMin      = 0;  //(int)_renderer.From[2];
        zMax      = 20; //(int)_renderer.To[2];

        for (int x = xMin; x < xMax; x++)
        {
            for (int z = zMin; z < zMax; z++)
            {
                int        elevationMax = mapTopography[x][z];
                Coordinate coordinate   = new Coordinate();
                coordinate.x             = x;
                coordinate.z             = z;
                coordinate.y             = elevationMax - 1;
                coordinate.respawnMarker = respawnMarkerList.Exists(r => r[0] == x && r[1] == z);
                syncCoordinates.Add(coordinate);
            }
        }

        CacheMatrix();

        RenderVoxels();

        CursorController.instance.Load();
    }
Пример #2
0
        /// <summary>
        /// Добавление фигуры
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ButtonOk_Click(object sender, EventArgs e)
        {
            FigureBase figure = null;

            try
            {
                if (comboBoxType.Text == _figureKey[FigureType.Ball])
                {
                    figure = new Ball(GetCorrect(Convert.ToDouble, maskedTextBox1.Text));
                }

                if (comboBoxType.Text == _figureKey[FigureType.Pyramid])
                {
                    figure = new Pyramid(GetCorrect(Convert.ToDouble, maskedTextBox2.Text),
                                         GetCorrect(Convert.ToDouble, maskedTextBox3.Text));
                }

                if (comboBoxType.Text == _figureKey[FigureType.Parallelepiped])
                {
                    figure = new Parallelepiped(GetCorrect(Convert.ToDouble, maskedTextBox2.Text),
                                                GetCorrect(Convert.ToDouble, maskedTextBox3.Text), GetCorrect(Convert.ToDouble, maskedTextBox1.Text));
                }

                Figure = figure ?? throw new ArgumentException("Тип не выбран!");

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (ArgumentException)
            {
                MessageBox.Show("Неверные данные!");
            }
        }
Пример #3
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}",
                Geometry2DUtils.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine(
                "Distance in the 3D space = {0:f2}",
                Geometry3DUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));

            IFigure3D figure3D = new Parallelepiped(3d, 4d, 5d);
            Console.WriteLine("Volume = {0:f2}", figure3D.CalcVolume());
            Console.WriteLine(
                "Diagonal XYZ = {0:f2}",
                Geometry3DUtils.CalcDiagonalXYZ(figure3D.Width, figure3D.Height, figure3D.Depth));
            Console.WriteLine(
                "Diagonal XY = {0:f2}",
                Geometry2DUtils.CalcDiagonalXY(figure3D.Width, figure3D.Height));
            Console.WriteLine(
                "Diagonal XZ = {0:f2}",
                Geometry3DUtils.CalcDiagonalXZ(figure3D.Width, figure3D.Depth));
            Console.WriteLine(
                "Diagonal YZ = {0:f2}",
                Geometry3DUtils.CalcDiagonalYZ(figure3D.Height, figure3D.Depth));
        }
Пример #4
0
        public void TestParallelepipedPerimeter()
        {
            var obj = new Parallelepiped(Colour.White, Colour.Olive, 10, 1, 3, 1.2);
            var res = obj.Perimeter();

            Assert.AreEqual(Math.Round(res, 1), 20.8d);
        }
Пример #5
0
        private static string CalcOneMethod(SemiSpaceParameters parameters)
        {
            var bound12 = new Parallelepiped(-1, 1, -1, 1, FunctionsForSemiSpace.H, 1, 4, 4, 4)
            {
                Name = BoundNumber.Bound12
            };
            var bound2 = new Parallelepiped(-1, 1, -1, 1, FunctionsForSemiSpace.H, 1, 4, 4, 4)
            {
                Name = BoundNumber.Bound2
            };
            var bound13 = new Parallelepiped(-1, 1, 0, 1, -1, FunctionsForSemiSpace.H, 4, 4, 4)
            {
                Name = BoundNumber.Bound13
            };
            var bound3 = new Parallelepiped(-1, 1, 0, 1, -1, FunctionsForSemiSpace.H, 4, 4, 4)
            {
                Name = BoundNumber.Bound3
            };
            //   var bound12 = new Sphere(new Point3D(5, 0, FunctionsForSemiSpace.H)) { Name = BoundNumber.Bound12 };
            //var bound2 = new Sphere(new Point3D(5, 0, FunctionsForSemiSpace.H)) { Name = BoundNumber.Bound2 };
            //  var bound13 = new Sphere(new Point3D(5, 0, FunctionsForSemiSpace.H)) { Name = BoundNumber.Bound13 };
            //  var bound3 = new Sphere(new Point3D(5, 0, FunctionsForSemiSpace.H)) { Name = BoundNumber.Bound3 };
            var boundWithCondition = ConditionSetter.SetBoundSphere(bound12, bound2, bound13, bound3).ToList();
            //   var boundWithCondition = ConditionSetter.SetBoundSphere(bound12, bound2).ToList();
            var method = MethodFactory.GetSphereMethod(boundWithCondition, null, parameters);

            method.Solve();
            var plotter = PlotterFactory.GetPlotter(method.U, parameters);

            plotter.Plot();
            return(plotter.FormatedFileName);
        }
Пример #6
0
        public static Parallelepiped SetParallelepiped(out string name, out string type, out double a, out double b,
                                                       out double h, out double area, out double volume, out int tops, out int edges, out int sides)
        {
            Console.Write("Set Name of Parallelepiped: ");
            name = Console.ReadLine();

            Console.Write("Set Type of Parallelepiped: ");
            type = Console.ReadLine();

            Console.Write("Enter two sides of parallelepiped base and height:\n");
            Console.Write("a: ");
            a = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
            Console.Write("b: ");
            b = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
            Console.Write("h: ");
            h = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);

            Parallelepiped parallelepiped = new Parallelepiped(a, b, h);

            parallelepiped.Name = name;
            parallelepiped.Type = type;
            area   = parallelepiped.Area();
            volume = parallelepiped.Volume();
            tops   = parallelepiped.QuantityOfTops();
            edges  = parallelepiped.QuantityOfEdges();
            sides  = parallelepiped.QuantityOfSides();

            parallelepiped.Areaa   = area;
            parallelepiped.Volumee = volume;

            return(parallelepiped);
        }
Пример #7
0
        public void TestParallelepipedVolume()
        {
            var obj = new Parallelepiped(Colour.White, Colour.Olive, 10, 1, 3, 1.2);
            var res = obj.Volume();

            Assert.AreEqual(Math.Round(res, 1), 3.6d);
        }
Пример #8
0
        void Start()
        {
            _grid     = ForbiddenTiles._grid;
            _renderer = _grid.gameObject.GetComponent <Parallelepiped>();

            _grid.AlignTransform(transform);
        }
    protected virtual IOperation CreateOperationFromEditor(Vector3 start, Vector3 end, TerrainToolEditor editor)
    {
        var     voxelType = EditorUtils.GetVoxelTypeFromIndex(VoxelTypeIndex, editor.Terrain.VoxelTypeSet);
        Vector3 vL, vH, vW;

        UMath.ComputeEdgeVectors(start, end, Width, Height, out vL, out vH, out vW);
        return(Parallelepiped.CreateFromUnityWorld(editor.Terrain, Dig, start, vL, vH, vW, voxelType));
    }
Пример #10
0
        public void VolumePositiveTest(uint sizeA, uint sizeB, uint sizeC)
        {
            var expected       = (double)sizeA * sizeB * sizeC;
            var parallelepiped = new Parallelepiped(sizeA, sizeB, sizeC);
            var actual         = parallelepiped.Volume;

            Assert.AreEqual(expected, actual);
        }
        public void AreaTestMethod()
        {
            Parallelepiped figure   = new Parallelepiped(Colour.White, Colour.Yellow, 0.1, 1, 1, 1);
            double         expected = 6;
            double         actual   = figure.Area();

            Assert.AreEqual(expected, actual);
        }
        public void VolumeTestMethod()
        {
            Parallelepiped figure   = new Parallelepiped(Colour.White, Colour.Yellow, 0.1, 1.1, 1.6, 1.2);
            double         expected = 2.112;
            double         actual   = figure.Volume();

            Assert.AreEqual(expected, actual);
        }
Пример #13
0
        static void Main(string[] args)
        {
            Parallelepiped A = new Parallelepiped(1, 2, 3);

            A.Square();
            A.SumOfRebers();
            Console.Read();
        }
Пример #14
0
        static void Main(string[] args)
        {
            Parallelepiped p = new Parallelepiped()
            {
                Center = new Vector3(200, 200, 200),
                Size   = new Vector3(100, 200, 400)
            };

            p.DrawParallel(Shell.Instance);
        }
Пример #15
0
 public void ConstructorNegativeTest(uint sizeA, uint sizeB, uint sizeC)
 {
     Assert.Throws <Exception>
     (
         delegate
     {
         var parallelepiped = new Parallelepiped(sizeA, sizeB, sizeC);
     }
     );
 }
Пример #16
0
 // Use this for initialization
 void Awake()
 {
     instance  = this;
     _grid     = GameObject.Find("Grid").GetComponent <RectGrid>();
     _renderer = _grid.gameObject.GetComponent <Parallelepiped>();
     xMin      = (int)_renderer.From[0];
     xMax      = (int)_renderer.To[0];
     zMin      = (int)_renderer.From[2];
     zMax      = (int)_renderer.To[2];
 }
Пример #17
0
        static void Main(string[] args)
        {
            Cone           cone = new Cone(1, 7);
            Parallelepiped pl   = new Parallelepiped(2, 6, 8);
            Ball           ball = new Ball(5);

            Console.WriteLine(cone.Info());
            Console.WriteLine(pl.Info());
            Console.WriteLine(ball.Info());
        }
Пример #18
0
        public void CalculateVolume(int a, int b, int c, int expected)
        {
            var parallel = new Parallelepiped();

            parallel.a = a;
            parallel.b = b;
            parallel.c = c;
            var actual = parallel.CalculateVolume();

            Assert.AreEqual(expected, actual);
        }
Пример #19
0
        public void Volume(double Height, double Width, double Lenght, double volume)
        {
            var parallelepiped = new Parallelepiped();

            parallelepiped.Height = Height;
            parallelepiped.Width  = Width;
            parallelepiped.Lenght = Lenght;
            var result = parallelepiped.Volume;

            Assert.AreEqual(volume, result);
        }
Пример #20
0
        public void Parallelepiped_Constructor_ProperlyInitializeFields()
        {
            //arrange && act
            InsertableBody parallelepiped = new Parallelepiped(100, 10, 10, 10);

            //assert
            Assert.True(parallelepiped.GetDensity().AreEqual(100), "Parallelepiped constructor modified provided density.");
            Assert.True(parallelepiped.GetMass().AreEqual(100000), "Parallelepiped constructor incorrectly inits mass.");
            Assert.True(parallelepiped.GetVolume().AreEqual(1000), "Parallelepiped constructor incorrectly inits volume.");

            /*Assert.True( parallelepiped.GetWidth().AreEqual( 10 ), "Parallelepiped constructor incorrectly inits width." );
            *  Assert.True( parallelepiped.GetHeight().AreEqual( 10 ), "Parallelepiped constructor incorrectly inits height." );
            *  Assert.True( parallelepiped.GetDepth().AreEqual( 10 ), "Parallelepiped constructor incorrectly inits depth." );*/
        }
Пример #21
0
        static void Main(string[] args)
        {
            Parallelepiped NewParalel = new Parallelepiped(new Point3D(0, 0, 0), 4, 7, 8, 40);
            Ellipsoid      NewEllips  = new Ellipsoid(new Point3D(1, 2, 4), 5, 2, 7);


            NewEllips.MoveToPoint(new Point3D(1, 1, 1));
            NewParalel.MoveToPoint(new Point3D(1, 1, 1));

            Console.WriteLine("Surface area of elipsoid is {0}, and volume is {1}", NewEllips.SurfaceArea, NewEllips.ShapeVolume);
            Console.WriteLine("Surface area of parallelogram is {0}, and volume is {1}", NewParalel.SurfaceArea, NewParalel.ShapeVolume);

            Console.ReadKey();
        }
Пример #22
0
            /// <summary>
            ///   Construct a new grid made of two rectangular grids.
            /// </summary>
            public Grid(RectGrid mainGrid, RectGrid subGrid,
                        Parallelepiped mainRenderer, Parallelepiped subRenderer,
                        float height)
            {
                this._mainGrid = mainGrid;
                this._subGrid  = subGrid;

                this._mainRenderer = mainRenderer;
                this._subRenderer  = subRenderer;

                this._spacing = 10.0f;
                this._mode    = Mode.Flex;

                this.Update(height);
            }
Пример #23
0
            public Series()
            {
                Console.WriteLine("Введите длинну, ширину и высоту параллелепипеда, а так же его угол у основания");
                Parallelepiped par = new Parallelepiped(double.Parse(Console.ReadLine()), double.Parse(Console.ReadLine()), double.Parse(Console.ReadLine()), double.Parse(Console.ReadLine()));

                bodies[0] = par;
                Console.WriteLine("Введите радиус и высоту конуса:");
                Cone cone = new Cone(double.Parse(Console.ReadLine()), double.Parse(Console.ReadLine()));

                bodies[1] = cone;
                Console.WriteLine("Введите радиус шара:");
                Ball ball = new Ball(double.Parse(Console.ReadLine()));

                bodies[2] = ball;
            }
Пример #24
0
        public void DoWork()
        {
            var sw = new Stopwatch();

            sw.Start();
            //  var bound = new ParallelepipedNearBound();
            var bound = new Parallelepiped();
            var boundWithCondition = ConditionSetter.SetKirghoffCondition(bound);
            var source             = new InnerSourcePlate();
            //  var innerSource = new List<InnerSourceWithFunction<Point3D>>(); //no innersors CollocationKirghoffMethod
            var innerSource = InnerSourceFactory.GetSourcesParalelepiped(source);

            var eps = 1;

            var    paperKirghoff = new PaperKirghoff1UmovaProgram(bound, innerSource);
            var    dPrevious     = paperKirghoff.GetSolutionVector();
            Vector dCurrent;

            while (true)
            {
                var method1 = MethodFactory.GetJakobiMethod(boundWithCondition, innerSource, dPrevious);
                method1.Solve();
                dCurrent  = dPrevious + method1.Solution;
                dPrevious = dCurrent;
                Console.WriteLine("d: " + method1.Solution.Norma());
                if (method1.Solution.Norma() < eps)
                {
                    break;
                }
            }
            var method = MethodFactory.GetCollocationKirghoffMethod(
                boundWithCondition,
                innerSource,
                KirghoffTransformation.Pow,
                KirghoffTransformation.ConversePow);

            method.Solution = dCurrent;

            var plotter = PlotterFactory.GetPlotter(bound, method.U);

            plotter.Plot();
            // Console.WriteLine("Total time: " + sw.ElapsedMilliseconds);

            /*f-1*f(d0)=x
             * d1=d0-x,
             * f-1*f(d1)=x
             * d2=d1-x*/
        }
Пример #25
0
 public void ParallelepipedIntoRectangularDoor(Parallelepiped parallelepiped)
 {
     if ((parallelepiped.WidthParallelepiped < heightRectangularDoor && parallelepiped.HeightParallelepiped < widthRectangularDoor) ||
         (parallelepiped.WidthParallelepiped < widthRectangularDoor && parallelepiped.HeightParallelepiped < heightRectangularDoor) ||
         (parallelepiped.WidthParallelepiped < heightRectangularDoor && parallelepiped.LengthParallelepiped < widthRectangularDoor) ||
         (parallelepiped.WidthParallelepiped < widthRectangularDoor && parallelepiped.LengthParallelepiped < heightRectangularDoor) ||
         (parallelepiped.LengthParallelepiped < heightRectangularDoor && parallelepiped.HeightParallelepiped < widthRectangularDoor) ||
         (parallelepiped.LengthParallelepiped < widthRectangularDoor && parallelepiped.HeightParallelepiped < heightRectangularDoor))
     {
         Console.WriteLine("Ура!Ваш стандартний холодильник  можливо пронести через стандартні двері!");
     }
     else
     {
         Console.WriteLine("Ваш холодильник не можливо пронести через стандартні двері!");
     }
 }
Пример #26
0
        public void ParallelepipedIntoRoundDoor(Parallelepiped parallelepiped)
        {
            double diagonalParallelepiped;

            diagonalParallelepiped = Math.Sqrt(Math.Pow(parallelepiped.HeightParallelepiped, 2) + Math.Pow(parallelepiped.LengthParallelepiped, 2)
                                               + Math.Pow(parallelepiped.WidthParallelepiped, 2));

            if (diagonalParallelepiped < diameterRoundDoor)
            {
                Console.WriteLine("Ура!Ваш холодильник  проходить через круглі двері!");
            }
            else
            {
                Console.WriteLine("Ваш холодильник не проходить через круглі двері!");
            }
        }
        private void DrawFacet()
        {
            PreviewPathVisibility = false;

            _drawTheFirst = () =>
            {
                Detail detail = new Parallelepiped(null, ParallelepipedWidth, CylinderHeigth, ParallelepipedLength, -75, 0);
                detail = new Cylinder(detail, CylinderRadius, CylinderHeigth, ApproksimationValue, -75, 0);

                var facetsList   = detail.FacetCollection().ToList();
                var resultDetail = DetailsCombine.DoubleDetailFacet(detail);
                facetsList.AddRange(resultDetail);
                _resultTransformationFacets = (IEnumerable <IFacet>)facetsList.DeepClone();
                Transform(_resultTransformationFacets);
            };
            _drawTheFirst();
        }
Пример #28
0
        private void button1_Click(object sender, EventArgs e)
        {
            Parallelepiped Parallelepiped1 = new Parallelepiped();

            Parallelepiped1.a = int.Parse(textBox1.Text);
            Parallelepiped1.b = int.Parse(textBox9.Text);
            Parallelepiped1.c = int.Parse(textBox11.Text);
            textBox12.Text    = Parallelepiped1.V().ToString();
            textBox13.Text    = Parallelepiped1.Area().ToString();

            Elipsoid Elipsoid1 = new Elipsoid();

            Elipsoid1.a    = int.Parse(textBox4.Text);
            Elipsoid1.b    = int.Parse(textBox10.Text);
            Elipsoid1.c    = int.Parse(textBox6.Text);
            textBox14.Text = Elipsoid1.V().ToString();
            textBox15.Text = Elipsoid1.Area().ToString();
        }
Пример #29
0
 private void button1_Click(object sender, EventArgs e)
 {
     textBoxV.Clear();
     if ((textBoxA.Text == "") || (textBoxB.Text == "") || (textBoxC.Text == ""))
     {
         MessageBox.Show("Поля пусты");
         return;
     }
     int a, b, c;
     double V = 0;
     if ((int.TryParse(textBoxA.Text, out a))
         && (int.TryParse(textBoxB.Text, out b))
         && (int.TryParse(textBoxC.Text, out c)))
     {
         Parallelepiped parallelepiped = new Parallelepiped(a, b, c);
         V = parallelepiped.ReturnVolume();
         textBoxV.AppendText(V.ToString());
     }
 }
Пример #30
0
        /// <summary>
        ///   Builds the matrix and sets everything up, gets called by a script
        ///   attached to the grid object.
        /// </summary>
        /// <param name="grid">
        ///   The grid will be assigned to this class's <c>_grid</c>.
        /// </param>
        /// <param name="renderer">
        ///   The grid's parallelepiped renderer is used for determining the
        ///   size of the matrix.
        /// </param>
        public static void Initialize(RectGrid grid, Parallelepiped renderer)
        {
            _grid = grid;

            // Amount of rows and columns based on the rendering range (assumes
            // the From is the zero-vector).
            var rows    = Mathf.FloorToInt(renderer.To.x);
            var columns = Mathf.FloorToInt(renderer.To.y);

            _tiles = new bool[rows, columns];

            for (var row = 0; row < rows; ++row)
            {
                for (var column = 0; column < columns; ++column)
                {
                    _tiles[row, column] = true;
                }
            }
        }
Пример #31
0
        public static List <BoundWithCondition <Point3D> > SetMixedCondition(Parallelepiped bound)
        {
            var leftRight = new Pane();

            leftRight.Add(bound.LeftPane);
            leftRight.Add(bound.RightPane);
            var rest = new Pane();

            rest.Add(bound.FrontPane);
            rest.Add(bound.BackPane);
            rest.Add(bound.TopPane);
            rest.Add(bound.BottomPane);
            return(new List <BoundWithCondition <Point3D> >
            {
                new BoundWithCondition <Point3D>(leftRight, ConditionType.Dirichlet, FunctionFactory.G),
                new BoundWithCondition <Point3D>(rest, ConditionType.Robin, FunctionFactory.G),
                // new BoundWithCondition<Point3D>(topbottom, ConditionType.Neumann, FunctionFactory.G)
            });
        }
Пример #32
0
        static void Main(string[] args)
        {
            List <IShape>   twoD   = new List <IShape>();
            List <IShape3D> threeD = new List <IShape3D>();
            string          line;

            char[] trim = { ' ' };
            System.IO.StreamReader file = new System.IO.StreamReader(@"c:\Users\Elena\source\repos\ZF_Practica\Task1\Shapes.txt");

            while ((line = file.ReadLine()) != null)
            {
                line = line.TrimEnd(trim);
                string[] words = line.Split(' ');
                if (words.Length == 3)
                {
                    Parallelepiped obj = new Parallelepiped(int.Parse(words[0]), int.Parse(words[1]), int.Parse(words[2]));
                    threeD.Add(obj);
                }
                if (words.Length == 2)
                {
                    Rectangle obj = new Rectangle(int.Parse(words[0]), int.Parse(words[1]));
                    twoD.Add(obj);
                }
                if (words.Length == 1)
                {
                    Circle obj = new Circle(int.Parse(words[0]));
                    twoD.Add(obj);
                }
            }
            foreach (var elem in twoD)
            {
                elem.PrintData();
            }
            foreach (var elem in threeD)
            {
                elem.PrintData();
            }

            file.Close();

            Console.ReadLine();
        }
Пример #33
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 testParallelepiped = new Parallelepiped(3, 4, 5);
            Console.WriteLine("Volume = {0:f2}", testParallelepiped.Volume);
            Console.WriteLine("Diagonal XYZ = {0:f2}", testParallelepiped.DiagonalXYZ);
            Console.WriteLine("Diagonal XY = {0:f2}", testParallelepiped.DiagonalXY);
            Console.WriteLine("Diagonal XZ = {0:f2}", testParallelepiped.DiagonalXZ);
            Console.WriteLine("Diagonal YZ = {0:f2}", testParallelepiped.DiagonalYZ);
        }
        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}", MeasuringUtils.CalcDistance2D(1, -2, 3, 4));
            Console.WriteLine("Distance in the 3D space = {0:f2}", MeasuringUtils.CalcDistance3D(5, 2, -1, 3, -6, 4));

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

            Console.WriteLine("Volume = {0:f2}", paralelepiped.CalcVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", paralelepiped.CalcDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", paralelepiped.CalcDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", paralelepiped.CalcDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", paralelepiped.CalcDiagonalYZ());
        }
 public static double CalcVolume(Parallelepiped parallelepiped)
 {
     double volume = parallelepiped.Width * parallelepiped.Height * parallelepiped.Depth;
     return volume;
 }