/*************************************************************** LON_180.C Function converts longitude to correct degree range (-180 to 180) when ship is crossing the dateline. Wed 09-06-1989 ***************************************************************/ double lon_180(double lon) { if(lon > 180) return(lon - 360); else if(lon <= -180) return(lon + 360); else return(lon); }