examples/example-Ellipsoid.cpp
Go to the documentation of this file.
1 // Example of using the GeographicLib::Ellipsoid class
2 
3 #include <iostream>
4 #include <exception>
6 
7 using namespace std;
8 using namespace GeographicLib;
9 
10 int main() {
11  try {
12  Ellipsoid wgs84(Constants::WGS84_a(), Constants::WGS84_f());
13  // Alternatively: const Ellipsoid& wgs84 = Ellipsoid::WGS84();
14  cout << "The latitude half way between the equator and the pole is "
15  << wgs84.InverseRectifyingLatitude(45) << "\n";
16  cout << "Half the area of the ellipsoid lies between latitudes +/- "
17  << wgs84.InverseAuthalicLatitude(30) << "\n";
18  cout << "The northernmost edge of a square Mercator map is at latitude "
19  << wgs84.InverseIsometricLatitude(180) << "\n";
20  }
21  catch (const exception& e) {
22  cerr << "Caught exception: " << e.what() << "\n";
23  return 1;
24  }
25 }
Math::real InverseRectifyingLatitude(real mu) const
Math::real InverseAuthalicLatitude(real xi) const
Definition: Half.h:150
Namespace for GeographicLib.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Header for GeographicLib::Ellipsoid class.
Math::real InverseIsometricLatitude(real psi) const
Properties of an ellipsoid.
Definition: Ellipsoid.hpp:39


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:02