00001 #include <simgear/compiler.h>
00002 #include <simgear/constants.h>
00003
00004 #include <iostream>
00005
00006 #include "waypoint.hxx"
00007
00008 using std::cout;
00009 using std::endl;
00010
00011 int main() {
00012 SGWayPoint a1(-93.216923, 44.880547, 0.0, SGWayPoint::WGS84, "KMSP");
00013
00014
00015
00016 double cur_lon = -89.336939;
00017 double cur_lat = 43.139541;
00018 double cur_alt = 0.0;
00019
00020 double course, distance;
00021
00022 a1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
00023 cout << "Course to " << a1.get_id() << " is " << course << endl;
00024 cout << "Distance to " << a1.get_id() << " is " << distance * SG_METER_TO_NM
00025 << endl;
00026
00027 SGWayPoint b1(-88.237037, 43.041038, 0.0, SGWayPoint::WGS84, "KUES");
00028
00029
00030 b1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
00031 cout << "Course to " << b1.get_id() << " is " << course << endl;
00032 cout << "Distance to " << b1.get_id() << " is " << distance * SG_METER_TO_NM
00033 << endl;
00034
00035 cout << endl;
00036
00037 return 0;
00038 }