Esempio n. 1
0
        static void Main()
        {
            ////Create point
            Point3D point = new Point3D(1, 2, 3);
            Point3D secondPoint = new Point3D(2, 3, 4);

            //print point
            Console.WriteLine(point);
            Console.WriteLine(secondPoint);
            Console.WriteLine(Point3D.center);

            //calculte distance
            double distance = Distance.CalculteDistance(point, secondPoint);
            Console.WriteLine(distance);

            distance = Distance.CalculteDistance(point, Point3D.center);
            Console.WriteLine(distance);

            //Load paths
            List<Path> paths = PathStorage.LoadPaths();

            //print loaded paths
            PrintPaths(paths);

            //Safe path to file
            Point3D firstPathPont = new Point3D(10, 11, 12);
            Point3D secondPathPoint = new Point3D(15, 16, 17);
            Point3D thirdPathPoint = new Point3D(20, 21, 22);

            Path path = new Path(firstPathPont, secondPathPoint, thirdPathPoint);

            PathStorage.SavePath(path);

            List<Path> pathsAfterLoading = PathStorage.LoadPaths();

            //print paths
            PrintPaths(pathsAfterLoading);
        }
Esempio n. 2
0
 static void Main()
 {
     // testing points
     Point3D firstPoint = Point3D.CoordinateSystemCenter;
     Point3D seconPoint = new Point3D(1, 2, 1);
     Console.WriteLine("First point -> " + firstPoint);
     Console.WriteLine("Second point -> " + seconPoint);
     Console.WriteLine("Distance between the two points -> "
         + DistanceBetweenPoints.CaclculateDistance(firstPoint, seconPoint));
     Path myPath = new Path(5);
     myPath.AddPoint(firstPoint);
     myPath.AddPoint(firstPoint);
     myPath.AddPoint(new Point3D(3, 6, 1.5));
     myPath.AddPoint(firstPoint);
     myPath.AddPoint(seconPoint);
     myPath.AddPoint(firstPoint);
     myPath.AddPoint(seconPoint);
     myPath.RemovePoint(seconPoint);
     myPath.RemovePointAt(1);
     PathStorage.SaveToFile(myPath,null);
     Path otherPath = PathStorage.LoadFromFile("../../test.txt");
     otherPath.RemovePoint(firstPoint);
     PathStorage.SaveToFile(otherPath, "text.txt");
 }