public static double CalculateDistance(Point3D pointA, Point3D pointB) { return Sqrt( Pow((pointA.X - pointB.X), 2) + Pow((pointA.Y - pointB.Y), 2) + Pow((pointA.Z - pointB.Z), 2)); }
static void Main(string[] args) { Point3D pointA = new Point3D(5, 3, 3.4); Point3D pointB = new Point3D(1, 2.4, 4.4); double distanceAB = CalculateDistance(pointA, pointB); Console.WriteLine($"Distance between A and B is : {distanceAB}"); }