//*** nav.h Jan2009, prototypes for navigation functions
//*** see setup.h for structure details
//************************************************************************

void   check_waypt    ( void );    // check & update waypt
void   get_theta      ( void );    // get new pitch,heading
void   set_route      ( void );    // set route parameters
void   change_1_route ( void );    // change 1 route pt
void   change_waypt   ( struct s_waypt *waypt ); // change single waypt
short  insert_waypt   ( struct s_waypt *waypt, short iw, float xlat, float xlon); 
short  fix_bad_route  ( void );
short  verify_route   ( void );    // verify that the route is OK
void   display_route  ( short yes_file );    // display the route
short  init_wpt_rte   ( short reset_vals );  // dec11, add boolean input

short  read_wpt       ( void     ); // read a waypoint file
short  rd_wpt         ( FILE *fp ); // called from read_wpt
short  read_rte       ( void     ); // read a route file
short  rd_rte         ( FILE *fp ); // called from read_rte

void   test_nav      ( void ); // test above fnx's
void   store_waypt   (float x, short *xdeg, short *xf );  // store floating waypoint
		// value into 2 integers, for machine-independent unpacking.
void   waypt_display ( short yes_file ); // display the waypt list

short  xy2rb         ( float dx, float dy, float *range );
	// convert dx, dy into range and bearing...returns bearing
	
short  LonLat2rb     ( float x1, float y1, float x2, float y2, float *range );
	// convert Lat, Lon from X1 to X2 to range and bearing...returns bearing
	
void   accum_dr      ( float pitch, float compass, float dp );
    // accumulate dr based on pitch, compass and dp
    
    
//*** end *********************************************************************