Beispiel #1
0
 public double DistanceTo(_3DPoint p2)
 {
     return(Math.Sqrt((x - p2.GetX()) * (x - p2.GetX()) +
                      (y - p2.GetY()) * (y - p2.GetY()) +
                      (z - p2.GetZ()) * (z - p2.GetZ())));
     //return Math.Sqrt((x - p2.GetX()));
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            _3DPoint point = new _3DPoint(5, 7, 2);

            Console.WriteLine(point.ToString());

            _3DPoint p2 = new _3DPoint(2, 3, 4);

            Console.WriteLine(point.DistanceTo(p2));
        }