Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

I RA and declination of Sun & phase of Moon program

  1. Nov 15, 2016 #1
    Hello there,

    I want to write a fortran program which gives me the right ascension and declination of the sun and the phase of the moon when a date and time is given.

    I just want to know how to write it and if there are any references that can help me.

  2. jcsd
  3. Nov 15, 2016 #2

    jim mcnamara

    User Avatar

    Staff: Mentor

    Jan Meeus wrote several small books on Astronomic calculations for everyone. The first book was based on using desktop calculators, later on he provided another with algorithms.

    Astronomical Formulae for Calculators
    Astronomical Algorithms

    Basically you want the algorithm used to determine when sunrise will occur at a given latitude, longitude, and date. This can be simplified to solve for the position of the sun at a given epoch time, i.e., see https://en.wikipedia.org/wiki/Julian_day.

    Phases of the moon is the both books, too. You have to make epoch corrections to match the current ephemeris, just like above.
  4. Nov 20, 2016 #3
    Thanks Jim. I've taken a look at the second book and it seems to be really interesting. I've found what I was looking for.

    I'll try to do the programming bit and I'll you know.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?