- 1、本文档共23页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
用vb实现利用三次样条插值函数进行编程
用vb实现利用三次样条插值函数进行编程
问题内容:
要求输入节点数,节点值与端点二阶导数,能获得屏幕输出插值函数表达式
网友 cz5360 于 提问
最佳回答:
vb三次样条插值函数绘图
Dim X(1000) As Single, Y(1000) As Single
Dim u1(0 To 80000) As Single, v1(0 To 80000) As Single
Dim num As Long
Dim t As Integer
Private Declare Sub Sleep Lib kernel32 (ByVal dwMilliseconds As Long)
Dim de As Integer
Dim ToInit As Boolean
Dim DownX As Single, DownY As Single
Sub Drawposi(Index As Integer)
Me.Picture1.ForeColor = 0
Me.Picture1.Line (0, Y(Index))-(1024, Y(Index))
Me.Picture1.Line (X(Index), 0)-(X(Index), 770)
End Sub
Function hypot(ByVal X As Single, ByVal Y As Single)
hypot = Sqr(X ^ 2 + Y ^ 2)
End Function
Sub MovePic(Index As Integer)
Dim i As Integer
X(Index) = Picture2(Index).Left + 4
Y(Index) = Picture2(Index).Top + 4
lblX.Caption = X: + CStr(CInt(X(Index)))
lblY.Caption = Y: + CStr(CInt(Y(Index)))
lblX.Refresh
lblY.Refresh
Me.Picture1.Cls
Me.Picture1.ForeColor = QBColor(10)
For i = 0 To t - 1
Me.Picture1.CurrentX = X(i) + 4
Me.Picture1.CurrentY = Y(i) + 4
Me.Picture1.Print i
Next i
End Sub
Private Sub Command1_Click()
Dim i As Long
Picture1.Scale (0, 0)-(640, 550)
DrawWidth = 3
Picture1.Cls
If Check1.Value Then Command2_Click
X(0) = 1
Y(0) = 1
X(t - 1) = 638
Y(t - 1) = 548
Picture1.ForeColor = QBColor(10)
For i = 0 To t - 1
Picture1.Line (X(i) - 1, Y(i) - 1)-(X(i) + 1, Y(i) + 1), QBColor(10), B
Picture1.Print i
Next i
Picture1.ForeColor = QBColor(12)
DrawWidth = 1
tspLine t - 1, 2, 0, 0, 0, 0
Picture1.PSet (u1(0), v1(0))
For i = 1 To num - 1
Picture1.Line -(u1(i), v1(i))
For de = 1 To 12000: Next de Sleep 1
Next i
Picture1.ForeColor = QBColor(10)
For i = 0 To t - 1
Picture1.Line (X(i) - 1, Y(i) - 1)-(X(i) + 1, Y(i) + 1), QBColor(10), B
Picture1.Print i
Next i
End Sub
Private Sub Command2_Click()
Dim i As Integer
Randomize Timer
ToInit = Not ToInit
If ToInit Then
Me.Command1.Enabled = False
Me.Command2.Caption = 结束初始化
文档评论(0)