Converting Degrees to Decimals - anthonyblackham/GIS-Wiki GitHub Wiki
Latitude and Longitude can be expressed in terms of Degrees, Minutes, and Seconds 45° 30' 47.39"
or in decimal degrees 45.513163
If you want to convert to Degrees, Minutes, Seconds:
dd = d + m/60 + s/3600
So for the example above 45° 30' 47.39"
:
45 + 30/60 + 47.39/3600 = 45.513163
If you want to convert decimal degrees to degrees minutes and seconds you just do the inverse:
d = integer(45.513163°) = 45°
m = integer((dd - d) × 60) = 30'
OR
m = 45((45.513163-.513163) × 60) = 30'
s = (dd - d - m/60) × 3600 = 47.39"
OR
s = (45.513163-.513163-30/60) × 3600 = 47.39"
= 45° 30' 47.39"