static void Main(string[] args) { Point3D A = new Point3D(2, 6, 8.6); Point3D B = new Point3D(9, 7, 4.5); Console.WriteLine(DistanceCalculator.CalcDistance(A,B)); }
public static double CalcDistance(Point3D A, Point3D B) { double res = Math.Sqrt(Math.Pow((A.X - B.X), 2) + Math.Pow((A.Y - B.Y), 2) + Math.Pow((A.Z - B.Z), 2)); return res; }