Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Replace spaces with tabs. Fix comment style.
  • Loading branch information
mkbrewer committed May 16, 2024
commit dccac689608d2b3678702c7be1654d8ec638eccf
35 changes: 18 additions & 17 deletions libastro/circum.c
Original file line number Diff line number Diff line change
@@ -570,7 +570,7 @@ moon_cir (Now *np, Obj *op)
double el; /* elongation, rads east */
double ms; /* sun's mean anomaly */
double md; /* moon's mean anomaly */
double pang; /* moon's geocentric phase angle */
double pang; /* moon's geocentric phase angle */
double i, p;

moon (mjed, &lam, &bet, &edistau, &ms, &md); /* mean ecliptic & EOD*/
@@ -591,25 +591,26 @@ moon_cir (Now *np, Obj *op)
i = 0.1468*sin(el)*(1 - 0.0549*sin(md))/(1 - 0.0167*sin(ms));
op->s_phase = (float)((1+cos(PI-el-degrad(i)))/2*100);

/* moon's geocentric magnitude based on methodology described in Lane,
Adair P.; Irvine, William M. 1973. Monochromatic phase curves and
albedos for the lunar disk. Astronomical Journal, Vol. 78, pp. 267-277.
Using V band data from their Table V. */
pang = raddeg(acos(op->s_phase / 50.0 - 1.0)); /* need range 0-180 degrees */
if (pang <= 40.0) {
p = pang - 20.0;
i = -12.72 + 0.0267 * p + 0.534;
} else {
p = pang - 80.0;
i = -12.72 + p * (0.03188 + p * (1.9621e-4 + p * 1.7256e-6)) + 2.14;
}
/* moon's geocentric magnitude based on methodology described in Lane,
* Adair P.; Irvine, William M. 1973. Monochromatic phase curves and
* albedos for the lunar disk. Astronomical Journal, Vol. 78, pp. 267-277.
* Using V band data from their Table V.
*/
pang = raddeg(acos(op->s_phase / 50.0 - 1.0)); /* need range 0-180 degrees */
if (pang <= 40.0) {
p = pang - 20.0;
i = -12.72 + 0.0267 * p + 0.534;
} else {
p = pang - 80.0;
i = -12.72 + p * (0.03188 + p * (1.9621e-4 + p * 1.7256e-6)) + 2.14;
}

#define mean_em_dist (60.2665 * ERAD / MAU) /* mean earth-moon distance in AU
(factor from above reference). */
/* correct for earth-moon distance. */
i += 5.0 * log10(edistau / mean_em_dist);
/* correct for moon-sun distance */
i += 5.0 * log10(op->s_sdist);
/* correct for earth-moon distance. */
i += 5.0 * log10(edistau / mean_em_dist);
/* correct for moon-sun distance */
i += 5.0 * log10(op->s_sdist);

set_smag (op, i);