aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/cpp
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2018-03-22 11:54:28 +0100
committerGravatar Jan Tattermusch <jtattermusch@google.com>2018-03-23 07:44:30 +0100
commita26aecc03b5c110ce0912f3340933a4ed87d5ec0 (patch)
treefd54656fc841298d4f8908972f8c4ce62396c30a /examples/cpp
parentb4a5727149201bac53a33c53c2cf93fed5414540 (diff)
reimplement distance calculation in routeguide
Diffstat (limited to 'examples/cpp')
-rw-r--r--examples/cpp/route_guide/route_guide_server.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/cpp/route_guide/route_guide_server.cc b/examples/cpp/route_guide/route_guide_server.cc
index 24a4184a56..5867c16712 100644
--- a/examples/cpp/route_guide/route_guide_server.cc
+++ b/examples/cpp/route_guide/route_guide_server.cc
@@ -51,6 +51,7 @@ float ConvertToRadians(float num) {
return num * 3.1415926 /180;
}
+// The formula is based on http://mathforum.org/library/drmath/view/51879.html
float GetDistance(const Point& start, const Point& end) {
const float kCoordFactor = 10000000.0;
float lat_1 = start.latitude() / kCoordFactor;