Joe_Carrick Posted May 29, 2019 Share Posted May 29, 2019 Does anyone have a formula to convert decimal degrees to degrees, minutes & seconds? I need to do this in a user macro. Link to comment Share on other sites More sharing options...
rlackore Posted May 29, 2019 Share Posted May 29, 2019 I use a calculator, but I found this explanation with Google: The whole units of degrees will remain the same (e.g., if your figure is 121.135 degrees longitude, start with 121 degrees). Multiply the decimal portion of the figure by 60 (e.g., .135 * 60 = 8.1). The whole number becomes the minutes (8). Take the remaining decimal and multiply it by 60 (e.g., .1 * 60 = 6). The resulting number becomes the seconds (6 seconds). Seconds can remain as a decimal if needed. Take your three sets of numbers and put them together, (e.g., 121°8'6" longitude would be equivalent to 121.135 degrees longitude). Link to comment Share on other sites More sharing options...
Joe_Carrick Posted May 29, 2019 Author Share Posted May 29, 2019 Thanks Robert. I found the same on the internet. Unfortunately I don't seem to be able to get it to work correctly in a user macro. I guess for now I'm just going to have to display decimal degrees. Link to comment Share on other sites More sharing options...
BrownTiger Posted May 29, 2019 Share Posted May 29, 2019 result="" fl = 121.135 d= fl.to_i m=(fl-d) * 60.0 s =( m - m.to_i) * 60.0 result = d.to_s + " " + m.to_i.to_s + " " + s.to_i.to_s result Link to comment Share on other sites More sharing options...
Joe_Carrick Posted May 30, 2019 Author Share Posted May 30, 2019 I got it to work. One of my problems was that I wanted it to be in the form of: N d m s W etc. Basically getting the wall facing direction by comparing the true north of the plan with the angle of the exterior walls. Since the wall angle is 0 to 360 I had to do some tricky coding. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now