How to find distance between two geopoints in c using calculateDistance(const CWaypoint& wp)
Posted
by
Harsha
on Stack Overflow
See other posts from Stack Overflow
or by Harsha
Published on 2012-11-13T04:56:15Z
Indexed on
2012/11/13
4:59 UTC
Read the original article
Hit count: 109
pass-by-reference
void getAllDataByPointer(string *pname,double *platitude, double *plongitude);
void getAllDataByReference(string &pname,double &platitude, double &plongitude);
double calculateDistance(const CWaypoint& wp);
void print(int format);
bool less(const CWaypoint& wp_right);
CWaypoint add(const CWaypoint& wp_right);
These are the functions I am using. I have the values as output but how to call the latitude values of two different cities so that I can use the following formula
distance = ERADIUS * (acos(sin(latitude_1)*sin(latitude_2) + cos(latitude_1) * cos(latitude_2)*cos(longitude_2 - longitude_1)));
© Stack Overflow or respective owner