head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.41; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.59; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.54.05; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.22.03; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# waytest.cxx

    00001 #include <simgear/compiler.h>
    00002 #include <simgear/constants.h>
    00003
    00004 #include STL_IOSTREAM
    00005
    00006 #include "waypoint.hxx"
    00007
    00008 #if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
    00009 SG_USING_STD(cout);
    00010 SG_USING_STD(endl);
    00011 #endif
    00012
    00013
    00014 int main() {
    00015     SGWayPoint a1(-93.216923, 44.880547, 0.0, SGWayPoint::WGS84, "KMSP");
    00016     SGWayPoint a2(-93.216923, 44.880547, 0.0, SGWayPoint::SPHERICAL, "KMSP");
    00017
    00018     // KMSN (Madison)
    00019     double cur_lon = -89.336939;
    00020     double cur_lat = 43.139541;
    00021     double cur_alt = 0.0;
    00022
    00023     double course, distance;
    00024
    00025     a1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
    00026     cout << "Course to " << a1.get_id() << " is " << course << endl;
    00027     cout << "Distance to " << a1.get_id() << " is " << distance * SG_METER_TO_NM
    00028          << endl;
    00029
    00030     a2.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
    00031     cout << "Course to " << a2.get_id() << " is " << course << endl;
    00032     cout << "Distance to " << a2.get_id() << " is " << distance * SG_METER_TO_NM
    00033          << endl;
    00034     cout << endl;
    00035
    00036     SGWayPoint b1(-88.237037, 43.041038, 0.0, SGWayPoint::WGS84, "KUES");
    00037     SGWayPoint b2(-88.237037, 43.041038, 0.0, SGWayPoint::SPHERICAL, "KUES");
    00038
    00039     b1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
    00040     cout << "Course to " << b1.get_id() << " is " << course << endl;
    00041     cout << "Distance to " << b1.get_id() << " is " << distance * SG_METER_TO_NM
    00042          << endl;
    00043
    00044     b2.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
    00045     cout << "Course to " << b2.get_id() << " is " << course << endl;
    00046     cout << "Distance to " << b2.get_id() << " is " << distance * SG_METER_TO_NM
    00047          << endl;
    00048     cout << endl;
    00049
    00050     cur_lon = 10;
    00051     cur_lat = 10;
    00052
    00053     SGWayPoint c1(-20, 10, 0, SGWayPoint::CARTESIAN, "Due East");
    00054     c1.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
    00055     cout << "Course to " << c1.get_id() << " is " << course << endl;
    00056     cout << "Distance to " << c1.get_id() << " is " << distance << endl;
    00057
    00058     SGWayPoint c2(20, 20, 0, SGWayPoint::CARTESIAN, "Due SW");
    00059     c2.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
    00060     cout << "Course to " << c2.get_id() << " is " << course << endl;
    00061     cout << "Distance to " << c2.get_id() << " is " << distance << endl;
    00062
    00063     SGWayPoint c3(20, 0, 0, SGWayPoint::CARTESIAN, "Due NW");
    00064     c3.CourseAndDistance( cur_lon, cur_lat, cur_alt, &course, &distance );
    00065     cout << "Course to " << c3.get_id() << " is " << course << endl;
    00066     cout << "Distance to " << c3.get_id() << " is " << distance << endl;
    00067
    00068     return 0;
    00069 }

@ 1.3 log @Oops, try again. @ text @d78 1 a78 1