/** Air Navigation Waypoint Intercept Demonstrator by Robert J Morton UK-YE572246C */ /* Provides the navigational essentials of an aircraft - starting position, current position, speed. Also the radius of minimum ideal (comfortable) turning radius for the type of aircraft concerned. The square of this radius is also stored to save on computation time in other classes. */ class aircraft { double X = 0, // x co-ord of starting point for waypoint encounter Y = 25, // y co-ord of starting point for waypoint encounter x = X, // current x co-ordinate of aircraft y = Y, // current y co-ordinate of aircraft s = .5, // aircraft's speed: distance travelled every 50 milliseconds r = 40; // radius of aircraft's ideal turning circle double R = r * r; // square of radius void reset() { x = X; y = Y; } // reset aircraft to its stating position void advance(double ReqHdg) { // Advance the aircraft the distance it x += s * Math.sin(ReqHdg); // would travel during the 50 millisecond y += s * Math.cos(ReqHdg); // iteration cycle of the program. } }