calculate distance between 2 points X Y axis
#include <stdio.h>
#include <math.h>
//math.h library for square root and power functions
//uses pythagorean theorem of triangles to calculate distance
float Distance(float x1, float y1, float x2, float y2)
{
return sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
}