In the formulas that follow, the coordinate strings are symbolically represented as follows:¶¶deg                     decimal degrees¶adeg                   absolute value of decimal degrees¶ideg                     integer degrees¶sdeg                   signed integer degree¶min                      real-number minutes¶imin                      integer minutes¶sec                      real-number seconds¶lathem, lonhem    hemisphere abbreviation¶¶
In this conversion (both forward and reverse) the minute and second parameters remain unchanged.¶¶Forward calculation from DMS representation to DMSH representation:¶¶ideg = ABS(sdeg)¶If lat_sdeg < 0, lathem = S else lathem = N¶If lon_sdeg < 0, lonhem = W else lathem = E¶¶Reverse calculation from DMSH representation to DMS representation:¶sdeg = ideg * H¶where for latitude, H = 1 if lathem = N and H = -1 if lathem = S¶and for longitude  H = 1 if lonhem = E and H = -1 if lonhem = W