Check out example codes for "Input the coördinates and calculate the distance between them c#". It will help you in understanding the concepts better.

Code Example 1

static void Main() {
  double d, x1, x2, y1, y2;
 
  Console.Write("Enter coordinates for point A: ");
  x1 = Double.Parse(Console.ReadLine());
  y1 = Double.Parse(Console.ReadLine());
 
  Console.Write("Enter coordinates for point B: ");
  x2 = Double.Parse(Console.ReadLine());
  y2 = Double.Parse(Console.ReadLine());
   
  d = Math.Sqrt(Math.Pow(x1 - x2, 2) + Math.Pow(y1 - y2, 2));
     
  Console.Write("Distance between points: " + d);
  Console.ReadKey();
}

Learn ReactJs, React Native from akashmittal.com