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 ) ) );
        }
예제 #2
0
 public abstract PointF NextPosition( CelestialObject obj, double dt );
예제 #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 );
 }
예제 #5
0
 void planet_Changed(CelestialObject sender)
 {
     colorButton.BackColor = planet.Color;
 }