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

Function FillSymbolLine

xcharts2.cpp:232–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230// planets at the same time.
231
232void FillSymbolLine(real *symbol)
233{
234 real orb = DEFORB*1.35*(real)gi.nScale, max = rDegMax, k1, k2, temp;
235 int i, j, l, tot = is.nObj*2+1;
236 flag fMoved = fTrue;
237
238 if (gi.nMode != gEphemeris)
239 max *= (real)gi.nScale;
240 else
241 orb *= rDegMax/(real)gs.xWin;
242
243 // Keep adjusting as long as can still make changes.
244
245 for (l = 0; fMoved && l < us.nDivision*2; l++) {
246 fMoved = fFalse;
247 for (i = 0; i <= tot; i++)
248 if (FProper(i >> 1) && symbol[i] >= 0.0) {
249
250 // For each object, determine who is closest to the left and right.
251
252 k1 = max-symbol[i]; k2 = -symbol[i];
253 for (j = 0; j <= tot; j++) {
254 if (FProper(j >> 1) && i != j) {
255 temp = symbol[j]-symbol[i];
256 if (temp < k1 && temp > 0.0)
257 k1 = temp;
258 else if (temp > k2 && temp <= 0.0)
259 k2 = temp;
260 }
261 }
262
263 // If an object's too close on one side, then move in other direction.
264
265 if (k2 > -orb && k1 > orb) {
266 fMoved = fTrue; symbol[i] = symbol[i]+orb*0.51+k2*0.49;
267 } else if (k1 < orb && k2 < -orb) {
268 fMoved = fTrue; symbol[i] = symbol[i]-orb*0.51+k1*0.49;
269 } else if (k2 > -orb && k1 < orb) {
270 fMoved = fTrue; symbol[i] = symbol[i]+(k1+k2)*0.5;
271 }
272 }
273 }
274}
275
276
277// Enumerate all planetary moons in a chart. For each moon, return its index,

Callers 2

XChartAstroGraphFunction · 0.85
XChartEphemerisFunction · 0.85

Calls 1

FProperFunction · 0.85

Tested by

no test coverage detected