Exemple #1
0
        private void PrintCircle(Subjects.Сircle c)
        {
            System.Drawing.Graphics g = _mainPictureBox.CreateGraphics();
            Coordinate coord          = GetRealCoord(c.Position, _plane, _mainPictureBox);

            g.DrawEllipse(new Pen(Color.Black), (int)coord.X - c.Radius, (int)coord.Y - c.Radius, (int)c.Radius * 2, (int)c.Radius * 2);
        }
Exemple #2
0
        private void _mainPictureBox_MouseDown(object sender, MouseEventArgs e)
        {
            Coordinate coord = GetRealCoordForPB(new Coordinate(e.X, e.Y), _plane, _mainPictureBox);

            Subjects.Сircle temp = new Subjects.Сircle(coord, new Speed(50, new ABGphysics.Сharacteristics.Angle(135)));
            temp.Radius = 10;
            _plane.AddSubject(temp);
        }
Exemple #3
0
        public _mainForm()
        {
            InitializeComponent();

            _a        = new Subjects.Сircle(new Coordinate(-50, -50), new Speed(50, new ABGphysics.Сharacteristics.Angle(135)));
            _plane    = new Plane(new Coordinate(-100, -100), new Coordinate(100, 100));
            _a.Radius = 10;
            _plane.AddSubject(_a);
        }