请问如何用VB画波形图
1个回答
展开全部
设定波形的周期,幅值,波数,用数学的公式就可以画图形了
等下给个例子
Dim T As Single, A As Single, n As Integer
T = Val(Text1) '周期
A = Val(Text2) '幅值
n = Val(Text3) '波数
Picture1.Cls
Picture1.Scale (-0.1 * T * n, 1.1 * A)-(1.1 * (T * n), -1.1 * A)
Picture1.Line (-0.1 * T * n, 0)-(1.1 * T * n, 0)
Picture1.Line (0, 1.1 * A)-(0, -1.1 * A)
For i = 0 To Val(Text3) - 1
Picture1.Line (i * T, 0)-(i * T, A)
Picture1.Line -(T / 2 + i * T, A)
Picture1.Line -(T / 2 + i * T, -A)
Picture1.Line -(T + i * T, -A)
Picture1.Line -(T + i * T, 0)
Next
等下给个例子
Dim T As Single, A As Single, n As Integer
T = Val(Text1) '周期
A = Val(Text2) '幅值
n = Val(Text3) '波数
Picture1.Cls
Picture1.Scale (-0.1 * T * n, 1.1 * A)-(1.1 * (T * n), -1.1 * A)
Picture1.Line (-0.1 * T * n, 0)-(1.1 * T * n, 0)
Picture1.Line (0, 1.1 * A)-(0, -1.1 * A)
For i = 0 To Val(Text3) - 1
Picture1.Line (i * T, 0)-(i * T, A)
Picture1.Line -(T / 2 + i * T, A)
Picture1.Line -(T / 2 + i * T, -A)
Picture1.Line -(T + i * T, -A)
Picture1.Line -(T + i * T, 0)
Next
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询