コード例 #1
0
 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));
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: KostaDinkov/SoftUni
 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}");
 }