Its simple x =sqrt(a*a+b*b) - but you need to get map coeficient using some familiar target. So you take some target for which you know distance. Calculate distance using cordinates and then you see how much in coordinates is 1 distance. And then you use that coeficient when calculating distance.