Make your own free website on Tripod.com

Quadratic Functions Graph Plotter

 

 

This is a program that can plot graphs for quadratic functions. It employs a picture box as plot area and three text boxes to obtain the values of the coefficients a, b, c of the quadratic equation from the users. This program is useful for high school students and mathematics teachers.

The Interface

 

The Codes



Private Sub cmd_draw_Click()
Dim a, b, c As Integer
Dim w, v As Single
a = Val(txt_a.Text)
b = Val(txt_b.Text)
c = Val(txt_c.Text)

'Using a scale of 0.5 cm to represent i unit to draw the graph
' Need to make some transformation as the coordinates in VB start from top left
For w = 0 To 10 Step 0.001

v = a * (5 - w) ^ 2 - b * (5 - w) + c
pic_graph.PSet (w, 5 - v)

Next w

End Sub



Private Sub Command1_Click()
pic_graph.Cls

txt_a.Text = ""
txt_b.Text = ""
txt_c.Text = ""

End Sub

Private Sub Command2_Click()
End
End Sub