examples/example-DMS.cpp
Go to the documentation of this file.
1 // Example of using the GeographicLib::DMS class
2 
3 #include <iostream>
4 #include <string>
5 #include <exception>
6 #include <GeographicLib/DMS.hpp>
7 
8 using namespace std;
9 using namespace GeographicLib;
10 
11 int main() {
12  try {
13  {
14  string dms = "30d14'45.6\"S";
16  double ang = DMS::Decode(dms, type);
17  cout << type << " " << ang << "\n";
18  }
19  {
20  double ang = -30.245715;
21  string dms = DMS::Encode(ang, 6, DMS::LATITUDE);
22  cout << dms << "\n";
23  }
24  }
25  catch (const exception& e) {
26  cerr << "Caught exception: " << e.what() << "\n";
27  return 1;
28  }
29 }
int main()
Definition: Half.h:150
Namespace for GeographicLib.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Header for GeographicLib::DMS class.


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