# formula for converting DD to DMS (waypoints)?

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
###### Who is Participating?

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

and use those values in the formulea

eg
lonDegree=37.379

0

Commented:
Degree = floor(37.379)
Minute = floor((37.379-Degree)*60)
Second = ((37.379 - Degree) *60 - Minute) * 60
0

Commented:
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.