8

With Astronomical Algorithms by J. Meeus (1998) I have obtained the relevant illuminated fraction of the disk and position angle.

But they're numbers (all Greek to me!) I know, Meeus explains that they're ratios of the lengths of the illuminated limb and areas.

Okay, so I have a ratio. How do I implement that together with the position angle to work out the direction of the illuminated limb and the amount illuminated?

I'm assuming that the ratio 1.0 is totally illuminated (i.e. Full Moon) and 0.0 is nothing (i.e. New Moon).

and then there is the position angle, I'm assuming that the direction in degrees is starting at 0 pointing upwards. Is that the crescent shape direction i.e. the horns are pointing away from the directional angle?

I would like to be able plot this so that I can show visually the moon's illuminated fraction and direction for any day in any given year.

As I said, I have the numbers, I'm trying to translate that into a more visually appealling and meaningful result.

Meeus says this is the selenocentric elongation of the Earth from the Sun (Phase Angle) - i.

the formula for illuminated fraction k is:

k = ( 1 + cos i ) / 2

tan i = (R sin l) / (D - (R cos l))

R = distance Earth-Sun D = distance Earth-Moon l = geocentric elongation

Meeus calls k the ratio of the lengths BC:AC the same as the ratio of the areas: NBSC:NASC

Where

Illuminated Fraction of Moon

Danny F
  • 192
  • 7
  • If celestial north is up, this diagram shows an illuminated fraction of 0.35 and a position angle of 290$^\circ$. – Mike G May 08 '18 at 13:58
  • @MikeG Thanks, but how do you know that? and which angle is the position angle in the diagram? – Danny F Aug 25 '21 at 15:00
  • I measured the image: C is 290° counterclockwise from the top, and CB = 0.35 CA. – Mike G Aug 25 '21 at 19:02
  • What makes you think this is to scale or represents the actual measurement? Please note that Meeus in fact doesn't use any values in his descriptions and algorithms, he only uses them in his working examples. In any event, what use is a diagram without a reference point, date, location, time etc.? I think you're missing the point of the question. – Danny F Aug 28 '21 at 22:57
  • Obviously the diagram above is only an example. If you need clarification beyond the accepted answer, I suggest posting a new question focusing on that issue so we're less likely to latch onto the wrong thing. – Mike G Aug 29 '21 at 21:25
  • Many of Meeus' techniques are from an era when computation was slow. If you want to draw a diagram of the moon, you're better off using modern techniques from computer graphics. You can use methods from his book to compute the position of the observer, Sun and Moon. Then use ray tracing and texturization to draw the moon. Meeus' technique might be slightly faster, but at the expense of implementing and learning algorithms that serve only one purpose. – Greg Miller Feb 06 '22 at 04:12
  • @GregMiller do you have a better, more comprehensive, modern and updated book that has algorithms for both programmer and astronomer? reviewing the latest books on the subject, Meeus' work stands out and has not been surpassed in any shape or form. The exceptions being Planetary Programs and Tables from -4000 to +2800: Tables for the Motion of the Sun and the Five Bright Planets by P. Bretagnon and Lunar Tables and Programs from 4000 B.C. to A.D. 8000 by M. Chapront-Touze, J. Chapront. However these alternatives are very complex (they do offer less precision) and are limited in scope – Danny F Feb 06 '22 at 08:12
  • There isn't anything that covers it from an astronomical perspective, you'd need to buy a general graphics programming book and apply it to astronomy. The algorithm you're asking about is featured on the cover of the 2nd edition of his "Astronomical Fomulae for Calculators" published in 1982, and the concepts are unchanged in the latest edition of Astronomical Algorithms. Back then, the idea of producing a photorealistic rendering of the moon was unheard of. At some point you'll have to loop over every pixel of the moon to determine if it's in shadow or not...[continued]. – Greg Miller Feb 06 '22 at 14:56
  • ...That's not in Meuus' book. If you look at ray tracing, or other rendering algorithms, you'll find it more directly solves the problem you want to solve. I won't make any recommendations, as what I have is pretty old too. But you can find numerous tutorials on-line for "texturing a sphere". But, if you find Meuus' algorithms easier to follow, but all means stick with those, it's solving the same problem. – Greg Miller Feb 06 '22 at 15:02

3 Answers3

6

Your understanding of the illumination is correct. k is the ratio of the illuminated length BC to the diameter AC. New Moon has an illumination of 0, Full Moon an illumination of 1, and the quarter phase an illumination of 0.5.

The position angle is measured counterclockwise from north (celestial north, along a line of right ascension) to the bright limb C. You need to calculate the parallactic angle, q, which is the angle from "up" to celestial north. From chapter 14 (in the 2009 version) $$ \tan q = \frac{\sin H}{\tan \phi \; \cos \delta - \sin \delta \; \cos H} $$ where $\phi$ is the geographical latitude, $\delta$ is the declination of the Moon, and H is the hour angle. The diagram below shows a positive value for both q and PA.

Parallactic and Position Angles

Mike G
  • 18,640
  • 1
  • 26
  • 65
JohnHoltz
  • 7,982
  • 2
  • 21
  • 30
  • You answered a question factually correctly. Thank you. However, I still want to implement this programmatically. I'm going to have to ask in Stackoverflow to figure out how to do this. – Danny F May 10 '18 at 09:00
  • BTW, what's the proper name for the angle PA-q, i.e. mathematical difference between the position angle and parallactic angle, which describes the tilt of the bright limb of the Moon "as seen"? – whtyger Jul 14 '21 at 16:05
0

Calculating H (local hour angle) requires knowing the local sidereal time θ and the RA of the moon. H = θ - RA. Calculating the LST is not too difficult, but getting the RA of the moon is more involved, described in Ch 47 of Meeus' Astronomical Algorithms. It could be obtained more quickly by just scraping the value from somewhere using cURL. Once you have these values, then calculating q is straightforward.

JohnHoltz
  • 7,982
  • 2
  • 21
  • 30
-1

I just finish my blog detailing 3 ways to get Moon phase as seen from your location. The actual working codings are included. 3 ways to get Moon phase as seen at your location

bthoven
  • 25
  • 3
  • This answer can be expanded. If not it is considered to be a link-only answer. better to be in the comments section – Kavin Ishwaran Feb 15 '22 at 16:15
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – Kavin Ishwaran Feb 15 '22 at 16:15
  • While this is an interesting answer, my question was not about the moon phase, but rather the angle and position of the sun reflected on the moon. The calculation of the moon phase isn't difficult, and easily solvable in Meeus's Astronomical Algorithms. The answers given are just further links to other implementations. – Danny F May 07 '22 at 18:17