title: Given a vector of Lat/Lon pairs, how can I create a vector so that the distance between points is less than or equal to some constant?
body: <p>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?</p>
  
  <pre><code>struct Location
  {
      double latitude;
      double longitude;
  };
  
  vector&lt;Location&gt; route;
  
  vector&lt;Location&gt; computeHigherGranularityRoute(const vector&lt;Location&gt;&amp; oldRoute, double distanceDelta);
  </code></pre>
  
  <p>Essentially I need two functions, one that can compute the course between any two points</p>
  
  <pre><code>// Returns the course from A to B (0 -- 359.9) degrees
  double getCourse(const Location&amp; A, const Location&amp; B);
  
  // Returns the Location obtained from traveling from a point for a given distance along a course
  Location getLocationOnCourse(const Location&amp; start, double course, double distance);
  </code></pre>
  
  <p>Thanks!!</p>