1 #include <simgear/constants.h>
4 #include "waypoint.hxx"
9 route.add_waypoint( SGWayPoint(0, 0, 0, SGWayPoint::CARTESIAN, "Start") );
10 route.add_waypoint( SGWayPoint(1, 0, 0, SGWayPoint::CARTESIAN, "1") );
11 route.add_waypoint( SGWayPoint(2, 0, 0, SGWayPoint::CARTESIAN, "2") );
12 route.add_waypoint( SGWayPoint(2, 2, 0, SGWayPoint::CARTESIAN, "3") );
13 route.add_waypoint( SGWayPoint(4, 2, 0, SGWayPoint::CARTESIAN, "4") );
15 route.set_current( 1 );
17 cout << "( 0.5, 0 ) = " << route.distance_off_route( 0.5, 0 ) << endl;
18 cout << "( 0.5, 1 ) = " << route.distance_off_route( 0.5, 1 ) << endl;
19 cout << "( 0.5, -1 ) = " << route.distance_off_route( 0.5, 1 ) << endl;
21 route.set_current( 3 );
23 cout << "( 2, 4 ) = " << route.distance_off_route( 2, 4 ) << endl;
24 cout << "( 2.5, 4 ) = " << route.distance_off_route( 2.5, 4 ) << endl;