Esempio n. 1
0
        public double TransitSearch(Body.Name SearchBody, Moment StartDate,
                                    bool Forward, Longitude TransitPoint,
                                    Longitude FoundLon, ref bool bForward)
        {
            if (SearchBody == Body.Name.Sun ||
                SearchBody == Body.Name.Moon)
            {
                return(TransitSearchDirect(SearchBody, StartDate, Forward, TransitPoint,
                                           FoundLon, ref bForward));
            }
            if (((int)SearchBody <= (int)Body.Name.Moon ||
                 (int)SearchBody > (int)Body.Name.Saturn) &&
                SearchBody != Body.Name.Lagna)
            {
                return(StartDate.toUniversalTime());
            }
            sweph.obtainLock(h);

            Retrogression r = new Retrogression(h, SearchBody);

            double julday_ut = StartDate.toUniversalTime() - h.info.tz.toDouble() / 24.0;
            double found_ut  = julday_ut;

            if (Forward)
            {
                found_ut = r.GetTransitForward(julday_ut, TransitPoint);
            }
            else
            {
                found_ut = r.GetTransitBackward(julday_ut, TransitPoint);
            }

            FoundLon.value = r.GetLon(found_ut, ref bForward).value;

            sweph.releaseLock(h);
            return(found_ut);
        }