| 1615 | // corresponding to them. Covers maps, globes, and chart spheres. |
| 1616 | |
| 1617 | flag FMapCalc(real x1, real y1, int *xp, int *yp, flag fGlobe, flag fSky, |
| 1618 | real rT, int nScl, CONST CIRC *pcr, real deg) |
| 1619 | { |
| 1620 | int j, k, u, v; |
| 1621 | |
| 1622 | if (fSky >= 0) { |
| 1623 | if (!fSky) |
| 1624 | x1 = cp0.lonMC - x1; |
| 1625 | x1 = Mod(rDegHalf - rT - x1); |
| 1626 | y1 = rDegQuad - y1; |
| 1627 | } |
| 1628 | if (fGlobe) { |
| 1629 | j = FGlobeCalc(x1, y1, &u, &v, pcr, deg) ? nNegative : u; |
| 1630 | k = v; |
| 1631 | } else { |
| 1632 | j = (int)(x1 * (real)nScl); |
| 1633 | k = (int)(y1 * (real)nScl); |
| 1634 | if (k >= nDegHalf*nScl) |
| 1635 | k--; |
| 1636 | if (gs.fMollweide) |
| 1637 | j = 180*nScl + (int)((x1-180.0) * RMollweide(y1-90.0) / 180.0 + rRound); |
| 1638 | } |
| 1639 | *xp = j; *yp = k; |
| 1640 | return (j == nNegative); |
| 1641 | } |
| 1642 | |
| 1643 | |
| 1644 | // Draw one "Ley line" on the world map, based coordinates given in terms of |
no test coverage detected