#82 Earth radius using WGS84 model

closed
nobody
None
5
2011-08-28
2011-08-07
DJ39
No

For the computation of the distance between 2 GPS points, it would be more precise to consider the WGS84 model to compute the local earth radius instead of considering the earth radius as a constant.

Here is a C coding of the function that computes the local earth radius as a function of the latitude (in radian).
One can take (local_earth_radius(lat1)+local_earth_radius(lat2))/2 as the earth radius in the method computeDistance().

double local_earth_radius(double lat_rad)
{
// WGS84 data
double a = 6378137.0;
double f = 1./298.257222101;
double e = sqrt(2.*f-f*f);

double R1, R2;
double dum;

dum = 1. -e*e*sin(lat_rad)*sin(lat_rad);

R1 = a * (1. - e*e) / ( dum*sqrt(dum) );
R2 = a / sqrt(dum);

return( sqrt(R1*R2) );
}

Discussion

  • Wolfgang
    Wolfgang
    2011-08-28

    is implemented with a similar algorithm in 11.8.2 in the method MtMath.distanceVincenty()

     
  • Wolfgang
    Wolfgang
    2011-08-28

    • status: open --> closed