Пример #1
0
    public void Setup()
    {
        OldBody Sun = new OldBody("Sun", OldBodyType.Sun, null, 0, 0, 0);

        Orbit earthOrbit = new Orbit("Sun", new Ellipse(100, 50), 365);

        Earth = new OldBody("Earth", OldBodyType.Planet, earthOrbit, 0, 0, 0);

        Orbit moonOrbit = new Orbit("Earth", new Ellipse(10.0, 5.0), 30.0);

        Moon = new OldBody("Moon", OldBodyType.Moon, moonOrbit, 0, 0, 0);
    }
 //this method will be used to add additional bodies to the
 //list of bodies if we want to further testing.
 public void addBody(OldBody body)
 {
     //string name = body.Name;
     //system.Add(name, body);
 }
Пример #3
0
    /// <summary>
    /// Get Distance of any two vectors at N days.
    /// </summary>
    /// <param name="from"></param>
    /// <param name="days"></param>
    /// <returns></returns>
    public double GetDistance(OldBody from, double days)
    {
        Vector3d distance = GetPosition(days) - from.GetPosition(days);

        return(distance.magnitude);
    }