Skip to content
Archive of entries posted on 25th April 2008

C++ functions to convert between decimal degrees and degrees, minutes, and seconds

Back when I was developing shiphandling simulator software, I ran into situations where it was necessary to convert decimal degrees to degrees, minutes, and seconds (for example, nautical types like to express latitude/longitude using degrees, minutes, and seconds while computers prefer decimal degrees). Here’s some C++ functions which handle the conversion between these two formats: [...]