示例#1
0
 public kaplarianElements(ObjectDataRecords obj)
 {
     this.a     = (double)obj.A;
     this.nu    = (double)obj.Nu * rads;
     this.omega = (double)obj.Omega * rads;
     this.q     = (double)obj.Q * rads;
     this.w     = (double)obj.W * rads;
     this.i     = (double)obj.I * rads;
     this.e     = (double)obj.E;
     this.m     = (double)obj.M * rads;
 }
示例#2
0
        //Vision for major planets
        public void updateVision()
        {
            string[]            planets    = { "mercury", "venus", "mars", "jupiter", "saturn", "uranus", "neptune" };
            ObjectDataRecords[] planetData = new ObjectDataRecords[7];
            for (int i = 0; i < planets.Length - 1; i++)
            {
                var loc = database.search(planets[i].ToUpper());
                planetData[i] = database.data[loc];
                calc.DirectionFinder(planetData[i]);
            }

            for (int i = 0; i < planets.Length - 1; i++)
            {
                if (planetData[i].El > 0)
                {
                    var x = ExtensionMethods.Map(planetData[i].Az, 0, 360, 0, 77);
                    var y = ExtensionMethods.Map(planetData[i].El, 0, 90, 0, 7);
                    w_vision.text((i + 1).ToString(), (byte)x, (byte)(7 - y));
                }
            }
        }
示例#3
0
        private void command(string command)
        {
            logger.log(Logger.Level.INFO, "Got command : " + command);
            var tokens = command.Split(' ');

            switch (tokens[0])
            {
            case "FOLLOW":
                if (tokens.Length > 1)
                {
                    var loc = database.search(tokens[1]);
                    if (loc < 0)
                    {
                        w_vision.text("Could not find " + tokens[1], 0, 0, true);
                    }
                    else
                    {
                        currentObject = database.data[loc];
                        calc.DirectionFinder(currentObject);
                    }
                }

                break;

            case "R":
                Thread.Sleep(1000);
                VT4100.Send(clear);
                draw();
                break;

            case "STOP":
                currentObject = null;
                break;

            default:

                break;
            }
        }
示例#4
0
        public static ObjectDataCalculations DirectionFinder(ObjectDataRecords systemObject, ObjectDataRecords earth, double longitude, double latitude)
        {
            longitude = longitude * rads;
            latitude  = latitude * rads;
            var objectCart = cartPlaneCalc(new kaplarianElements(systemObject));
            var earthCart  = cartPlaneCalc(new kaplarianElements(earth));

            systemObject.Calculations.CartX = objectCart.x;
            systemObject.Calculations.CartY = objectCart.y;
            systemObject.Calculations.CartZ = objectCart.z;
            var geocentricEclip = new vector3D {
                x = objectCart.x - earthCart.x, y = objectCart.y - earthCart.y, z = objectCart.z - earthCart.z
            };
            var raDec     = geo2RaDec(geocentricEclip);
            var st        = SiderealTime(new kaplarianElements(earth), longitude);
            var hourAngle = HourAngle(st, raDec);

            var A = (Atan2(Sin(hourAngle), Cos(hourAngle) * Sin(latitude) - Tan(raDec.Dec) * Cos(latitude)) * degs) + 180;
            var h = Asin(Sin(latitude) * Sin(raDec.Dec) + Cos(latitude) * Cos(raDec.Dec) * Cos(hourAngle)) * degs;

            return(new ObjectDataCalculations {
                Az = A, El = h, Ra = raDec.Ra, Dec = raDec.Dec, HourAngle = hourAngle, LST = st, Distance = raDec.Distance
            });
        }