| View previous topic :: View next topic |
| Author |
Message |
Newbie123 Newbie
Joined: 04 Apr 2002 Posts: 4
|
Posted: Fri Apr 12, 2002 10:25 am Post subject: Calculations in degrees? |
|
|
I need to be able to add, subtract, multiply, etc. numbers as degrees.
I do not see a simple way, and am unsure of a workable formula.
The script I am working on calculates sunrise and sunset for any given
day, based upon known tabular data.
Thanks for any help. |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Apr 12, 2002 6:06 pm Post subject: |
|
|
Can you be a little more specific how you plan
to do this? Sounds kinda interesting...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Newbie123 Newbie
Joined: 04 Apr 2002 Posts: 4
|
Posted: Fri Apr 12, 2002 11:22 pm Post subject: |
|
|
The formulas and instructions can be viewed at:
http://www.moonstick.com/sunriseset.htm
[Base Site:
http://www.moonstick.com/ ]
I can retrieve all the information from the charts correctly, but
mathmatics in VDS on degrees seems daunting.
[I am sure there is a fornula to do it, but, it eludes me.]
I can email the code I have for getting the chart info, but without
the degree formula, it's not worth much. |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Apr 12, 2002 11:47 pm Post subject: |
|
|
Whew! There are a lot of calculations to be done.
I think I'd start by putting the the info in a useable form
in text files that can be loaded into lists.
So to start, degrees for each date should be on separate
lines that could be parsed. Something like this maybe
(you might want to use "01 01", "01 02" etc. instead of
Jan 01, Jan 02, etc.):
Jan 01|280.834
Jan 02|281.820
Jan 03|282.806
etc. etc.
It shouldn't be too hard to continue from there, just complete
the formula one step at a time. I'd be glad to help you with
any difficulties (I'm sure others would too). VDS has @fsin(),
@fcos(), and @fatn() (find arctangent), but we may have to
create some routines of our own...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Newbie123 Newbie
Joined: 04 Apr 2002 Posts: 4
|
Posted: Sat Apr 13, 2002 1:24 am Post subject: |
|
|
My current VDS script internally builds the tables into look-up lists
and correctly returns the correct table values based on dates, the problem
is in simple arithmatic (i.E.: "add degrees from column to degrees in row"
[sometimes negative values]) Unable to figure it out.
Example:
Row= -000.370 (deg)
Col= -000.119 (deg)
Simple addition= -0.489
PMA Calc result:
deg(-0.370)+deg(-0.119)=-28.0176 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Apr 13, 2002 3:40 am Post subject: |
|
|
Not sure I understand what you're doing on the PMA.
I added the figures you posted on both a regular
calculator and a scientific one (set to degrees),
and I get the same answer on both (-.489).
I also added the top row of the author's example
calculation (on both calculators) and got the same
total he did.
Am I missing something here? _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Protected Valued Contributor


Joined: 02 Jan 2001 Posts: 228 Location: Portugal
|
Posted: Sat Apr 13, 2002 11:59 pm Post subject: |
|
|
| can't you simply use the number of the amount of degrees in the calculations? If you are talking about the "degree mode" mentioned in that document, I think that its author means the DEG mode of the calculator, for example, those calculations wouldn't work with radians. But you can do the calculations as normal calculations or not? 1 + 1 is = to 2 just like 1 + 1 is = to 2 |
|
| Back to top |
|
 |
Newbie123 Newbie
Joined: 04 Apr 2002 Posts: 4
|
Posted: Mon Apr 22, 2002 10:41 am Post subject: |
|
|
It looks like it would be standard, but I may need to write a routine to handle variables moving into the negative range as a calc result. Shouldn't be TOO dificult !  |
|
| Back to top |
|
 |
|