急求解法,帮帮忙啊,我初学者
Dim xw As Single '初试相位
Dim zf As Single '振幅
Dim zq As Single '周期
Dim x As Byte
Dim g As Graphics
xw = TextBox3.Text
zq = TextBox1.Text
zf = TextBox2.Text
g = Label1.CreateGraphics
Dim p As New Pen(Color.Blue)
Dim f As New Font("楷体", 10, FontStyle.Bold)
Dim SB As New SolidBrush(Color.Black)
Dim X1, X2, Y1, Y2, I, J, A, B As Single
A = Label1.Width / 2 : B = Label1.Height / 2
g.TranslateTransform(A, B)
g.DrawLine(p, -A, 0, A, 0)
g.DrawLine(p, 0, -B, 0, B)
For I = -8 To 8 '这里换有一点问题
J = 40 * I
g.DrawLine(p, J, 0, J, -10)
g.DrawString(I, f, SB, J - 4, 5)
Next I
For I = -3.14159 To 3.14159 Step xw
X1 = I * 40 '这里要求输入振幅,周期,初试相位
Y1 = -zf * Sin(((2 * I) / zq) * x) * 40 '然后自动绘图
X2 = (I + xw) * 40 '我就是这里出问题拉
Y2 = -zf * Sin(((2 * I) / zq) * x + xw) * 40 '
g.DrawLine(p, X1, Y1, X2, Y2)
Next I
g.DrawString("Y = SIN(X)", f, SB, 10, 10 - B)
f.Dispose() : SB.Dispose() : p.Dispose() : g.Dispose()
y=Asin(wx+q )?
A为振幅
(2 *pi)/w为周期 pi=301415926
wx+q 为相位
q 为初相