Re: How to Integer to degree,minute,second conversion...
From: Jon Parmet (jon_at_parmetpc.volpe.dot.gov)
Date: 10/29/04
- Next message: OG: "Re: Sunspots hit new highs"
- Previous message: Andy G: "Re: Quest in car mount"
- In reply to: Mujtaba: "How to Integer to degree,minute,second conversion..."
- Next in thread: Dave Patton: "Re: How to Integer to degree,minute,second conversion..."
- Messages sorted by: [ date ] [ thread ]
Date: 29 Oct 2004 11:33:18 -0700
tomujtaba@hotmail.com (Mujtaba) wrote in message news:<8f4f92aa.0410282304.555bff38@posting.google.com>...
> Hi
>
> i am working on a software where i am working with latitude,
> longitude. I am reading input from XML file where data is in integer
> format like 408739, -11154
> etc for latitude and longitude etc. Now i have to process it in
> degree, minute and second format.
>
> Simple is that i want to convert integer(not decimal) to degree,
> minute, second. Could anybody plz help me out. Any formula or method.
>
> Thanks in advance...
>
> Mujtaba
There are at least a dozen or more different ways I can think of, but
here's one:
Through the clever use of the 'modulo' operator and the way division
works on integers (e.g. remainder is chucked in the bit bucket), you
can code up an algorithm which 'peels' from the right one component at
a time (e.g. secs first,then mins, then degs.).
Regards,
Jon
- Next message: OG: "Re: Sunspots hit new highs"
- Previous message: Andy G: "Re: Quest in car mount"
- In reply to: Mujtaba: "How to Integer to degree,minute,second conversion..."
- Next in thread: Dave Patton: "Re: How to Integer to degree,minute,second conversion..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|