How to calculate the moon's illuminated fraction tilt? I use &quot;Astronomical algorithms&quot; book by Jean Meeus for programming algorithms for the moon data calculations. I've already created a lot of methods but stuck on the calculation of the moon's illuminated fraction tilt.
Here is the example of how the moon tilt looks like (when you switch date the moon disk turns and so does the illuminated fraction).
I've already calculated: illumination (48.1), phase angle (48.4), position angle of the illuminated bright limb (48.5), parallactic angle and etc. So I think I'm pretty close but still can't get the sufficient result.
I think that the tilt depends on the position angle of the illuminated bright limb but the tilt looks almost the same during the day and the position angle changes its value rather drastically.
I would appreciate any assistance.
UPD
I think I've found the right formula for the tilt calculation (page 347, and in the image attached):
ZenithAngle = MoonPositionAngle - ParallacticAngle.

But I'm not sure if I understand where ZenithAngle exactly is. I made a picture where I marked ZenithAngle (ZOC) and AlphaAngle which is actually the angle I need to calculate.
So if ZenithAngle is ZOC then AlphaAngle = ZenithAngle - 90.

Also I created a sample page with angles values, moon illumination and limb turned by the angle.
Your update is correct.

PA is the position angle of the bright limb (measured eastward from celestial north).
q is the parallactic angle between the zenith and celestial north.

Then the angle of the bright limb relative to a horizontal line ($\alpha$) is PA-q-90.
Keep in mind that PA is independent of the observer's location (as long as they are on the Earth), and it is well defined for any given date and time. The parallactic angle is dependent on the observer's location, date and time. I would say that it is well defined only when the Moon is above the horizon. (Of course it can be calculated when the Moon is well below the horizon, but what does that mean?)
For example, imagine two observers separated by 60 degrees of longitude. The Moon is above the horizon for each observer. The PA of the bright limb is the same for each observer at all times. But the parallactic angle is different for each observer since it depends on where the Moon is located relative to the meridian. As the Moon crosses the sky, the parallactic angle also changes significantly from hour to hour, and therefore the tilt you are calculating is different based on date, time, and location. (The PA changes with time also, but it is a slower change except around the time of New and Full Moon.)