예제 #1
0
        public static void Main()
        {
            var point      = new Point3D(1, 1, 1);
            var startPoint = Point3D.StartPoint;
            var distance   = CalculateDistance.DistanceBetweenTwoPoints(startPoint, point);

            Console.WriteLine("Distance: {0:F2}", distance);

            var path = new Path();

            path.AddPoint(new Point3D(2, 3, 6));
            path.AddPoint(new Point3D(-1, 2, 4));
            path.AddPoint(new Point3D(5, 1, 5));

            PathStorage.SavePath(path);
            Console.WriteLine(PathStorage.LoadPath());
        }
예제 #2
0
        private static void ProblemFour()
        {
            Path test1 = new Path();

            test1.AddPoint();
            test1.AddPoint(new Point3D(1, 2, 3));
            test1.AddPoint(4, 5, 6);


            Console.WriteLine(test1); // testing toString for a path

            PathStorage.WritePathToFile("test.txt", test1);

            //find the file at DefiningClassesPartTwo-HW\Euclidian3DSpace\bin\Debug
            Path readFromFile = PathStorage.ReadPathFromFile("test.txt");

            Console.WriteLine(readFromFile);
        }
예제 #3
0
        static void Main()
        {
            Path path = new Path();

            path.AddPoint(new Point3D(1, 2, 3));
            path.AddPoint(new Point3D(6, -6, 1));
            path.AddPoint(new Point3D(1, 2, 3));
            path.AddPoint(new Point3D(5, -4, 4));
            path.AddPoint(new Point3D(8, 8, 8));
            path.AddPoint(new Point3D(-8, -8, -8));
            path.AddPoint(new Point3D(1, 1, 3));
            path.AddPoint(new Point3D(-1, 7, -3));
            path.AddPoint(new Point3D(13, 5, 3));
            path.AddPoint(new Point3D(-1, -12, -6));

            PathStorage.SavePath(path);

            Path loaded = PathStorage.LoadPath("path.txt");

            loaded.PrintAllSequences();
        }