example-Math.cpp 391 Bytes
Newer Older
Valentin Platzgummer's avatar
Valentin Platzgummer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// Example of using the GeographicLib::Math class

#include <iostream>
#include <exception>
#include <GeographicLib/Math.hpp>

using namespace std;
using namespace GeographicLib;

int main() {
  try {
    cout << Math::pi() << " " << Math::sq(Math::pi()) << "\n";
  }
  catch (const exception& e) {
    cerr << "Caught exception: " << e.what() << "\n";
    return 1;
  }
}