Move Centroid to coordinate_calculation
This commit is contained in:
@@ -200,6 +200,16 @@ double perpendicularDistanceFromProjectedCoordinate(
|
||||
return approximate_distance;
|
||||
}
|
||||
|
||||
Coordinate centroid(const Coordinate lhs, const Coordinate rhs)
|
||||
{
|
||||
Coordinate centroid;
|
||||
// The coordinates of the midpoints are given by:
|
||||
// x = (x1 + x2) /2 and y = (y1 + y2) /2.
|
||||
centroid.lon = (lhs.lon + rhs.lon) / FixedLongitude(2);
|
||||
centroid.lat = (lhs.lat + rhs.lat) / FixedLatitude(2);
|
||||
return centroid;
|
||||
}
|
||||
|
||||
double degToRad(const double degree)
|
||||
{
|
||||
using namespace boost::math::constants;
|
||||
|
||||
Reference in New Issue
Block a user