In the Iphone SDK the distanceFromLocation:
says it doesn't use altitude at all. If I'm writing an app to track how far I walk/cycle/ect (yes I know there are a number that do this already), I'm curious how much that matters. Does anyone have experience with this?
When I say cartesian cords I mean something like this (in C#, not objective C):
double lattitude, longitude, altitude, x, y, z, x1, y1, z1, S;
double a = 6378137, C, f = 1 / 298.257224;
lattitude = <insert degrees> * Math.PI / 180.0;
longitude = <insert degrees> * Math.PI / 180.0;
altitiude = <insert altitude>
C= 1 / (Math.Sqrt(Math.Pow(Math.Cos(lattitude),2.0) + Math.Pow((1 - f),2.0) *Math.Pow(Math.Sin(lattitude),2.0)));
S = Math.Pow(1 - f, 2.0) * C;
x = (a*C+altitude) * Math.Cos(lattitude) * Math.Cos(longitude);
y = (a*C+altitude) *Math.Cos(lattitude) * Math.Sin(longitude);
z = (a*S+altitude) * Math.Sin(lattitude);
lattitude = <insert degrees new> * Math.PI / 180.0;
longitude = <insert degrees new> * Math.PI / 180.0;
altitiude = <insert altitude new>;
x1 = (a * C + altitude) * Math.Cos(lattitude) * Math.Cos(longitude);
y1 = (a * C + altitude) * Math.Cos(lattitude) * Math.Sin(longitude);
z1 = (a * S + altitude) * Math.Sin(lattitude);
double distance;
distance = Math.Sqrt(Math.Pow(x1 - x, 2.0) + Math.Pow(y1 - y, 2.0) + Math.Pow(z1 - z, 2.0));
Does anyone know how much of a difference it actually makes? Essentially how it is calculated precisely on iphone? Great circle distance? I can't seem to find the answer anywhere