function computeHeading(from, to) {
  // http://williams.best.vwh.net/avform.htm#Crs
  var fromLat = toRadians(from.lat);
  var fromLng = toRadians(from.lng);
  var toLat = toRadians(to.lat);
  var toLng = toRadians(to.lng);
  var dLng = toLng - fromLng;
  var heading = Math.atan2(
    Math.sin(dLng) * Math.cos(toLat),
    Math.cos(fromLat) * Math.sin(toLat) - Math.sin(fromLat) * Math.cos(toLat) * Math.cos(dLng));
  return wrap(toDegrees(heading), -180, 180);
}
Returns the heading from one LatLng to another LatLng. Headings are
expressed in degrees clockwise from North within the range [-180,180).
@return The heading in degrees clockwise from north.