1 #include <simgear/constants.h>
2 #include "waypoint.hxx"
5 SGWayPoint a1(-93.216923, 44.880547, SGWayPoint::WGS84, "KMSP");
6 SGWayPoint a2(-93.216923, 44.880547, SGWayPoint::SPHERICAL, "KMSP");
9 double cur_lon = -89.336939;
10 double cur_lat = 43.139541;
12 double course, distance;
14 a1.CourseAndDistance( cur_lon, cur_lat, &course, &distance );
15 cout << "Course to " << a1.get_id() << " is " << course << endl;
16 cout << "Distance to " << a1.get_id() << " is " << distance * METER_TO_NM
19 a2.CourseAndDistance( cur_lon, cur_lat, &course, &distance );
20 cout << "Course to " << a2.get_id() << " is " << course << endl;
21 cout << "Distance to " << a2.get_id() << " is " << distance * METER_TO_NM
25 SGWayPoint b1(-88.237037, 43.041038, SGWayPoint::WGS84, "KUES");
26 SGWayPoint b2(-88.237037, 43.041038, SGWayPoint::SPHERICAL, "KUES");
28 b1.CourseAndDistance( cur_lon, cur_lat, &course, &distance );
29 cout << "Course to " << b1.get_id() << " is " << course << endl;
30 cout << "Distance to " << b1.get_id() << " is " << distance * METER_TO_NM
33 b2.CourseAndDistance( cur_lon, cur_lat, &course, &distance );
34 cout << "Course to " << b2.get_id() << " is " << course << endl;
35 cout << "Distance to " << b2.get_id() << " is " << distance * METER_TO_NM
42 SGWayPoint c1(-20, 10, SGWayPoint::CARTESIAN, "Due East");
43 c1.CourseAndDistance( cur_lon, cur_lat, &course, &distance );
44 cout << "Course to " << c1.get_id() << " is " << course << endl;
45 cout << "Distance to " << c1.get_id() << " is " << distance << endl;
47 SGWayPoint c2(20, 20, SGWayPoint::CARTESIAN, "Due SW");
48 c2.CourseAndDistance( cur_lon, cur_lat, &course, &distance );
49 cout << "Course to " << c2.get_id() << " is " << course << endl;
50 cout << "Distance to " << c2.get_id() << " is " << distance << endl;
52 SGWayPoint c3(20, 0, SGWayPoint::CARTESIAN, "Due NW");
53 c3.CourseAndDistance( cur_lon, cur_lat, &course, &distance );
54 cout << "Course to " << c3.get_id() << " is " << course << endl;
55 cout << "Distance to " << c3.get_id() << " is " << distance << endl;