//------------------------------------------------------------------------
/* in function CalcH(...) add var declarations and new case */
double x[3], krHorizonLon;
case 'U': /* Krusinski */
/*
Mathematical description for this house system
was formulated by Bogdan Krusinski in 1995.
Introduction:
New house system born in 1995 from 'marriage' of mathematical
principles of modern spherical trigonometry and assumption
widely accepted among astrologers that Ascendant and Medium Coeli
form a base of house system formulation.
For development of this house system 'Medium Coeli' was assumed
in its' original pre-ecliptic definition as point directly overhead,
located upper square from ascendant, in modern times in astronomy
called 'zenith'.
'Meridian' in definition of this house system is undestood
as great circle passing through the north and south celestial poles
in equatorial coordinates (perpendicular to equator).
Definition:
"Krusinski - house system based on great circle passing through
ascendant and zenith ('Medium Coeli'). This circle is divided into
12 equal parts (1st cusp is ascendent, 10th cusp is zenith),
then resulting points are projected to ecliptic through meridian
circles."
Description of algorithm:
Transform into great circle running through Asc and zenit (where arc
between Asc and zenith is always 90 deg), and then return with
house cusps into ecliptic. Eg. solve trigonometrical triangle
with three transformations and two rotations starting from ecliptic.
House cusps in space are meridian circles.
Notes:
1. In this definition we assume MC on ecliptic as point where
half-meridian (from north to south pole) cuts ecliptic,
so MC may be below horizon in arctic regions.
2. Houses could be calculated in all latitudes except the poles
themselves (-90,90) and points on arctic circle in cases where
ecliptic is equal to horizon and then ascendant is undefined.
But ascendant when 'horizon=ecliptic' could be deduced as limes from
both sides of that point and houses with that provision can be computed
also there.
Starting values for calculations:
- Asc ecliptic longitude
- right ascension of MC (RAMC)
- geographic latitude.
*/
/*
* within polar circle we swap AC/DC if AC is on wrong side
*/
acmc = swe_difdeg2n(hsp->ac, hsp->mc);
if (acmc < 0) {
hsp->ac = swe_degnorm(hsp->ac + 180);
}
/* A0. Start point - ecliptic coords of ascendant */
x[0] = hsp->ac; /* Asc longitude */
x[1] = 0.0; /* Asc declination */
x[2] = 1.0; /* Radius to test validity of subsequent transformations. */
swe_cotrans(x, x, -ekl); /* A1. Transform into equatorial coords */
x[0] = x[0] - (th-90); /* A2. Rotate */
swe_cotrans(x, x, -(90-fi)); /* A3. Transform into horizontal coords */
krHorizonLon = x[0]; /* ...save asc lon on horizon to get back later with house cusp */
x[0] = x[0] - x[0]; /* A4. Rotate */
swe_cotrans(x, x, -90); /* A5. Transform into this house system great circle (asc-zenith) */
/* As it is house circle now, simple add 30 deg increments... */
for(i = 0; i < 6; i++)
{
/* B0. Set 'n-th' house cusp.
* Note that IC/MC are also calculated here to check
* if really this is the asc-zenith great circle. */
x[0] = 30.0*i;
x[1] = 0.0;
swe_cotrans(x, x, 90); /* B1. Transform back into horizontal coords */
x[0] = x[0] + krHorizonLon; /* B2. Rotate back. */
swe_cotrans(x, x, 90-fi); /* B3. Transform back into equatorial coords */
x[0] = swe_degnorm(x[0] + (th-90)); /* B4. Rotate back -> RA of house cusp as result. */
/* B5. Where's this house cusp on ecliptic? */
/* ... so last but not least - get ecliptic longitude of house cusp: */
hsp->cusp[i+1] = atand(tand(x[0])/cosd(ekl));
if (x[0] > 90 && x[0] <= 270)
hsp->cusp[i+1] = swe_degnorm(hsp->cusp[i+1] + 180);
hsp->cusp[i+1] = swe_degnorm(hsp->cusp[i+1]);
hsp->cusp[i+7] = swe_degnorm(hsp->cusp[i+1]+180);
}
break;
//------------------------------------------------------------------------
/* in function swe_house_pos(...) add var declarations and new case */
double x[3], xasc[3], raep, raaz, oblaz, xtemp;
case 'U': /* Krusinski */
/* Purpose: find point where planet's house circle (meridian)
* cuts house plane, giving exact planet's house position.
* Input data: ramc, geolat, asc.
*/
asc = Asc1 (swe_degnorm(armc + 90), geolat, sine, cose);
demc = atand(sind(armc) * tand(eps));
/* while MC is always south,
* Asc must always be in eastern hemisphere */
if (geolat >= 0 && 90 - geolat + demc < 0) {
asc = swe_degnorm(asc + 180);
}
if (geolat < 0 && -90 - geolat + demc > 0) {
asc = swe_degnorm(asc + 180);
}
/*
* Descr: find the house plane 'asc-zenith' - where it intersects
* with equator and at what angle, and then simple find arc
* from asc on that plane to planet's meridian intersection
* with this plane.
*/
/* I. find plane of 'asc-zenith' great circle relative to equator:
* solve spherical triangle 'EP-asc-intersection of house circle with equator' */
/* Ia. Find intersection of house plane with equator: */
x[0] = asc; x[1] = 0.0; x[2] = 1.0; /* 1. Start with ascendent on ecliptic */
swe_cotrans(x, x, -eps); /* 2. Transform asc into equatorial coords */
raep = swe_degnorm(armc + 90); /* 3. RA of east point */
x[0] = swe_degnorm(raep - x[0]); /* 4. Rotation - found arc raas-raep */
swe_cotrans(x, x, -(90-geolat)); /* 5. Transform into horizontal coords - arc EP-asc on horizon */
xtemp = atand(tand(x[0])/cosd((90-geolat))); /* 6. Rotation from horizon on circle perpendicular to equator */
if (x[0] > 90 && x[0] <= 270)
xtemp = swe_degnorm(xtemp + 180);
x[0] = swe_degnorm(xtemp);
raaz = swe_degnorm(raep - x[0]); /* result: RA of intersection 'asc-zenith' great circle with equator */
/* Ib. Find obliquity to equator of 'asc-zenith' house plane: */
x[0] = raaz; x[1] = 0.0;
x[0] = swe_degnorm(raep - x[0]); /* 1. Rotate start point relative to EP */
swe_cotrans(x, x, -(90-geolat)); /* 2. Transform into horizontal coords */
x[1] = x[1] + 90; /* 3. Add 90 deg do decl - so get the point on house plane most distant from equ. */
swe_cotrans(x, x, 90-geolat); /* 4. Rotate back to equator */
oblaz = x[1]; /* 5. Obliquity of house plane to equator */
/* II. Next find asc and planet position on house plane,
* so to find relative distance of planet from
* coords beginning. */
/* IIa. Asc on house plane relative to intersection
* of equator with 'asc-zenith' plane. */
xasc[0] = asc; xasc[1] = 0.0; xasc[2] = 1.0;
swe_cotrans(xasc, xasc, -eps);
xasc[0] = swe_degnorm(xasc[0] - raaz);
xtemp = atand(tand(xasc[0])/cosd(oblaz));
if (xasc[0] > 90 && xasc[0] <= 270)
xtemp = swe_degnorm(xtemp + 180);
xasc[0] = swe_degnorm(xtemp);
/* IIb. Planet on house plane relative to intersection
* of equator with 'asc-zenith' plane */
xp[0] = swe_degnorm(xeq[0] - raaz); /* Rotate on equator */
xtemp = atand(tand(xp[0])/cosd(oblaz)); /* Find arc on house plane from equator */
if (xp[0] > 90 && xp[0] <= 270)
xtemp = swe_degnorm(xtemp + 180);
xp[0] = swe_degnorm(xtemp);
xp[0] = swe_degnorm(xp[0]-xasc[0]); /* find arc between asc and planet, and get planet house position */
/* IIc. Distance from planet to house plane on declination circle: */
x[0] = xeq[0];
x[1] = xeq[1];
swe_cotrans(x, x, oblaz);
xp[1] = xeq[1] - x[1]; /* How many degrees is the point on declination circle from house circle */
/* to make sure that a call with a house cusp position returns
* a value within the house, 0.001" is added */
xp[0] = swe_degnorm(xp[0] + MILLIARCSEC);
hpos = xp[0] / 30.0 + 1;
break;