Suppose I have an array of coordinates, representing a route. I want to decompose this route so that it contains a point, say every 5 miles. How can I do that?
struct Location
{
double latitude;
double longitude;
};
vector<Location> route;
vector<Location> computeHigherGranularityRoute(const vector<Location>& oldRoute, double distanceDelta);
Essentially I need two functions, one that can compute the course between any two points
// Returns the course from A to B (0 -- 359.9) degrees
double getCourse(const Location& A, const Location& B);
// Returns the Location obtained from traveling from a point for a given distance along a course
Location getLocationOnCourse(const Location& start, double course, double distance);
Thanks!!