public override PointF NextPosition(CelestialObject obj, double dt)
        {
            Time += dt;

            double pos = 2 * Math.PI * Time / Period;

            return new PointF( (float)( Radius * Math.Cos( pos )), (float)( Radius * Math.Sin( pos ) ) );
        }
Esempio n. 2
0
 public abstract PointF NextPosition( CelestialObject obj, double dt );
Esempio n. 3
0
 void planetSystem_Moved(CelestialObject sender)
 {
     xTextBox.Text = Convert.ToString(planetSystem.GlobalPos.X);
     yTextBox.Text = Convert.ToString(planetSystem.GlobalPos.Y);
 }
 public void Recalculate(CelestialObject obj)
 {
     Time = Math.Atan2(obj.LocalPos.Y, obj.LocalPos.X) * Period / 2 / Math.PI;
     Radius = Math.Sqrt( obj.LocalPos.X * obj.LocalPos.X + obj.LocalPos.Y * obj.LocalPos.Y );
 }
Esempio n. 5
0
 void planet_Changed(CelestialObject sender)
 {
     colorButton.BackColor = planet.Color;
 }