DEGRES CONVERSION

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
LEGRAND
Coder
Posts: 49
Joined: Wed Jul 30, 2008 7:57 am

DEGRES CONVERSION

Post by LEGRAND » Sat Jan 16, 2010 1:40 pm

I have difficulties to transform DEGRES as used in programs (DD.MMSS)
DD=DEGRES, MM=MINUTES etc; 24DEG 45MN 30S = 24.4530 as input
in DECIMAL notation (24. 75833)
I know it's elementary but for some reason I cannot find the actual number. I suppose that the code (3 lines) exists somewhere.I didn't find it.Could Somebody be kind enough to help me?
Thanks in advance.

lrcvs
Veteran
Posts: 58
Joined: Mon Mar 10, 2008 9:28 am

Post by lrcvs » Sun Jan 17, 2010 2:01 pm

It is easy to translate 24 Deg, 45 Min, 30 seconds to Value Decimal
1 Dgr = 60 Min
1 Min = 60 Sec

Then:

24 * 60 * 60 = DSec
45 * 60 = MSec
30 sec = SSec

Total value decimal in Sec = DSec + MSec + SSec

1 Dgr Decimal = 3600 Sec

Dgr = ( Total Value in Sec) / 3600

Greetings

LEGRAND
Coder
Posts: 49
Joined: Wed Jul 30, 2008 7:57 am

DEGRES TO DECIMAL

Post by LEGRAND » Tue Jan 19, 2010 9:01 am

Thanks.

Post Reply