Skip to content

Commit a4baa0a

Browse files
committed
docs update
1 parent e1a4a56 commit a4baa0a

File tree

2 files changed

+95
-15
lines changed

2 files changed

+95
-15
lines changed

docs/index.rst

Lines changed: 74 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,86 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to cppmap3d's documentation!
6+
cppmap3d Documentation
77
====================================
88

99
.. toctree::
1010
:maxdepth: 2
11-
:caption: Contents:
1211

13-
Indices and tables
14-
==================
12+
https://github.com/ClancyWalters/cppmap3d
1513

16-
* :ref:`genindex`
17-
* :ref:`modindex`
18-
* :ref:`search`
14+
Implementation details and examples
15+
=========================================
16+
This library was written as a baseline for 3D coordinate conversions. It's primarily
17+
a direct adaptation of pymap3d and so will share performance characteristics of that
18+
libraries' choice of algorithms. It's intended to have high compatability, even with old
19+
compilers, and avoids sacrificing performance where possible.
20+
21+
The library is intended to be minimally invasive pulling in only <cmath> from the STL and
22+
using no data structures. Compatability and avoiding the STL result in the heavy use of
23+
out paramters, if this is undesirable, I recommend writing a wrapper using structs or std::tuple<>.
24+
25+
.. code-block:: cpp
26+
27+
#import "cppmap3d.hh"
28+
29+
double x, y, z;
30+
double lat, lon, alt;
31+
double az, el, range;
32+
cppmap3d::ecef2aer(x, y, z, lat, lon, alt, az, el, range);
33+
34+
35+
One concession to performance is a #define exists for using a significantly faster
36+
ecef2geodetic. This breaks parity with pymap3d.
37+
38+
.. code-block:: cpp
39+
40+
#define CPPMAP3D_ECEF2GEODETIC_OLSON
41+
#import "cppmap3d.hh"
42+
43+
double x, y, z;
44+
double lat, lon, alt;
45+
cppmap3d::ecef2geodetic(x, y, z, lat, lon, alt); //roughly 2x speed of You (2000)
46+
47+
48+
49+
Development / Running DocTest & Nanobench
50+
=========================================
51+
Clone the project recursively
52+
53+
.. code-block:: console
54+
55+
git clone --recursive https://github.com/ClancyWalters/cppmap3d.git
56+
57+
58+
Setup vcpkg
59+
60+
.. code-block:: console
61+
62+
.\vcpkg\bootstrap-vcpkg.bat
63+
.\vcpkg\vcpkg.exe install
64+
.\vcpkg\vcpkg.exe integrate install
65+
66+
67+
Build the project, tests, and Docs. Obviously choose an appropriate present.
68+
69+
.. code-block:: console
70+
71+
cmake --build --preset=windows-x64-debug
72+
73+
Run the tests
74+
75+
.. code-block:: console
76+
77+
.\out\build\windows-x64-debug\cppmap3d_tests.exe
78+
79+
Run the benchmarking (should be done in release)
80+
81+
.. code-block:: console
82+
83+
.\out\build\windows-x64-release\cppmap3d_benchmarks.exe
84+
85+
documentation is compiled locally at out/build/windows-x64-release/docs/sphinx/index.html
1986

2087
Docs
2188
====

src/cppmap3d.hh

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,23 @@ inline void ecef2ned(
757757
out_down = out_down * -1;
758758
}
759759

760+
/**
761+
* @brief Converts East, North, Up (ENU) coordinates to Earth-Centered,
762+
* Earth-Fixed (ECEF) coordinates.
763+
*
764+
* @param east The East coordinate, in meters.
765+
* @param north The North coordinate, in meters.
766+
* @param up The Up coordinate, in meters.
767+
* @param lat The latitude, in radians.
768+
* @param lon The longitude, in radians.
769+
* @param alt The altitude, in meters.
770+
* @param[out] out_x The ECEF x-coordinate, in meters (output parameter).
771+
* @param[out] out_y The ECEF y-coordinate, in meters (output parameter).
772+
* @param[out] out_z The ECEF z-coordinate, in meters (output parameter).
773+
* @param ellipsoid The ellipsoid model used for the conversion (default is
774+
* WGS84).
775+
*
776+
*/
760777
inline void enu2ecef(
761778
double east,
762779
double north,
@@ -778,21 +795,17 @@ inline void enu2ecef(
778795
}
779796

780797
/**
781-
* @brief Converts East, North, Up (ENU) coordinates to Earth-Centered,
782-
* Earth-Fixed (ECEF) coordinates.
798+
* @brief Converts East, North, Up (ENU) coordinates to geodetic coordinates.
783799
*
784800
* @param east The East coordinate, in meters.
785801
* @param north The North coordinate, in meters.
786802
* @param up The Up coordinate, in meters.
787803
* @param lat The latitude, in radians.
788804
* @param lon The longitude, in radians.
789805
* @param alt The altitude, in meters.
790-
* @param[out] out_x The ECEF x-coordinate, in meters (output
791-
* parameter).
792-
* @param[out] out_y The ECEF y-coordinate, in meters (output
793-
* parameter).
794-
* @param[out] out_z The ECEF z-coordinate, in meters (output
795-
* parameter).
806+
* @param[out] out_lat The latitude, in radians (output parameter).
807+
* @param[out] out_lon The longitude, in radians (output parameter).
808+
* @param[out] out_alt The altitude, in meters (output parameter).
796809
* @param ellipsoid The ellipsoid model used for the conversion (default is
797810
* WGS84).
798811
*

0 commit comments

Comments
 (0)