1 #include <simgear/compiler.h>
2 #include <simgear/constants.h>
6 #include "waypoint.hxx"
8 #if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
15 SGWayPoint a1(-93.216923, 44.880547, 0.0, SGWayPoint::WGS84, "KMSP");
16 SGWayPoint a2(-93.216923, 44.880547, 0.0, SGWayPoint::SPHERICAL, "KMSP");
19 double cur_lon = -89.336939;
20 double cur_lat = 43.139541;
23 double course, distance;
25 a1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
26 cout << "Course to " << a1.get_id() << " is " << course << endl;
27 cout << "Distance to " << a1.get_id() << " is " << distance * SG_METER_TO_NM
30 a2.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
31 cout << "Course to " << a2.get_id() << " is " << course << endl;
32 cout << "Distance to " << a2.get_id() << " is " << distance * SG_METER_TO_NM
36 SGWayPoint b1(-88.237037, 43.041038, 0.0, SGWayPoint::WGS84, "KUES");
37 SGWayPoint b2(-88.237037, 43.041038, 0.0, SGWayPoint::SPHERICAL, "KUES");
39 b1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
40 cout << "Course to " << b1.get_id() << " is " << course << endl;
41 cout << "Distance to " << b1.get_id() << " is " << distance * SG_METER_TO_NM
44 b2.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
45 cout << "Course to " << b2.get_id() << " is " << course << endl;
46 cout << "Distance to " << b2.get_id() << " is " << distance * SG_METER_TO_NM
53 SGWayPoint c1(-20, 10, 0, SGWayPoint::CARTESIAN, "Due East");
54 c1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
55 cout << "Course to " << c1.get_id() << " is " << course << endl;
56 cout << "Distance to " << c1.get_id() << " is " << distance << endl;
58 SGWayPoint c2(20, 20, 0, SGWayPoint::CARTESIAN, "Due SW");
59 c2.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
60 cout << "Course to " << c2.get_id() << " is " << course << endl;
61 cout << "Distance to " << c2.get_id() << " is " << distance << endl;
63 SGWayPoint c3(20, 0, 0, SGWayPoint::CARTESIAN, "Due NW");
64 c3.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
65 cout << "Course to " << c3.get_id() << " is " << course << endl;
66 cout << "Distance to " << c3.get_id() << " is " << distance << endl;