I'm actually trying to calculate the distance between the max and min point in the x and y coordinates for the MKMapPoints
.
For that, I'm doing this (max distance in y axis):
MKMapPoint test1, test2;
double dist;
test1.x = 0.0;
test1.y = 0.0;
test2.x = 0.0;
test2.y = MKMapSizeWorld.height;
dist = MKMetersBetweenMapPoints(test2, test1);
NSLog(@"Distance %f",dist);
I get 18997878.291251 in the console. But when I change the distance calculation to:
dist = MKMetersBetweenMapPoints(test1, test2);
I get 18873651.664238, so I don't understand what's the difference. I don't even know if I'm doing the right thing to get the max values of distance in the x and y axes.
Any help will be appreciated.