// Example of using the GeographicLib::Geodesic class#include <iostream>#include <exception>#include <GeographicLib/Geodesic.hpp>#include <GeographicLib/Constants.hpp>usingnamespacestd;usingnamespaceGeographicLib;intmain(){try{Geodesicgeod(Constants::WGS84_a(),Constants::WGS84_f());// Alternatively: const Geodesic& geod = Geodesic::WGS84();{// Sample direct calculation, travelling about NE from JFKdoublelat1=40.6,lon1=-73.8,s12=5.5e6,azi1=51;doublelat2,lon2;geod.Direct(lat1,lon1,azi1,s12,lat2,lon2);cout<<lat2<<" "<<lon2<<"\n";}{// Sample inverse calculation, JFK to LHRdoublelat1=40.6,lon1=-73.8,// JFK Airportlat2=51.6,lon2=-0.5;// LHR Airportdoubles12;geod.Inverse(lat1,lon1,lat2,lon2,s12);cout<<s12<<"\n";}}catch(constexception&e){cerr<<"Caught exception: "<<e.what()<<"\n";return1;}}