Hi,
I just tryed it, and it seems to work. I wrote this into the TinyGPS.h:
void get_distance(float lat1, float lat2, float lon1, float lon2, float *course_, float *distance){
float lat_dif;
float lon_dif;
*distance = sin(lat1/180.0*PI)*sin(lat2/180.0*PI) + cos(lat1/180.0*PI)*cos(lat2/180.0*PI)*cos((lon2/180.0*PI)-(lon1/180.0*PI));
*distance = acos(*distance);
*distance *= 6378.137*1000;
lat_dif = lat1 - lat2;
if(lat_dif<0){
lat_dif *= (-1.0);
}
lon_dif = lon1 - lon2;
if(lon_dif<0){
lon_dif *= (-1.0);
}
lat_dif *= 60.0 * 1852.0;
lon_dif *= 60.0;
lon_dif *= cos(lat2*PI/180);
lon_dif *= 1852.0;
*course_ = atan(lon_dif/lat_dif)*180/PI;
if((lat2<lat1)&&(lon2>lon1)){
*course_ = 180.0 - *course_;
}else if((lat2<lat1)&&(lon2<lon1)){
*course_ = *course_ + 180.0;
}else if((lat2>lat1)&&(lon2<lon1)){
*course_ = 360.0 - *course_;
}
}
Philipp