Skip to content

Commit

Permalink
Extend the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
vahancho committed Feb 7, 2024
1 parent 154677d commit affc91c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit affc91c

Please sign in to comment.