function res=computeRn(lat)
    c_wgs84_a = 6378137.0;
    c_wgs84_e2 = 0.00669437999013;
    lat_sin = sin(lat);
    res=c_wgs84_a / sqrt(1 - c_wgs84_e2 * (lat_sin * lat_sin));