Beispiel #1
0
 public static double CalculateDistance(Point3D first, Point3D second)
 {
     double dx = Math.Abs(first.X - second.X);
     double dy = Math.Abs(first.Y - second.Y);
     double dz = Math.Abs(first.Z - second.Z);
     return Math.Sqrt(dx * dx + dy * dy + dz * dz);
 }
Beispiel #2
0
        //Method for parsing a line to 3D point
        static Point3D ParseToPoint(string input)
        {
            string[] splited = input.Split('{', '}', ',');

            Point3D result = new Point3D();
            result.X = int.Parse(splited[1]);
            result.Y = int.Parse(splited[2]);
            result.Z = int.Parse(splited[3]);

            return result;
        }
Beispiel #3
0
 public void AddPoint(Point3D toAdd)
 {
     this.pointSequence.Add(toAdd);
 }