Пример #1
0
        public void RotEslabon3(double th1, double th2, double th3, Eslabon eslabonAnterior, Eslabon eslabonAnteAnterior)
        {
            pos1.Add(eslabonAnterior.GetListaPos2.Last());

            th1 *= Math.PI / 180;
            th2 *= Math.PI / 180;
            th3 *= Math.PI / 180;

            PointF pt = new PointF(
                (float)(eslabonAnteAnterior.GetLongitud * Math.Cos(th1) + eslabonAnterior.GetLongitud * Math.Cos(th1 + th2) + longitud * Math.Cos(th1 + th2 - th3)),
                (float)(eslabonAnteAnterior.GetLongitud * Math.Sin(th1) + eslabonAnterior.GetLongitud * Math.Sin(th1 + th2) + longitud * Math.Sin(th1 + th2 - th3)));

            pos2.Add(pt);
        }
Пример #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //Inicializacion de Variables de Clase

            puntosRotEslabon1 = new List <PointF>();
            puntosRotEslabon2 = new List <PointF>();
            pictureBox1.CreateGraphics();
            fromGraphics = pictureBox1.CreateGraphics();
            plano        = new PlanoXY(pictureBox1, fromGraphics);

            plano.DibujarPlano();
            eslabon1 = new Eslabon(new PointF(0, 0), new PointF(150, 0));
            //puntosRotEslabon1.Add(eslabon1.GetPos2);
            eslabon2 = new Eslabon(new PointF(0, 0), new PointF(0, 80));
            //puntosRotEslabon2.Add(eslabon2.GetPos2);
            angulo = 0;

            i = 0;
        }
Пример #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            #region  Inicializacion de Variables de Clase

            Graphics fromGraphics = pictureBox1.CreateGraphics();
            eslabon1 = new Eslabon(origen, new PointF(120, 0), pictureBox1, fromGraphics);
            eslabon2 = new Eslabon(new PointF(120, 0), new PointF(250, 0), pictureBox1, fromGraphics);
            eslabon3 = new Eslabon(new PointF(250, 0), new PointF(300, 0), pictureBox1, fromGraphics);



            //eslabon1 = new Eslabon(origen, new PointF(120, 0), pictureBox1, fromGraphics);
            //eslabon2 = new Eslabon(new PointF(120, 0), new PointF(250, 0), pictureBox1, fromGraphics);
            //eslabon3 = new Eslabon(new PointF(250, 0), new PointF(300, 0), pictureBox1, fromGraphics);

            //pictureBox1.CreateGraphics();
            //plano.DibujarPlano();

            angulo  = trackBar1.Value;
            angulo2 = trackBar2.Value;
            angulo3 = trackBar3.Value;

            #endregion
        }