What about vector algebra?
distanceTotal = sqrt(distance.x^2 + distance.y^2); //Magnitude of the vector is equal to the rooted squares of its components
I haven't used the CL library, but if you can get a meaningful unit of measurement (I.E- turning latitude and longitude into a useful measure of distance), it should be as simple as that to get the distance.
|