The purpose is to calculate the distance travelled. For this I calculate an euclidean distance
with velocity, acceleration and time. I get this data from GPS. Here's my calculation:
private float getDistanceTraveled(float vend, float vstart, long timeDifference){
float distance = 0;
if(vend == 0 && vstart == 0)
return distance;
if(vend - vstart == 0)
distance = vend * timeDifference;
else
distance = (vend * vend - vstart * vstart)
/ ((2 * (vend - vstart) / timeDifference);
return distance;
}
What is the usual way to convert this distance to a shortest distance over earth surface?
I did it with simple circle calculations, where my given distance is the chord c
and the radius r
is the earth radius.
double distance = 2 * r * Math.asin(c / (2 * r));
I'm not 100% sure, if this is the correct way to calculate the euclidean distance and convert it. Have I take something else into account?
I'm familiar with the Haversine Formula
, but I can't use the coordinates in this approach.