예제 #1
0
        public static void calcAscAndMc(ref AstroDefs.planet_positions pos, float latitude, float longitude)
        {
            float localSideral = (float)calculateLocalSideral(pos.gmt0sideralTime, pos.gmtTime, longitude);
            float asc          = ascendantFromSideralLatitude(localSideral, latitude);
            float mc           = mediumCoeliFromSideral(localSideral);

            if (!mcAboveAsc(mc, asc))
            {
                if ((latitude > 66) || (latitude < -66))
                {
                    // We assume this is due to the weird behaviour of the
                    // ascendant in the far north (/south ?):
                    // We turn the ascendant around 180 degrees,
                    // some say we should also turn medium coeli
                    asc = AstroDefs.filter360(asc + 180);
                }
                else
                {
                    //throw new AstroException("Something wrong with ascendant calculation!");
                    // -----------------
                    // Hmmm for Hillary Clinton, turning the MC around seems to fix the deal...
                    mc = AstroDefs.filter360(mc + 180);
                    //return; // do nothing
                }
            }
            pos.ascendant   = asc;
            pos.mediumCoeli = mc;
        }
예제 #2
0
        public static void calcHousesKoch(ref float[] houses, float asc, float mc, float localSideral, float latitude)
        {
            double A1, A2, A3, KN, D, X;
            int    i;
            double AA = degToRad(latitude);

            if (AA == 0)
            {
                AA = 0.0001;
            }
            double RA = degToRad(localSideral * 15.0);
            double OB = degToRad(eclipticObliquity());

            A1 = Math.Sin(RA) * Math.Tan(AA) * Math.Tan(OB);
            A1 = Math.Asin(A1);
            for (i = 1; i <= 12; i++)
            {
                D  = AstroDefs.filter360(60.0f + 30.0f * (float)i);
                A2 = D / 90.0 - 1.0; KN = 1.0;
                if (D >= 180.0)
                {
                    KN = -1.0;
                    A2 = D / 90.0 - 3.0;
                }
                A3            = degToRad(AstroDefs.filter360((float)(radToDeg(RA) + D + A2 * radToDeg(A1))));
                X             = Angle(Math.Cos(A3) * Math.Cos(OB) - KN * Math.Tan(AA) * Math.Sin(OB), Math.Sin(A3));
                houses[i - 1] = AstroDefs.filter360((float)radToDeg(X));
            }
        }
예제 #3
0
        public static bool mcAboveAsc(float mc, float asc)
        {
            float desc = AstroDefs.filter360(asc + 180.0f);

            if (desc > asc)
            {
                return((mc > desc) || (mc < asc));
            }
            else
            {
                return((mc > desc) && (mc < asc));
            }
        }
예제 #4
0
 public static void calcHousesWholeVedic(ref float[] houses, float asc)
 {
     for (int i = 0; i < 12; i++)
     {
         if (i == 0)
         {
             houses[i] = AstroDefs.ephem_signForPosition(asc) * 30.0f;
         }
         else
         {
             houses[i] = AstroDefs.filter360(houses[i - 1] + 30);
         }
     }
 }
예제 #5
0
 public static void calcHousesEqualASC(ref float[] houses, float asc)
 {
     for (int i = 0; i < 12; i++)
     {
         if (i == 0)
         {
             houses[i] = asc;
         }
         else
         {
             houses[i] = AstroDefs.filter360(houses[i - 1] + 30);
         }
     }
 }
예제 #6
0
        public static double calculateLocalSideral(double gmt0sideraltime, double newGmtTime, double longitude)
        {
            // 24hours in normal time gives 3 mins 56.6 seconds sideral time.
            // hms2hours(0,3,56.6) / 24) gives 0.00273843
            double hourLength   = 0.00273843;
            double localSideral = newGmtTime + gmt0sideraltime +
                                  (newGmtTime * hourLength) +
                                  AstroDefs.hmsToHours(0, longitude * 4, 0);

            // [above:] the sun spends 4 minutes to pass each of the 360 degrees
            // (360*4=1440mins 1440/60=24hours):
            if (localSideral > 24)
            {
                localSideral -= 24;
            }
            return(localSideral);
        }
예제 #7
0
        public static float mediumCoeliFromSideral(float localSideral)
        {
            double eh     = degToRad(eclipticObliquity());
            double ramc   = degToRad(localSideral * 15.0);
            double mc_rad = Math.Atan(Math.Tan(ramc) / Math.Cos(eh));
            double mc     = radToDeg(mc_rad);

            if (mc < 0)
            {
                mc += 180;
            }
            if (radToDeg(ramc) > 180)
            {
                mc += 180;
            }
            return(AstroDefs.filter360((float)mc));
        }
예제 #8
0
        /*
         * void placProc(double &D11, double &D12, double &D2, double &D3,
         *    double H11, double H12, double H2, double H3,
         *    double f, double e) {
         * double F11 = 1.0/3;
         * double F12 = 2.0/3;
         * double F2 = 2.0/3;
         * double F3 = 1.0/3;
         *
         *
         * double dtf = dtan(f);
         * double dt2 = dtan(D2);
         * double s = dtf * dt2;
         * double ds = dasin(s);
         *
         * double A11 = F11 *  dasin ( dtan (f) * dtan (D11) );
         * double  A12 = F12 *  dasin ( dtan (f) * dtan (D12 ));
         * double  A2 = F2 *  dasin ( dtan (f) * dtan (D2) ) ;
         * double  A3 = F3 *  dasin ( dtan (f) * dtan (D3));
         *
         * //6. Compute the house cusp positions as follows:
         * double M11 = datan ( dsin (A11) / ( dcos (H11) * dtan (D11)) ) ;
         * double M12 = datan ( dsin (A12) / ( dcos (H12) * dtan (D12)) ) ;
         * double M2 = datan ( dsin (A2) / ( dcos (H2) * dtan (D2)) ) ;
         * double M3 = datan ( dsin (A3) / ( dcos (H3) * dtan (D3)) ) ;
         *
         * //7. Compute the intermediate house cusps:
         * double R11 = datan ( ( dtan (H11) * dcos (M11) ) / dcos ( M11 + e) ) ;
         * double R12 = datan ( ( dtan (H12) * dcos (M12) ) / dcos ( M12 + e) ) ;
         * double R2 = datan ( ( dtan (H2 )* dcos (M2) ) / dcos ( M2 + e) ) ;
         * double R3 = datan ( ( dtan (H3) * dcos (M3) ) / dcos ( M3 + e) );
         *
         * D11 =R11; // filter360(R11);
         * D12 =R12; // filter360(R12);
         * D2 = R2; //filter360(R2);
         * D3 = R3; //filter360(R3);
         * }*/

        public static float ascendantFromSideralLatitude(float localSideral, float latitude)
        {
            double eh = degToRad(eclipticObliquity());

            double ramc   = degToRad(localSideral * 15.0);
            double lati   = degToRad(latitude);
            double teller = Math.Cos(ramc);
            double nevner = ((0.0 - Math.Sin(ramc)) * Math.Cos(eh) -
                             Math.Tan(lati) * Math.Sin(eh));

            double asc_rad = Math.Atan(teller / nevner);
            double asc     = radToDeg(asc_rad);

            if (nevner < 0)
            {
                asc += 180.0;
            }
            return(AstroDefs.filter360((float)asc));
        }
예제 #9
0
 public static void calcHousesPlacidus(ref float[] houses, float asc, float mc, float localSideral, float latitude)
 {
     houses[1 - 1] = asc;
     houses[4 - 1] = mc + 180.0f;
     houses[5 - 1] = (float)cuspPlacidus(30.0, 3.0, false, localSideral, latitude) + 180.0f;
     houses[6 - 1] = (float)cuspPlacidus(60.0, 1.5, false, localSideral, latitude) + 180.0f;
     houses[2 - 1] = (float)cuspPlacidus(120.0, 1.5, true, localSideral, latitude);
     houses[3 - 1] = (float)cuspPlacidus(150.0, 3.0, true, localSideral, latitude);
     for (int i = 0; i < 12; i++)
     {
         if (i < 6)
         {
             houses[i] = AstroDefs.filter360(houses[i] /*+is.rSid*/);
         }
         else
         {
             houses[i] = AstroDefs.filter360(houses[i - 6] + 180.0f); //rDegHalf);
         }
     }
 }
예제 #10
0
        public static void calcHousesPorphyry(ref float[] houses, float asc, float mc)
        {
            float fourthQuadSize = AstroDefs.calcDistance(mc, asc);
            float signSizeQ4     = fourthQuadSize / 3.0f;
            float firstQuadSize  = 180 - fourthQuadSize;
            float signSizeQ1     = firstQuadSize / 3.0f;

            houses[0] = asc;
            houses[1] = AstroDefs.filter360(asc + signSizeQ1);
            houses[2] = AstroDefs.filter360(asc + signSizeQ1 * 2);
            float ic = houses[3] = AstroDefs.filter360(mc + 180.0f); // IC/4th

            houses[4] = AstroDefs.filter360(ic + signSizeQ4);
            houses[5] = AstroDefs.filter360(ic + signSizeQ4 * 2);
            float dec = houses[6] = AstroDefs.filter360(asc + 180.0f); // Descendant/7th

            houses[7]  = AstroDefs.filter360(dec + signSizeQ1);
            houses[8]  = AstroDefs.filter360(dec + signSizeQ1 * 2);
            houses[9]  = mc; // MC/10th
            houses[10] = AstroDefs.filter360(mc + signSizeQ4);
            houses[11] = AstroDefs.filter360(mc + signSizeQ4 * 2);
        }