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 InverseAuthalicLatitude(real xi) const
Math::real InverseRectifyingLatitude(real mu) const
Definition: BFloat16.h:88
Namespace for GeographicLib.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Math::real InverseIsometricLatitude(real psi) const
Header for GeographicLib::Ellipsoid class.
Properties of an ellipsoid.
Definition: Ellipsoid.hpp:39


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:12