Esempio n. 1
0
        /// <summary>
        ///
        /// CONTRUYE EL PUNTO CON LOS VALORES INTRODUCIDOS EN LAS CAJAS DE TEXTO, CAMBIA EL TEXTO
        /// DEL BOTON ACEPTAR POR CONTINUAR , LO CAMBIA A COLOR VERDE OSCURO y DIBUJA LOS PUNTOS EN
        /// EL AREA GRAFICA
        ///
        /// </summary>
        ///

        private void IniciarResolucion()
        {
            // Valores por defecto
            if (defecto)
            {
                tbPunto1X.Text = "5";
                tbPunto1Y.Text = "3";
                tbPunto2X.Text = "7";
            }
            // Mostrar los controles
            pnZoom.Show();
            btIzquierda.Show();
            btDerecha.Show();
            btArriba.Show();
            btAbajo.Show();
            btCentrar.Show();
            btZoomMas.Show();
            btZoomMenos.Show();
            lbZoomtitulo.Show();
            lbDesplazamiento.Show();
            pnZoom.Location = btContinuar.Location;
            pnParametro.Show();
            pnParametro.Location   = new Point(btContinuar.Location.X, pnZoom.Location.Y + pnZoom.Height + 5);
            btContinuar.Location   = new Point(btContinuar.Location.X, pnParametro.Location.Y + pnParametro.Height + 5);
            lbTituloParametro.Text = "Radianes:";

            lbPorPanel.Hide();
            lbIgualPanel.Hide();
            tbLargoFinal.Hide();
            lbLargoFinal.Hide();
            tbParametro.Location = new Point(tbParametro.Location.X - 50, tbParametro.Location.Y);

            lbTituloParametro.TextAlign = ContentAlignment.MiddleCenter;
            lbTituloParametro.AutoSize  = true;
            lbSegmentoInicial.AutoSize  = true;
            lbTituloParametro.Location  = new Point(lbTituloParametro.Location.X - 30, lbTituloParametro.Location.Y);
            lbSegmentoInicial.Location  = new Point(lbTituloParametro.Location.X + 80, lbTituloParametro.Location.Y);
            tbLargoInicial.Location     = new Point(tbLargoInicial.Location.X + 100, tbLargoInicial.Location.Y);
            tbLargoInicial.Text         = "57,29";
            lbSegmentoInicial.Text      = "Grados: ";
            apintar = new Punto(tbPunto1X.Text + " " + tbPunto1Y.Text + " " + "0");
            radio   = Racional.StringToRacional(tbPunto2X.Text);
            if (radio.Numerador < 0) // El radio no puede ser negativo
            {
                radio = new Racional(radio.Numerador * -1, radio.Denominador);
            }
            anguloradio = 1;
            ventanagrafica.PintarCirculo(apintar, radio, Color.Olive, 2, anguloradio);
            btCentrar.PerformClick();
            if (!directa)
            {
                lbExplicacion.Text = " El radio de la circunferencia en un ángulo determinado, es la hipotenusa de un triángulo rectángulo.\n La imagen representa la circunferencia introducida junto con el triángulo rectángulo en el que: el radio es la hipotenusa, y el largo de los catetos cumple el teorema de Pitágoras.\n Se puede observar como cambia el largo de los catetos cambiando el ángulo en el que se situa la linea del radio pulsando los botones.";
            }
            label1.Show();
            label1.Location  = new Point(btContinuar.Location.X, btContinuar.Location.Y + btContinuar.Height + 5);
            label1.BackColor = Color.Transparent;
            label1.Font      = new Font(label1.Font.FontFamily, 12);
            label1.Text      = "Teorema de Pitágoras aplicado a esta circunferencia:\n";
            double radiodouble = radio.Numerador / radio.Denominador;

            label1.Text += Racional.AString(radio) + "= Ѵ (" + Math.Round(radiodouble * Math.Sin(1), 2).ToString() + "^2 + " + Math.Round(radiodouble * Math.Cos(1), 2).ToString() + "^2 )  ";
            Controls.Add(ventanagrafica.Ventana);
            if (directa)
            {
                ContinuarResolucion();
            }
            paso = 1;
            ventanagrafica.Ventana.Invalidate();
        }