| 1199 | // the display routines. |
| 1200 | |
| 1201 | real CastChart(int nContext) |
| 1202 | { |
| 1203 | CI ciSav; |
| 1204 | real housetemp[cSign+1], r, r2; |
| 1205 | int i, k, k2; |
| 1206 | |
| 1207 | is.nContext = nContext; |
| 1208 | #ifdef EXPRESS |
| 1209 | // Notify AstroExpression a chart is about to be cast. |
| 1210 | if (!us.fExpOff && FSzSet(us.szExpCast1)) |
| 1211 | ParseExpression(us.szExpCast1); |
| 1212 | #endif |
| 1213 | |
| 1214 | // If month is negative, then chart was read in through a -o0 position file, |
| 1215 | // so planet positions are already in the arrays. |
| 1216 | |
| 1217 | if (FNoTimeOrSpace(ciCore)) { |
| 1218 | is.MC = planet[oMC]; is.Asc = planet[oAsc]; |
| 1219 | ComputeInHouses(); |
| 1220 | return 0.0; |
| 1221 | } |
| 1222 | |
| 1223 | // Time zone 24 means to have the time of day be in Local Mean Time (LMT). |
| 1224 | // This is done by making the time zone value reflect the logical offset |
| 1225 | // from UTC as indicated by the chart's longitude value. |
| 1226 | |
| 1227 | ciSav = ciCore; |
| 1228 | is.JD = (real)MdyToJulian(MM, DD, YY); |
| 1229 | if (ZZ == zonLMT) |
| 1230 | ZZ = OO / 15.0; |
| 1231 | else if (ZZ == zonLAT) |
| 1232 | ZZ = OO / 15.0 - SwissLatLmt(is.JD); |
| 1233 | if (SS == dstAuto) |
| 1234 | SS = (real)is.fDst; |
| 1235 | TT = RSgn(TT)*RFloor(RAbs(TT))+RFract(RAbs(TT)) + (ZZ - SS); |
| 1236 | AA = Min(AA, rDegQuad-rSmall); // Make sure chart isn't being cast on |
| 1237 | AA = Max(AA, -(rDegQuad-rSmall)); // precise North or South Pole. |
| 1238 | |
| 1239 | ClearB((pbyte)&cp0, sizeof(CP)); // On ecliptic unless say otherwise. |
| 1240 | ClearB((pbyte)space, sizeof(space)); |
| 1241 | |
| 1242 | is.T = (is.JD + TT/24.0) + (us.rCuspAddition/24.0); |
| 1243 | if (us.fProgress) { |
| 1244 | |
| 1245 | // For ptCast, is.Tp is time that progressed chart cusps cast for. |
| 1246 | // For ptMixed, is.Tp is base chart time to solar arc cusps from. |
| 1247 | is.Tp = is.T; |
| 1248 | if (us.nProgress != ptMixed) |
| 1249 | is.Tp += (is.JDp - is.Tp) / ((us.nProgress != ptSolarArc || |
| 1250 | us.objProgArc < 0) ? (us.rProgDay * us.rProgCusp) : rDayInYear); |
| 1251 | is.Tp = (is.Tp - 2415020.5) / 36525.0; |
| 1252 | |
| 1253 | // Determine actual time that a progressed chart is to be cast for. |
| 1254 | if (us.nProgress != ptSolarArc) { |
| 1255 | is.T += ((is.JDp - is.T) / us.rProgDay); |
| 1256 | #ifdef EXPRESS |
| 1257 | // Adjust progression times with AstroExpressions. |
| 1258 | if (!us.fExpOff && FSzSet(us.szExpProg)) { |
no test coverage detected