/***************************************************************

   LON_180.C

   Function converts longitude to correct degree range (-180 to 180)
   when ship is crossing the dateline.

                        Wed  09-06-1989

***************************************************************/

#if PROTOTYPE_ALLOWED
double lon_180(double lon)
#else
double lon_180(lon)
double lon;
#endif
{
    if(lon > 180) return(lon - 360);
    else if(lon <= -180) return(lon + 360);
    else return(lon);
}

