Beispiel #1
0
        static public bool checkTithi(ZodiacHouse janmaRasi, Tithi t)
        {
            ZodiacHouse.Name ja = janmaRasi.value;
            Tithi.NandaType  gh = Tithi.NandaType.Nanda;
            switch (ja)
            {
            case ZodiacHouse.Name.Ari: gh = Tithi.NandaType.Nanda; break;

            case ZodiacHouse.Name.Tau: gh = Tithi.NandaType.Purna; break;

            case ZodiacHouse.Name.Gem: gh = Tithi.NandaType.Bhadra; break;

            case ZodiacHouse.Name.Can: gh = Tithi.NandaType.Bhadra; break;

            case ZodiacHouse.Name.Leo: gh = Tithi.NandaType.Jaya; break;

            case ZodiacHouse.Name.Vir: gh = Tithi.NandaType.Purna; break;

            case ZodiacHouse.Name.Lib: gh = Tithi.NandaType.Rikta; break;

            case ZodiacHouse.Name.Sco: gh = Tithi.NandaType.Nanda; break;

            case ZodiacHouse.Name.Sag: gh = Tithi.NandaType.Jaya; break;

            case ZodiacHouse.Name.Cap: gh = Tithi.NandaType.Rikta; break;

            case ZodiacHouse.Name.Aqu: gh = Tithi.NandaType.Jaya; break;

            case ZodiacHouse.Name.Pis: gh = Tithi.NandaType.Purna; break;
            }
            return(t.toNandaType() == gh);
        }
Beispiel #2
0
        static public bool checkDay(ZodiacHouse janmaRasi, Basics.Weekday wd)
        {
            ZodiacHouse.Name ja = janmaRasi.value;
            Basics.Weekday   gh = Basics.Weekday.Sunday;
            switch (ja)
            {
            case ZodiacHouse.Name.Ari: gh = Basics.Weekday.Sunday; break;

            case ZodiacHouse.Name.Tau: gh = Basics.Weekday.Saturday; break;

            case ZodiacHouse.Name.Gem: gh = Basics.Weekday.Monday; break;

            case ZodiacHouse.Name.Can: gh = Basics.Weekday.Wednesday; break;

            case ZodiacHouse.Name.Leo: gh = Basics.Weekday.Saturday; break;

            case ZodiacHouse.Name.Vir: gh = Basics.Weekday.Saturday; break;

            case ZodiacHouse.Name.Lib: gh = Basics.Weekday.Thursday; break;

            case ZodiacHouse.Name.Sco: gh = Basics.Weekday.Friday; break;

            case ZodiacHouse.Name.Sag: gh = Basics.Weekday.Friday; break;

            case ZodiacHouse.Name.Cap: gh = Basics.Weekday.Tuesday; break;

            case ZodiacHouse.Name.Aqu: gh = Basics.Weekday.Thursday; break;

            case ZodiacHouse.Name.Pis: gh = Basics.Weekday.Friday; break;
            }
            return(wd == gh);
        }
Beispiel #3
0
        static public bool checkStar(ZodiacHouse janmaRasi, Nakshatra nak)
        {
            ZodiacHouse.Name ja = janmaRasi.value;
            Nakshatra.Name   gh = Nakshatra.Name.Aswini;
            switch (ja)
            {
            case ZodiacHouse.Name.Ari: gh = Nakshatra.Name.Makha; break;

            case ZodiacHouse.Name.Tau: gh = Nakshatra.Name.Hasta; break;

            case ZodiacHouse.Name.Gem: gh = Nakshatra.Name.Swati; break;

            case ZodiacHouse.Name.Can: gh = Nakshatra.Name.Anuradha; break;

            case ZodiacHouse.Name.Leo: gh = Nakshatra.Name.Moola; break;

            case ZodiacHouse.Name.Vir: gh = Nakshatra.Name.Sravana; break;

            case ZodiacHouse.Name.Lib: gh = Nakshatra.Name.Satabisha; break;

            case ZodiacHouse.Name.Sco: gh = Nakshatra.Name.Revati; break;

            // FIXME dveja nakshatra?????
            case ZodiacHouse.Name.Sag: gh = Nakshatra.Name.Revati; break;

            case ZodiacHouse.Name.Cap: gh = Nakshatra.Name.Rohini; break;

            case ZodiacHouse.Name.Aqu: gh = Nakshatra.Name.Aridra; break;

            case ZodiacHouse.Name.Pis: gh = Nakshatra.Name.Aslesha; break;
            }
            return(nak.value == gh);
        }
Beispiel #4
0
        static public bool checkLagna(ZodiacHouse janma, ZodiacHouse same)
        {
            ZodiacHouse.Name ja = janma.value;
            ZodiacHouse.Name gh = ZodiacHouse.Name.Ari;
            switch (ja)
            {
            case ZodiacHouse.Name.Ari: gh = ZodiacHouse.Name.Ari; break;

            case ZodiacHouse.Name.Tau: gh = ZodiacHouse.Name.Tau; break;

            case ZodiacHouse.Name.Gem: gh = ZodiacHouse.Name.Can; break;

            case ZodiacHouse.Name.Can: gh = ZodiacHouse.Name.Lib; break;

            case ZodiacHouse.Name.Leo: gh = ZodiacHouse.Name.Cap; break;

            case ZodiacHouse.Name.Vir: gh = ZodiacHouse.Name.Pis; break;

            case ZodiacHouse.Name.Lib: gh = ZodiacHouse.Name.Vir; break;

            case ZodiacHouse.Name.Sco: gh = ZodiacHouse.Name.Sco; break;

            case ZodiacHouse.Name.Sag: gh = ZodiacHouse.Name.Sag; break;

            case ZodiacHouse.Name.Cap: gh = ZodiacHouse.Name.Aqu; break;

            case ZodiacHouse.Name.Aqu: gh = ZodiacHouse.Name.Gem; break;

            case ZodiacHouse.Name.Pis: gh = ZodiacHouse.Name.Leo; break;
            }
            return(same.value == gh);
        }
Beispiel #5
0
        private void Compute()
        {
            this.mList.BeginUpdate();
            this.mList.Clear();

            this.mList.BackColor = Color.AliceBlue;


            this.mList.Columns.Add("Body", -1, System.Windows.Forms.HorizontalAlignment.Left);
            this.mList.Columns.Add("Winner", -1, System.Windows.Forms.HorizontalAlignment.Left);

            int winner = 0;

            if (this.cbRasi1.SelectedIndex < 0)
            {
                this.cbRasi1.SelectedIndex = 0;
            }
            if (this.cbRasi2.SelectedIndex < 0)
            {
                this.cbRasi2.SelectedIndex = 0;
            }

            ZodiacHouse.Name z1 = (ZodiacHouse.Name) this.cbRasi1.SelectedIndex + 1;
            ZodiacHouse.Name z2 = (ZodiacHouse.Name) this.cbRasi2.SelectedIndex + 1;

            ArrayList al = this.GetRules();

            for (int i = 0; i < al.Count; i++)
            {
                ArrayList rule = new ArrayList();
                rule.Add(al[i]);
                FindStronger     fs = new FindStronger(h, options.Division, rule);
                ZodiacHouse.Name zw = fs.StrongerRasi(z1, z2, false, ref winner);
                ListViewItem     li = new ListViewItem();
                li.Text = string.Format("{0}", EnumDescConverter.GetEnumDescription((System.Enum)al[i]));

                if (winner == 0)
                {
                    li.SubItems.Add(string.Format("{0}", zw));
                }

                this.mList.Items.Add(li);
            }

            this.mList.Columns[0].Width = -1;
            this.mList.Columns[1].Width = -2;

            this.mList.EndUpdate();
        }
Beispiel #6
0
        static public bool checkGhataka(ZodiacHouse janmaRasi, ZodiacHouse chandraRasi)
        {
            ZodiacHouse.Name ja = janmaRasi.value;
            ZodiacHouse.Name ch = chandraRasi.value;

            ZodiacHouse.Name gh = ZodiacHouse.Name.Ari;

            switch (ja)
            {
            case ZodiacHouse.Name.Ari: gh = ZodiacHouse.Name.Ari; break;

            case ZodiacHouse.Name.Tau: gh = ZodiacHouse.Name.Vir; break;

            case ZodiacHouse.Name.Gem: gh = ZodiacHouse.Name.Aqu; break;

            case ZodiacHouse.Name.Can: gh = ZodiacHouse.Name.Leo; break;

            case ZodiacHouse.Name.Leo: gh = ZodiacHouse.Name.Cap; break;

            case ZodiacHouse.Name.Vir: gh = ZodiacHouse.Name.Gem; break;

            case ZodiacHouse.Name.Lib: gh = ZodiacHouse.Name.Sag; break;

            case ZodiacHouse.Name.Sco: gh = ZodiacHouse.Name.Tau; break;

            case ZodiacHouse.Name.Sag: gh = ZodiacHouse.Name.Pis; break;

            case ZodiacHouse.Name.Cap: gh = ZodiacHouse.Name.Leo; break;

            case ZodiacHouse.Name.Aqu: gh = ZodiacHouse.Name.Sag; break;

            case ZodiacHouse.Name.Pis: gh = ZodiacHouse.Name.Aqu; break;
            }

            return(ch == gh);
        }
Beispiel #7
0
        public void DrawChakra(Graphics g)
        {
            //this.DrawInnerChakra(g);

            if (false == this.PrintMode)
            {
                g.Clear(MhoraGlobalOptions.Instance.ChakraBackgroundColor);
            }

            this.ResetChakra(g, 0.0);
            g.DrawEllipse(pn_grey, -40, -40, 80, 80);
            g.DrawEllipse(pn_grey, -125, -125, 250, 250);
            g.DrawEllipse(pn_grey, -105, -105, 210, 210);
            g.DrawEllipse(pn_grey, -115, -115, 230, 230);

            Body.Name[] bodies = new Body.Name[10]
            {
                Body.Name.Lagna, Body.Name.Sun, Body.Name.Moon, Body.Name.Mars, Body.Name.Mercury,
                Body.Name.Jupiter, Body.Name.Venus, Body.Name.Saturn, Body.Name.Rahu, Body.Name.Ketu
            };

            for (int i = 0; i < 12; i++)
            {
                ResetChakra(g, i * 30);
                g.DrawLine(pn_lgrey, 40, 0, 125, 0);
            }
            for (int i = 0; i < 12; i++)
            {
                ResetChakra(g, i * 30 + 15);
                ZodiacHouse.Name z  = (ZodiacHouse.Name)(i + 1);
                SizeF            sz = g.MeasureString(z.ToString(), f);
                g.DrawString(z.ToString(), f, Brushes.Gray, 40 - sz.Width, 0);
            }
            for (int i = 0; i < 27; i++)
            {
                ResetChakra(g, (i + 1) * (360.0 / 27.0));          //+((360.0/27.0)/2.0));
                g.TranslateTransform(105, 0);
                g.RotateTransform((float)90.0);
                SizeF sz = g.MeasureString(nak_s[i], f);
                g.DrawString(nak_s[i], f, Brushes.Gray, (float)(360.0 / 27.0) - (sz.Width / 2), sz.Height / 2);
            }
            for (int i = 0; i < 27 * 4; i++)
            {
                ResetChakra(g, i * (360.0 / (27.0 * 4.0)));
                Pen p = pn_lgrey;
                if (i % 12 == 0)
                {
                    p = pn_black;
                }
                g.DrawLine(p, 115, 0, 125, 0);

                p = pn_lgrey;
                if (i % 4 == 0)
                {
                    p = pn_black;
                }
                g.DrawLine(p, 105, 0, 115, 0);
            }

            double dist_sat = h.getPosition(Body.Name.Saturn).distance;

            foreach (Body.Name b in bodies)
            {
                Pen          pn_b = new Pen(MhoraGlobalOptions.Instance.getBinduColor(b));
                Brush        br_b = new SolidBrush(MhoraGlobalOptions.Instance.getBinduColor(b));
                BodyPosition bp   = h.getPosition(b);
                ResetChakra(g, bp.longitude.value);
                int chWidth = 2;
                g.DrawEllipse(pn_black, 110 - (chWidth), 0, 1, 1);
                g.FillEllipse(br_b, 120 - chWidth, -chWidth, chWidth * 2, chWidth * 2);
                g.DrawEllipse(pn_grey, 120 - chWidth, -chWidth, chWidth * 2, chWidth * 2);
                SizeF sz = g.MeasureString(b.ToString(), f);
                g.DrawString(b.ToString(), f, Brushes.Black, 125, -sz.Height / 2);

                // current position with distance
                int dist = (int)(bp.distance / dist_sat * (105 - 40 - chWidth * 2));
                g.FillEllipse(br_b, 40 + dist - chWidth, -chWidth, chWidth * 2, chWidth * 2);
                g.DrawEllipse(pn_grey, 40 + dist - chWidth, -chWidth, chWidth * 2, chWidth * 2);

                // speed
                double dspSize = (bp.speed_longitude / 360.0) * 12000.0;
                if (bp.speed_longitude < 0)
                {
                    dspSize *= 2.0;
                }
                int spSize = (int)dspSize;
                if (spSize > 40)
                {
                    spSize = 40;
                }
                if (bp.speed_longitude > 0)
                {
                    g.DrawLine(pn_lgrey, 40 + dist, -chWidth, 40 + dist, -spSize);
                }
                else
                {
                    g.DrawLine(pn_lgrey, 40 + dist, chWidth, 40 + dist, -spSize);
                }
            }
        }