From affc91c21436b9336d2f45e658062b88fe9a0fd4 Mon Sep 17 00:00:00 2001 From: Vahan Aghajanyan Date: Wed, 7 Feb 2024 09:12:20 +0100 Subject: [PATCH] Extend the documentation. --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 2c22a23..e9f00da 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,22 @@ int main(int argc, char **argv) } ``` +#### Conversion from/to strings + +Library supports latitude/longitude coordinates conversion +in three formats: Degrees Minutes Seconds *(D° M' S")*, +Decimal Minutes *(D° M.M')*, and Decimal Degrees *(D.D°)*. + +```cpp +auto lon = Longitude::fromString("45° 46’ 47.36” W"); +auto lat = Latitude::fromString("45°46′ 45.36″ N"); +``` + +```cpp +auto lon = Longitude{45.7790}; +auto lonStr = lon.toString(Coordinate::Format::DMS); // 45° 46′ 45.36″ E +``` + For more usage examples please refer to the unit tests at `/test/test.cpp` file. ### Building and Testing