public static double CalculationDistance(Point3D p1, Point3D p2)
 {
     double distance = Math.Sqrt((p1.X - p2.X) * (p1.X - p2.X) +
                                 (p1.Y - p2.Y) * (p1.Y - p2.Y) +
                                 (p1.Z - p2.Z) * (p1.Z - p2.Z));
     return distance;
 }
        static void Main()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            Point3D firstTestPoint = new Point3D(1.5, 2.5, 3.5);
            Point3D secondTestPoint = new Point3D(-1, -4, 7);
            Point3D thirdTestPoint = new Point3D(1, 2, 3);

            Path testPath = new Path();
            testPath.AddPoint(firstTestPoint);
            testPath.AddPoint(secondTestPoint);
            testPath.AddPoint(thirdTestPoint);

            PathStorage.SavePath(testPath, "sample"); //saving the test points to the file "pathsample.txt"
            Path loadedPath = PathStorage.LoadPath(@"../../pathsample.txt"); //loading the saved file and printing the points
            for (int i = 0; i < loadedPath.PathList.Count; i++)
            {
                Console.WriteLine(loadedPath.PathList[i]);
            }
        }
예제 #3
0
 // Problem 2
 static Point3D()
 {
     o = new Point3D(0, 0, 0);
 }
예제 #4
0
 public void Remove(Point3D point)
 {
     this.PathList.Remove(point);
 }
예제 #5
0
 public void AddPoint(Point3D point)
 {
     this.PathList.Add(point);
 }