Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Planet position in house #24

Closed
SkyQuant opened this issue Feb 23, 2017 · 1 comment
Closed

Planet position in house #24

SkyQuant opened this issue Feb 23, 2017 · 1 comment

Comments

@SkyQuant
Copy link

SkyQuant commented Feb 23, 2017

What's wrong in this method to get planet position in Placidus house system?

        public static double GetPlanetInHousePosition(int ipl, DateTimeOffset dtz, double lon, double lat, char hsys = 'P')
        {
            var serr = string.Empty;
            var dtu = dtz.UtcDateTime;

            using (var sweph = new SwissEph())
            {
                var jyear = dtu.Year;
                var jmon = dtu.Month;
                var jday = dtu.Day;
                var jhour = dtu.Hour;
                var jmin = dtu.Minute;
                var jsec = dtu.Second;

                var jut = jhour + (jmin / 60.0) + (jsec / 3600.0);
                var tjd_ut = sweph.swe_julday(jyear, jmon, jday, jut, SwissEph.SE_GREG_CAL);
                sweph.swe_revjul(tjd_ut, SwissEph.SE_GREG_CAL, ref jyear, ref jmon, ref jday, ref jut);
                var delt = sweph.swe_deltat(tjd_ut);
                var tjd_et = tjd_ut + delt;

                int iflag = 0;
                iflag = (iflag & ~SwissEph.SEFLG_EPHMASK) | SwissEph.SEFLG_SWIEPH;
                iflag |= SwissEph.SEFLG_SPEED;
                double[] x = new double[6];
                int iflgret = sweph.swe_calc(tjd_et, SwissEph.SE_ECL_NUT, iflag, x, ref serr);
                var eps_true = x[0];
                var sidt = sweph.swe_sidtime(tjd_ut) + lon / 15;
                if (sidt >= 24)
                    sidt -= 24;
                if (sidt < 0)
                    sidt += 24;
                var armc = sidt * 15;
                var hpos = sweph.swe_house_pos(armc, lat, eps_true, hsys , x, ref serr);
                return hpos;
            }
        }
@ygrenier
Copy link
Owner

Sorry for the delay.

I don't use the Library, I make it for a friend. So I'm not sure about the calculation and the result you expect. I can help about the use of the code, but not about the calculations.

But if I look the line 1960 of the SweTest program which using swe_house_pos(), I can see the armc with a different calculation than your code, line 1942 :

  armc = sweph.swe_degnorm(sweph.swe_sidtime(tut) * 15 + geopos[0]);

You can ask the question in the official SwissEphemeris Library group http://groups.yahoo.com/group/swisseph/ where there are the people are better about the ephemeris calculation. After you apply the response to the SwissEphNet.

@ygrenier ygrenier closed this as completed Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants