WGS84toCartesian is a small and efficient library written in modern C++ library to convert WGS84 latitude/longitude positions to/from Cartesian positions using Mercator projection.
WGS84toCartesian is available as single-file, header-only library - just drop WGS84toCartesian.hpp into your project, #include "WGS84toCartesian.hpp"
, and compile your project with a modern C++ compiler (C++11 or newer).
This library is partially based on the work from Gerald I. Evenden on proj 4.3 released under public domain terms. See thirdparty/proj-4.3 for further details.
#include "WGS84toCartesian.hpp"
, and compile your project with a modern C++ compiler (C++11 or newer)std::array
so that this library integrates well with other math libraries (e.g., Eigen).std::array<double, 2> cartesianPosition = wgs84::toCartesian({52.247041, 10.575830} /* reference position */, {52.248091, 10.57417} /* position to be converted */));
std::array<double, 2> approximatedWGS84Position = wgs84::fromCartesian({52.247041, 10.575830} /* reference position */, {-154.48, 441.75} /* position to be converted */);
No dependencies! All you need is a C++11-compliant compiler (we are testing with GCC 6.3.0 and MSVC 19.0.24215.1) as the project ships the following dependencies as part of the source distribution:
WGS84toCartesian is provided as header-only, single-file library as well - just drop WGS84toCartesian.hpp into your project, #include "WGS84toCartesian.hpp"
, and compile your project with a modern C++ compiler (C++11 or newer)
If your project is using WGS84toCartesian, just let us know :-)
We are happy to receive your PRs to accelerate libcluon's development; before contributing, please take a look at the Contribution Documents.