Esempio n. 1
0
        public void Calculate()
        {
            double jul_ut = SweWrapper.ToJulianDay(this.moment);

            PlanetPosition pos = null;

            foreach (PlanetId id in Astrolabe.Concerned)
            {
                pos = SweWrapper.PositionOf(jul_ut, id, SeFlg.SEFLG_SPEED);

                if (this.starPositions.ContainsKey(id))
                {
                    this.starPositions[id] = pos;
                }
                else
                {
                    this.starPositions.Add(id, pos);
                }

                //this.starPositions.Add(id, pos);

                //pos2 = PositionOf(jul_et, id);
            }

            SweWrapper.swe_close();

            PlanetPosition posA, posB;

            patterns.Clear();

            for (int i = 0; i < starPositions.Count - 1; i++)
            {
                KeyValuePair <PlanetId, PlanetPosition> kvp = starPositions.ElementAt(i);
                posA = kvp.Value;
                for (int j = i + 1; j < starPositions.Count; j++)
                {
                    kvp  = starPositions.ElementAt(j);
                    posB = kvp.Value;

                    if (Relation.HasRelation(posA, posB))
                    {
                        Relation newRelation = new Relation(posA, posB);

                        patterns.Add(newRelation.Kind, newRelation);
                    }
                }
            }
        }
Esempio n. 2
0
 public AspectHelper(RelationKind kind, DateTime time)
 {
     this.kind            = kind;
     this.referencePoint  = SweWrapper.ToJulianDay(time);
     this.cachedAspects   = new SortedDictionary <double, double>(new JulianUtComparer());
     this.concernedAngles = new List <double>();
     if (kind.Pattern != AspectType.None)
     {
         this.concernedAngles.Add(Aspect.DegreesOf(kind.Pattern));
     }
     else
     {
         foreach (double degrees in Aspect.Concerned.Keys)
         {
             this.concernedAngles.Add(degrees);
         }
     }
     initiateCache();
 }