La Web del Programador: Comunidad de Programadores
 
    Pregunta:  46836 - GRAFICAR ECUACIÓN DE SEGUNDO GRADO
Autor:  Nubia Amparo Giraldo García
Hola. Cómo hago para graficar la función cuadrática y = ax² + bx + c en Visual Basic.NET?. Agradezco mucho a quien me pueda colaborar.

Nubia Giraldo

  Respuesta:  Juan Juan
http://www.geocities.com/uribanabreak/x2.zip
aca esta el programa y abajo el fuente

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'para a = 1, b = 5 y c = 10
Dim x, y As Single
p3.Height = 200
p3.Width = 200

p3.CreateGraphics().Clear(System.Drawing.Color.White)
p3.CreateGraphics().DrawLine(New System.Drawing.Pen(System.Drawing.Color.Black, 4), p3.Width \ 2, 0, p3.Width \ 2, p3.Height)
p3.CreateGraphics().DrawLine(New System.Drawing.Pen(System.Drawing.Color.Black, 4), 0, p3.Height \ 2, p3.Width, p3.Height \ 2)

For x = -20 To 20
y = -x * x - 5 * x - 10
p3.CreateGraphics().DrawEllipse(Pens.Blue, x + 100, y + 100, 1, 1)
Next
End Sub
End Class