MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / XChartMoons

Function XChartMoons

xcharts1.cpp:3616–3908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3614// the -8 is combined with the -X switch.
3615
3616void XChartMoons()
3617{
3618 CP rgcp[2], *cp;
3619 ObjDraw rgod[cCust];
3620 char sz[cchSzDef], szCh[2];
3621 int objCenterSav = us.objCenter, cx0, cy0, xSub, ySub, cx, cy, xs, ys,
3622 m, i0, i, j, k, x, y, count, countOld;
3623 real rgrLenP[2][custHi+1], rgrLenM[2][cCust], rgrAngM[2][cCust],
3624 rgrLenZ[cCust], rgrAngZ[cCust], rRatio = 1.0/3.0, rRadi, rLenMax,
3625 radi1, radi2, len1, len2, ang1, ang2, ang, rx, ry, rT;
3626 byte ignoreSav[objMax];
3627 flag fMoonSav = us.fMoonMove;
3628 PT3R pt;
3629 KI kiP = -1;
3630
3631 // If no moons unrestricted, temporarily unrestrict them all.
3632 Assert(sizeof(ignore) == sizeof(ignoreSav));
3633 CopyRgb(ignore, ignoreSav, sizeof(ignore));
3634 count = 0;
3635 for (m = custLo; m <= custHi; m++) {
3636 if (ignore[m])
3637 continue;
3638 i = ObjOrbit(m);
3639 if (!FHasMoon(i))
3640 continue;
3641 count++;
3642 k = kObjB[i];
3643 if (kiP < 0)
3644 kiP = k;
3645 else if (kiP != k)
3646 kiP = gi.kiLite;
3647 }
3648 if (count == 0)
3649 for (m = moonsLo; m <= moonsHi; m++)
3650 ignore[m] = fFalse;
3651 AdjustRestrictions();
3652
3653 // Cast charts.
3654 us.fMoonMove = fFalse;
3655 for (i = 0; i <= 1; i++) {
3656 // Planetcentric charts are relative to geocentric reference.
3657 us.objCenter = (i <= 0 ? objCenterSav : oSun);
3658 CastChart(-1);
3659 rgcp[i] = cp0;
3660 for (j = 0; j < cHasMoons; j++) {
3661 m = rgobjHasMoons[j];
3662 if (m < custLo)
3663 rgrLenP[i][m] = PtLen(space[m]);
3664 }
3665 for (m = custLo; m <= custHi; m++) {
3666 if (ignore[m])
3667 continue;
3668 rgrLenM[i][m - custLo] = rgrAngM[i][m - custLo] = 0.0;
3669 rgrLenP[i][m] = PtLen(space[m]);
3670 j = ObjOrbit(m);
3671 if (j < 0)
3672 continue;
3673 rx = space[m].x - space[j].x; ry = space[m].y - space[j].y;

Callers 1

DrawChartXFunction · 0.85

Calls 15

AssertFunction · 0.85
CopyRgbFunction · 0.85
ObjOrbitFunction · 0.85
CastChartFunction · 0.85
ModFunction · 0.85
DrawColorFunction · 0.85
DrawDashFunction · 0.85
DrawSzFunction · 0.85
CchSzFunction · 0.85
MinDifferenceFunction · 0.85
RObjDiamFunction · 0.85
MinDistanceFunction · 0.85

Tested by

no test coverage detected