X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Froute%2Fwaytest.cxx;h=0d57bff89fcef2ed47827b20b52206e20fa953b6;hb=ba1b96e518ee65d9c07b9e926c4bd8fe0713e12b;hp=ddcc4eaacb2c6ba646bf430ac5ce8a887f0773c4;hpb=91ba4618e72c78e88cf44cfadbe38236093db664;p=simgear.git diff --git a/simgear/route/waytest.cxx b/simgear/route/waytest.cxx index ddcc4eaa..0d57bff8 100644 --- a/simgear/route/waytest.cxx +++ b/simgear/route/waytest.cxx @@ -1,56 +1,64 @@ +#include #include + +#include STL_IOSTREAM + #include "waypoint.hxx" +SG_USING_STD(cout); +SG_USING_STD(endl); + int main() { - SGWayPoint a1(-93.216923, 44.880547, SGWayPoint::WGS84, "KMSP"); - SGWayPoint a2(-93.216923, 44.880547, SGWayPoint::SPHERICAL, "KMSP"); + SGWayPoint a1(-93.216923, 44.880547, 0.0, SGWayPoint::WGS84, "KMSP"); + SGWayPoint a2(-93.216923, 44.880547, 0.0, SGWayPoint::SPHERICAL, "KMSP"); // KMSN (Madison) double cur_lon = -89.336939; double cur_lat = 43.139541; + double cur_alt = 0.0; double course, distance; - a1.CourseAndDistance( cur_lon, cur_lat, &course, &distance ); + a1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance ); cout << "Course to " << a1.get_id() << " is " << course << endl; - cout << "Distance to " << a1.get_id() << " is " << distance * METER_TO_NM + cout << "Distance to " << a1.get_id() << " is " << distance * SG_METER_TO_NM << endl; - a2.CourseAndDistance( cur_lon, cur_lat, &course, &distance ); + a2.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance ); cout << "Course to " << a2.get_id() << " is " << course << endl; - cout << "Distance to " << a2.get_id() << " is " << distance * METER_TO_NM + cout << "Distance to " << a2.get_id() << " is " << distance * SG_METER_TO_NM << endl; cout << endl; - SGWayPoint b1(-88.237037, 43.041038, SGWayPoint::WGS84, "KUES"); - SGWayPoint b2(-88.237037, 43.041038, SGWayPoint::SPHERICAL, "KUES"); + SGWayPoint b1(-88.237037, 43.041038, 0.0, SGWayPoint::WGS84, "KUES"); + SGWayPoint b2(-88.237037, 43.041038, 0.0, SGWayPoint::SPHERICAL, "KUES"); - b1.CourseAndDistance( cur_lon, cur_lat, &course, &distance ); + b1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance ); cout << "Course to " << b1.get_id() << " is " << course << endl; - cout << "Distance to " << b1.get_id() << " is " << distance * METER_TO_NM + cout << "Distance to " << b1.get_id() << " is " << distance * SG_METER_TO_NM << endl; - b2.CourseAndDistance( cur_lon, cur_lat, &course, &distance ); + b2.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance ); cout << "Course to " << b2.get_id() << " is " << course << endl; - cout << "Distance to " << b2.get_id() << " is " << distance * METER_TO_NM + cout << "Distance to " << b2.get_id() << " is " << distance * SG_METER_TO_NM << endl; cout << endl; cur_lon = 10; cur_lat = 10; - SGWayPoint c1(-20, 10, SGWayPoint::CARTESIAN, "Due East"); - c1.CourseAndDistance( cur_lon, cur_lat, &course, &distance ); + SGWayPoint c1(-20, 10, 0, SGWayPoint::CARTESIAN, "Due East"); + c1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance ); cout << "Course to " << c1.get_id() << " is " << course << endl; cout << "Distance to " << c1.get_id() << " is " << distance << endl; - SGWayPoint c2(20, 20, SGWayPoint::CARTESIAN, "Due SW"); - c2.CourseAndDistance( cur_lon, cur_lat, &course, &distance ); + SGWayPoint c2(20, 20, 0, SGWayPoint::CARTESIAN, "Due SW"); + c2.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance ); cout << "Course to " << c2.get_id() << " is " << course << endl; cout << "Distance to " << c2.get_id() << " is " << distance << endl; - SGWayPoint c3(20, 0, SGWayPoint::CARTESIAN, "Due NW"); - c3.CourseAndDistance( cur_lon, cur_lat, &course, &distance ); + SGWayPoint c3(20, 0, 0, SGWayPoint::CARTESIAN, "Due NW"); + c3.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance ); cout << "Course to " << c3.get_id() << " is " << course << endl; cout << "Distance to " << c3.get_id() << " is " << distance << endl;