Link to home
Start Free TrialLog in
Avatar of IElite
IElite

asked on

formula for converting DD to DMS (waypoints)?

using the WGS-84 (NAD-83) datum

what is the formula for converting the following:


Degree Decimal  Example: lat = 37.379   lon = -122.061

TO

Degree Minute Second Example: lat= 37°22'44.4" N   lon = 122° 2'39.6" W



Please explain how to determine the N/W portions of the waypoint

IELite
SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
decimal to minutes : (replace ceiling function with int if negative value)
deg = int(lat)
min = int((lat-deg)*60)
sec = ((lat-deg)*3600) % 60

minute to decimal :

lat = deg + min/60 + sec/3600

* same for lon
** -/+ sign : if MINUS is used , ceiling function must replace the integer function
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial