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 }
main
int main()
Definition: examples/example-DMS.cpp:11
gtsam.examples.DogLegOptimizerExample.type
type
Definition: DogLegOptimizerExample.py:111
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
GeographicLib::DMS::flag
flag
Definition: DMS.hpp:41
std
Definition: BFloat16.h:88
DMS.hpp
Header for GeographicLib::DMS class.


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:31