Latest original code (geodesic_cpp_03_02_2008)