examples/example-Geodesic-small.cpp
Go to the documentation of this file.
1 // Small example of using the GeographicLib::Geodesic class
2 
3 #include <iostream>
5 
6 using namespace std;
7 using namespace GeographicLib;
8 
9 int main() {
10  const Geodesic& geod = Geodesic::WGS84();
11  // Distance from JFK to LHR
12  double
13  lat1 = 40.6, lon1 = -73.8, // JFK Airport
14  lat2 = 51.6, lon2 = -0.5; // LHR Airport
15  double s12;
16  geod.Inverse(lat1, lon1, lat2, lon2, s12);
17  cout << s12 / 1000 << " km\n";
18 }
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
main
int main()
Definition: examples/example-Geodesic-small.cpp:9
GeographicLib::Geodesic::Inverse
Math::real Inverse(real lat1, real lon1, real lat2, real lon2, real &s12, real &azi1, real &azi2, real &m12, real &M12, real &M21, real &S12) const
Definition: Geodesic.hpp:674
std
Definition: BFloat16.h:88
GeographicLib::Geodesic
Geodesic calculations
Definition: Geodesic.hpp:172
Geodesic.hpp
Header for GeographicLib::Geodesic class.


gtsam
Author(s):
autogenerated on Mon Jul 1 2024 03:01:15