Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Formula for sunrise/sunset & moonrise/set and phase

Options
  • 26-08-2004 11:18am
    #1
    Registered Users Posts: 2


    hello everyone,
    I am currently designing a website where one of the features will be that the user will be presented with the sunse/rise moonrise/set and lunar phase for the day. What i want to know is, does anybody know of a formula/algorithm which would give me oany of these for a given time or location? I know that there is code out there on the net and so far I have found code written in basic and php but I don't want to just copy and paste code. i would like to write my own and base it around the correct method where I can understand it properly and know that it is right.

    I'm not sure how diifficult the formulas may be? In the case of the sunset/rise times, is it just a matter of adding on a fixed amount time each day and then taking of a certain amount of time each day once we get to a cartain stage in the year if I know the time for a certain day for my location? its probably a bit more complicated??

    And in the case of the lunar phases, we know that the moon orbits the earth every 29.53 days so is it just a matter of establishing when the last full moon was and then adding on the subsequent days to get a % phase? i'm probably missing something that makes these calculations more complicated.

    Maybe this thread should be placed on one of the other forum's like the maths or physics? If anybody thinks so please let me know.


    Any help on this would be appreciated
    Thanks


Comments

  • Closed Accounts Posts: 2,486 ✭✭✭Redshift


    I think this may be better off in programming.


  • Closed Accounts Posts: 395 ✭✭albertw


    Hi,
    hello everyone,
    I am currently designing a website where one of the features will be that the user will be presented with the sunse/rise moonrise/set and lunar phase for the day. What i want to know is, does anybody know of a formula/algorithm which would give me oany of these for a given time or location?

    See if you can get your hands on "Practical Astronomy with your calculator", by Peter Duffet-Smith. Now in 3rd edition ISBN: 0521356997 . That will give you more than you need to know! IIRC there are perl modules and java classes based on it, and possibly php ones also.
    I'm not sure how diifficult the formulas may be? In the case of the sunset/rise times, is it just a matter of adding on a fixed amount time each day and then taking of a certain amount of time each day once we get to a cartain stage in the year if I know the time for a certain day for my location? its probably a bit more complicated??

    Nope its a different amount each day. http://www.xylem.f2s.com/kepler/sunrise.html give an overview of the complications involved in the accurate calculation.
    And in the case of the lunar phases, we know that the moon orbits the earth every 29.53 days so is it just a matter of establishing when the last full moon was and then adding on the subsequent days to get a % phase? i'm probably missing something that makes these calculations more complicated.

    Accuracy makes it more complicated! What you say above may be accurate enough for your needs (and most needs!), but the book I mentioned above will go into _much_ more details about finding the precise location of the moon. The book could do a better job of explaining it calculations though...

    Cheers,
    ~Al


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian




Advertisement