# How do I calculate moon phase orientation at any Coordinates given all the necessary data?

I'm having a problem for a couple of days where I'm trying to accurately calculate the phase angle of the moon at any given Coordinates (lon,lat).If I know my current Coordinates, Moon and sun topocentric right ascension, declination, altitude and zenith Coordinates.

Given all of that data, how do I achieve that ? The result I'm looking for preferable in degrees where 0 degrees means the crescent moon pointing directly towards me, 180 degrees means the crescent moon pointing at the other direction and so on..

I have tried a formula where I measured the angle between the sun zenith and a certain coordinate in relation to the moon zenith, on paper this could work, the results were decent but not to the accuracy I'm looking for. Any help would be much appreciated.

• It will be easier to answer if you can more clearly show what it is you tried and exactly what about it you feel is inadequate or inaccurate. Is the problem that most formula are based on the Sun-Moon-Earth angle using the center of the Earth, and you want to find that angle for a specific location on Earth's surface instead? It's about a 1 degree difference at most, but is that what you need?
– uhoh
Feb 4, 2020 at 14:42
• If you are trying to calculate the phase angle, this post gives the formula for k (the phase angle) based on the elongation, i. If you use the topocentric coordinates instead of the geocentric coordinates to calculate i, then you will have your answer. See astronomy.stackexchange.com/questions/26200/… and astronomy.stackexchange.com/questions/19287/… for the angle between two objects (that is, the elongation). Feb 4, 2020 at 20:31
• uhoh: what I'm doing is very simple actually. I'm taking the direction vector from the moon to the sun normalized, and from the moon to my coordinate normalized, and then I take the Dot product between these two vectors. The result will be in ArcCos() to produce an angle. So lets assume Moon at zenith (-15,20), Sun(-15,40) and my coordinate (24,20). Using my method, I will get an angle of 90 which is correct, but the further the moon from your location, the greater the Error. Feb 5, 2020 at 3:49
• JohnHoltz: That's exactly what I'm looking for, I got the data for Hour angle, declination and My latitude. Your method should be much more accurate than what i'm currently using. I assume using the Moon geocentric declination will not make much different ? Feb 5, 2020 at 3:54
• If you could walk us through your steps, we might be able to help more. I'm not sure I follow your example in comments. If the moon is overhead at latitude -15 degrees and longitude +20 degrees, and the sun is overhead at the same latitude (-15 degrees) but at longitude +40 degrees, the angle between them is 20 degrees times the cosine of -15 degrees, which is not 90 degrees. Your location is only slightly relevant, and won't change that number to anywhere near 90 degrees. I think you're incorrectly assuming the moon and sun are on the surface of the Earth.
– user21
Feb 7, 2020 at 4:20