设计一窗体,坐标原点在窗体的中央位置,画出函数曲线,函数式为y=x,乘以...
发布网友
发布时间:2024-06-01 14:41
我来回答
共2个回答
热心网友
时间:2024-07-20 18:06
Private Sub Form_Load()
Dim g, h
g = 5
h = 5
Me.Cls
Me.Height = 8000
Me.Width = 8000
Me.AutoRedraw = True
Me.Scale (-g, h)-(g, -h)
Me.Line (g, 0)-(-g, 0), QBColor(2)
Me.Line (0, h)-(0, -h), QBColor(2)
For e = -9 To 9
Me.Line (e * g / 10, 0.2 * h / 10)-(e * g / 10, 0), QBColor(2)
Me.Line (0.2 * g / 10, e * h / 10)-(0, e * h / 10), QBColor(2)
Next e
For X1 = -g To g Step 0.0005 * g
Y1 = X1 ^ 2 - 2 * X1 + 1
Me.PSet (X1, Y1)
Next X1
For u = -4 To -1
Me.CurrentX = -0.8 * g / 5
Me.CurrentY = u * h / 5 + 0.1 * h / 3
Me.Print Format(u * h / 5, "0.0##")
Me.CurrentX = u * g / 5 - 0.2 * g / 3
Me.CurrentY = -0.1 * h / 5
Me.Print Format(u * g / 5, "0.0##")
Next u
For u = 1 To 4
Me.CurrentX = -0.6 * g / 5
Me.CurrentY = u * h / 5 + 0.1 * h / 3
Me.Print Format(u * h / 5, "0.0##")
Me.CurrentX = u * g / 5 - 0.15 * g / 3
Me.CurrentY = -0.1 * h / 5
Me.Print Format(u * g / 5, "0.0##")
Next u
Me.CurrentX = -0.05 * g
Me.CurrentY = -0.02 * h
Me.Print "O"
Me.CurrentX = -0.1 * g
Me.CurrentY = 0.98 * h
Me.Print "y"
Me.CurrentY = -0.02 * g
Me.CurrentX = 0.95 * h
Me.Print "x"
Me.Line (0, h)-(0.1, 0.98 * h), QBColor(2)
Me.Line (0, h)-(-0.1, 0.98 * h), QBColor(2)
Me.Line (g, 0)-(0.98 * g, 0.1), QBColor(2)
Me.Line (g, 0)-(0.98 * g, -0.1), QBColor(2)
End Sub
热心网友
时间:2024-07-20 18:00
请教数学老师