For each flight segment, you will be given the desired course, the true air speed (the speed relative to the air) of the aircraft, the wind speed, and the direction the wind is blowing from. The pilot needs the heading to which she should steer the aircraft and the effective ground speed (the speed at which the aircraft is moving over the desired course relative to the ground). All speeds will be given in knots, and all directions will be given in degrees (0° <= X < 360°, with 0°= NORTH, 90° = EAST, 180 = SOUTH, 270° = WEST).
Input to your program will consist of a series of ight segments, one per line terminated by an end-of-file. Each line will consist of the wind speed, the wind direction, the desired course, and the true air speed, all given as free-format oating point numbers separated from each other by a single space.
Your program should produce for every line segment in the input file, including the last one, six lines followed by a blank line. Each of the six lines is labeled as in the example below. The first four lines reproduce the input numbers. The remaining two lines show the heading and e ective ground speed calculated for each segment. Use a format analogous to the sample below. Each number must be accurate to 1/100th.
15.0 290.0 260.0 100.0 15.0 270.0 135.0 200.0 28.0 290.0 5.0 195.0
WIND SPEED 15.00 WIND DIRECTION 290.00 DESIRED COURSE 260.00 TRUE AIRSPEED 100.00 AIRCRAFT HEADING 264.30 GROUND SPEED 86.73 WIND SPEED 15.00 WIND DIRECTION 270.00 DESIRED COURSE 135.00 TRUE AIRSPEED 200.00 AIRCRAFT HEADING 138.04 GROUND SPEED 210.33 WIND SPEED 28.00 WIND DIRECTION 290.00 DESIRED COURSE 5.00 TRUE AIRSPEED 195.00 AIRCRAFT HEADING 357.03 GROUND SPEED 185.87