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
IEliteAsked:
Who is Participating?
 
GwynforWebConnect With a Mentor Commented:
IElite,
  All the equations you will use will have trigonometric function in them (eg, sin, cos etc). You  will require radians not degrees to use your formulea, just convert the degrees into radians ie

radians = 2*Pi*degrees/360

and use those values in the formulea

eg
lonDegree=37.379
lonRadians= 37.379*2*Pi*degrees/360

0
 
ozoConnect With a Mentor Commented:
Degree = floor(37.379)
Minute = floor((37.379-Degree)*60)
Second = ((37.379 - Degree) *60 - Minute) * 60
0
 
TalmashCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.