public static double GetDistance(Point3D firstPoint, Point3D secondPoint)
        {
            decimal diffX = (firstPoint.X - secondPoint.X) * (FirstPoint.X - secondPoint.X);
            decimal diffY = (firstPoint.Y - secondPoint.Y) * (FirstPoint.Y - secondPoint.Y);
            decimal diffZ = (firstPoint.Z - secondPoint.Z) * (FirstPoint.Z - secondPoint.Z);

            double result = Math.Sqrt((double)(diffX + diffY + diffZ));

            return result;
        }
Пример #2
0
        static void Main()
        {
            Point3D x = new Point3D(1, 1, 1);
            Point3D y = new Point3D(2, 2, 2);
            Point3D z = new Point3D(3, 3, 3);
            Path newPath = new Path();
            newPath.AddPoint(x);
            newPath.AddPoint(y);
            newPath.AddPoint(z);
            Console.WriteLine("Path before serialization:");
            Console.WriteLine(newPath.ToString());

            PathStorage.SavePath(newPath);
            Path list = PathStorage.LoadPath();
            Console.WriteLine("Path after deserialization:");
            Console.WriteLine(newPath.ToString());
        }
Пример #3
0
 public void AddPoints(Point3D point)
 {
     pointsSequence.Add(point);
 }
Пример #4
0
 public void AddPoint(Point3D point)
 {
     this.pathHolder.Add(point);
 }