Knowing the coordinates of two points, you can calculate the distance between them according to Pythagorean theorem.
// calculate the distance between 2 point in c #include <stdio.h> #include <math.h> float distance = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));