コード例 #1
0
        public static void Main()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            Point3D firstPoint = new Point3D(1, 20, 30);

            Console.WriteLine(firstPoint);
            Point3D secondPoint = new Point3D(5, 10, 35);

            Console.WriteLine(secondPoint);

            Point3D thirdPoint = Point3D.Start0;

            Console.WriteLine(thirdPoint);

            double distance = Distance.CalculateDistance(firstPoint, secondPoint);

            Console.WriteLine(distance);

            Path pathList = new Path();

            pathList.AddPath(firstPoint);
            pathList.AddPath(secondPoint);

            //Console.WriteLine(pathList);

            PathStorage.WritePath(pathList, "..\\..\\test.txt");
            PathStorage.ReadPath("..\\..\\test.txt");
            Console.WriteLine(PathStorage.ReadPath("..\\..\\test.txt"));
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine(new Point3D(2, 5, 6));                                               // point test

            Console.WriteLine(Distance.CalcDistance(new Point3D(5, 6, 7), new Point3D(2, 1, 8)));  // distance calculation test

            var path = new Path(new Point3D(1, 2, 3), new Point3D(4, 6, 8), new Point3D(9, 5, 3)); // path test

            Console.WriteLine(path);

            PathStorage.WritePath(path, "../../PathFile.txt");                                                // writing path to file
            Console.WriteLine("Reading path from file... \n{0}", PathStorage.LoadPath("../../PathFile.txt")); // reading path from file
        }