Google Answers Logo
View Question
 
Q: C/C++ source code for determining moonrise and moonset times ( No Answer,   2 Comments )
Question  
Subject: C/C++ source code for determining moonrise and moonset times
Category: Computers > Algorithms
Asked by: ian_knowles-ga
List Price: $100.00
Posted: 08 Nov 2003 19:51 PST
Expires: 11 Dec 2003 20:34 PST
Question ID: 273992
Computer algorithm researchers,

I have spent a couple of days searching for C/C++ source code for a
reasonably accurate (within a few minutes) moonrise and moonset
algorithm (that will work with a provided latitude, longitude and
timezone) but was unable to find anything but some very old K&R style
unix code that I was unable to get working.

The source code should not be either GPL or subject to copyright as I
may wish to use it for commercial purposes. It should be concise (I
have sunrise/sunset and moonphase algorithms that are reasonably
accurate and only total a couple of hundred lines) and should compile
on any fairly standard C++ compiler (BCB6 and VC71 for starters).

I am not interested in user interface code or Windows API code as I
wish to use this for a cross-platform project (Win32 and Linux).

Regards,

Ian Knowles.

Request for Question Clarification by mathtalk-ga on 08 Nov 2003 21:01 PST
Hi, Ian:

Over what period of time (decades, centuries?) does the code need to
work (within the specified accuracy of "a few minutes")?

As far as using code provided here for commercial purposes, you should
take into account the Google copyright notice which appears on each
page of this site.  In the Terms of Service you'll find that Google
forbids anyone to "sell, use, reproduce, modify, edit, translate,
publish, perform, display, post, transmit and distribute questions,
comments or answers for any public or commercial purpose without the
written permission of Google."  (See the Terms of Service link along
the bottom border of this page, Paragraph 2.)

I have no personal experience (yet!) with obtaining such permission,
but it may be worth investigating before you proceed.

regards, mathtalk-ga

Clarification of Question by ian_knowles-ga on 08 Nov 2003 22:24 PST
Hi mathtalk,

Thanks for your interest.

The date_time code for which this is intended to work with has a range
of 1600-3800 (Gregorian) although the accuracy would only be of most
important for the range 1950-2050.

AFAIA algorithms (unless patented) are not subject to copyright - so
Google's terms and conditions shouldn't apply to my usage of such an
algorithm (and especially if source code is published elsewhere with a
link placed here).


Regards,

Ian Knowles.

Request for Question Clarification by mathtalk-ga on 11 Nov 2003 13:15 PST
Hi, Ian:

I think I've found the sort of source code you're looking for
(versions in both C and C++), but the author has not placed his code
in the public domain.  He has made it free for any non-commercial use
and expressed interest in discussing its commercial application via
non-cash arrangements.

Would such an arrangement be acceptable to you?

regards, mathtalk-ga

Clarification of Question by ian_knowles-ga on 11 Nov 2003 14:15 PST
Hi mathtalk,

If by "expressed interest in discussing its commercial application via
non-cash arrangements" the author is wishing to be credited (such as
in an "about" box or in other product documentation) then I would have
no problems at all.

If neither of these arrangments are what the author has in mind then
it would be necessary to clarify exactly what arrangement the author
has in mind before I could be happy that I have found a solution.


Regards,

Ian Knowles.
Answer  
There is no answer at this time.

Comments  
Subject: Re: C/C++ source code for determining moonrise and moonset times
From: dewolfe001-ga on 08 Nov 2003 21:53 PST
 
This site:
http://www.xylem.f2s.com/kepler/moonrise.html

gives information for the moonrise algorithim in QBASIC
(http://www.xylem.f2s.com/kepler/riset.bas)
Subject: Re: C/C++ source code for determining moonrise and moonset times
From: mathtalk-ga on 12 Nov 2003 07:36 PST
 
Hi, Ian:

Naturally I've asked the Editors to withdraw my Answer.  As sometimes
happens, my posting resulted in additional Clarification, which I'm
copying here so that it does not get removed along with the Answer:

ian_knowles-ga wrote:

Hi mathtalk, 
 
Thanks for the info, however, my question had the following important
qualification:
 
"It should be concise (I have sunrise/sunset and moonphase algorithms
that are reasonably accurate and only total a couple of hundred lines)
and should compile on any fairly standard C++ compiler (BCB6 and VC71
for starters)."
 
The code at project pluto is far broader than what I am after and
therefore is not "concise" at all - I really want no more than a
single source file (a source file plus a single header would also be
okay).
 
I have no interest in a whole "astronomical algorithms project" as I
am only wanting to add moonrise and moonset to a date_time class
(which I had stated in my first clarification).
 
Also this pluto code does not compile with BCB6 (there are a number of
errors I get, some of which I suspect are due to non-standard C++
code).
 
The other references (such as Meeus) I had already found myself and so
are of no value to me (I am after a practical piece of software not a
theoretical understanding of astronomical algorithms).
 
I must say that all in all I do not feel that this response has been
satisfactory as it looks like I'll now have to spend at least a full
day trying to extract out of the pluto source code the parts that I am
really after (hardly worth paying for the priveledge).
 
:( 
 
 
Regards, 
 
Ian Knowles

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy