forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Calculations in degrees?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Newbie123
Newbie


Joined: 04 Apr 2002
Posts: 4

PostPosted: Fri Apr 12, 2002 10:25 am    Post subject: Calculations in degrees? Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Apr 12, 2002 6:06 pm    Post subject: Reply with quote

Can you be a little more specific how you plan
to do this? Sounds kinda interesting...

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Newbie123
Newbie


Joined: 04 Apr 2002
Posts: 4

PostPosted: Fri Apr 12, 2002 11:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Apr 12, 2002 11:47 pm    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
Newbie123
Newbie


Joined: 04 Apr 2002
Posts: 4

PostPosted: Sat Apr 13, 2002 1:24 am    Post subject: Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Apr 13, 2002 3:40 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Protected
Valued Contributor
Valued Contributor


Joined: 02 Jan 2001
Posts: 228
Location: Portugal

PostPosted: Sat Apr 13, 2002 11:59 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Newbie123
Newbie


Joined: 04 Apr 2002
Posts: 4

PostPosted: Mon Apr 22, 2002 10:41 am    Post subject: Reply with quote

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 ! Embarassed
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group