We don't bite newbies here... much PerlMonks

### Re: Put yourself on the Map

by hacker (Priest)
 on Aug 20, 2002 at 12:48 UTC ( #191449=note: print w/replies, xml ) Need Help??

in reply to Re: Put yourself on the Map -- correction
in thread Put yourself on the Map -- correction

To convert a decimal number (dn) to degrees (d), minutes (m) and seconds (s):
```d  = int(dn)
mi = frac(dn)*60
m  = int(mi)
s  = frac(mi)*60

Note that int(n) denotes taking the integer part of a number (i.e. int(49.5125) = 49) and frac its fractional part (i.e. frac(49.5125) = 0.5125). mi is an intermediate result.

Example: To convert 49.5125 decimal degrees to degrees, minutes and seconds:

```d  = int(49.5125) = 49
mi = frac(49.5125)*60 = 0.5125*60 = 30.75
m  = int(mi) = int(30.75) = 30
s  = frac(mi)*60 = 0.75*60 = 45

Many calculators have a built-in function to compute this - it is often called "dms" or "hms". Switch to scientific mode on your calculator. To convert from decimal to degrees, minutes and seconds, enter the number, then hit the dms button.

To convert from degrees, minutes and seconds to decimal degrees, enter the degrees, a decimal point, then the minutes (2 digits) and seconds, then hit the [x]Inv (Inverse) button to get the inverse function and hit the dms button again.

Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://191449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2022-05-16 19:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Do you prefer to work remotely?

Results (63 votes). Check out past polls.

Notices?