MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / centroid

Function centroid

src/util/coordinate_calculation.cpp:114–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114Coordinate centroid(const Coordinate lhs, const Coordinate rhs)
115{
116 Coordinate centroid;
117 // The coordinates of the midpoints are given by:
118 // x = (x1 + x2) /2 and y = (y1 + y2) /2.
119 centroid.lon = (lhs.lon + rhs.lon) / FixedLongitude{2};
120 centroid.lat = (lhs.lat + rhs.lat) / FixedLatitude{2};
121 return centroid;
122}
123
124double bearing(const Coordinate coordinate_1, const Coordinate coordinate_2)
125{

Callers 1

StaticRTreeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected