| 112 | } |
| 113 | |
| 114 | Coordinate 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 | |
| 124 | double bearing(const Coordinate coordinate_1, const Coordinate coordinate_2) |
| 125 | { |