Geometry
XpointA = 1
YpointA = 1
XpointB = 2
YpointB = 2
distance = ( ( XpointA - XpointB ) ** 2 ) + ( ( YpointA - YpointB ) ** 2 ) ** 0.5
KMonearth = distance * 100 # Very rough estimate for when using longtitude and latitude (in the Netherlands)
More precise should be like this I found on stackoverflow[1]
from math import sin, cos, sqrt, atan2, radians
# Approximate radius of earth in km (https://en.wikipedia.org/wiki/Earth_radius)
R = 6371.0
lat1 = radians(Alat)
lon1 = radians(Alon)
lat2 = radians(Blat)
lon2 = radians(Blon)
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat / 2)**2 + cos(lat1) * cos(lat2) * sin(dlon / 2)**2
c = 2 * atan2(sqrt(a), sqrt(1 - a))
distance = R * c
print("Result: ", distance)