mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
18 lines
649 B
C++
18 lines
649 B
C++
#pragma once
|
|
|
|
#include "geometry/latlon.hpp"
|
|
|
|
// namespace ms - "math on sphere", similar to namespace m2.
|
|
namespace ms
|
|
{
|
|
double constexpr kEarthRadiusMeters = 6378000.0;
|
|
// Distance on unit sphere between (lat1, lon1) and (lat2, lon2).
|
|
// lat1, lat2, lon1, lon2 - in degrees.
|
|
double DistanceOnSphere(double lat1Deg, double lon1Deg, double lat2Deg, double lon2Deg);
|
|
|
|
// Distance in meteres on Earth between (lat1, lon1) and (lat2, lon2).
|
|
// lat1, lat2, lon1, lon2 - in degrees.
|
|
double DistanceOnEarth(double lat1Deg, double lon1Deg, double lat2Deg, double lon2Deg);
|
|
double DistanceOnEarth(LatLon const & ll1, LatLon const & ll2);
|
|
} // namespace ms
|