📄 math.frm
字号:
Height = 240
Index = 14
Left = 1620
TabIndex = 53
Top = 1260
Width = 315
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "x +"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 13
Left = 750
TabIndex = 52
Top = 1260
Width = 300
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "w ="
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 12
Left = 3420
TabIndex = 51
Top = 840
Width = 345
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "z +"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 11
Left = 2490
TabIndex = 50
Top = 840
Width = 300
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "y +"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 10
Left = 1620
TabIndex = 49
Top = 840
Width = 315
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "x +"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 9
Left = 750
TabIndex = 48
Top = 840
Width = 300
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "w ="
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 8
Left = 3420
TabIndex = 47
Top = 420
Width = 345
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "z +"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 7
Left = 2490
TabIndex = 46
Top = 420
Width = 300
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "y +"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 6
Left = 1620
TabIndex = 45
Top = 420
Width = 315
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "x +"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 0
Left = 750
TabIndex = 44
Top = 420
Width = 300
End
End
Begin VB.Frame fraFrame
Caption = "Integral"
Height = 1335
Index = 1
Left = 135
TabIndex = 38
Top = 1545
Width = 7065
Begin VB.TextBox txtIntegral
BackColor = &H8000000F&
Height = 300
Left = 5265
Locked = -1 'True
TabIndex = 7
TabStop = 0 'False
Top = 480
Width = 1635
End
Begin VB.CommandButton cmdIntegral
Caption = "Integral"
Height = 360
Left = 5580
TabIndex = 8
Top = 870
Width = 1320
End
Begin VB.TextBox txtTo
Height = 300
Left = 4320
TabIndex = 6
Text = "2"
Top = 480
Width = 825
End
Begin VB.TextBox txtFrom
Height = 300
Left = 3420
TabIndex = 5
Text = "0"
Top = 480
Width = 825
End
Begin VB.TextBox txtIntegralFunc
Height = 300
Left = 135
TabIndex = 4
Text = "5 * x^4"
Top = 480
Width = 3210
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "To"
Height = 195
Index = 5
Left = 4320
TabIndex = 42
Top = 255
Width = 195
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "From"
Height = 195
Index = 4
Left = 3420
TabIndex = 41
Top = 255
Width = 345
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Function"
Height = 195
Index = 3
Left = 135
TabIndex = 39
Top = 255
Width = 615
End
End
Begin VB.Frame fraFrame
Caption = "Derivate"
Height = 1350
Index = 0
Left = 135
TabIndex = 0
Top = 180
Width = 7065
Begin VB.CommandButton cmdDerivate
Caption = "Derivate"
Height = 330
Left = 2970
TabIndex = 2
Top = 885
Width = 1320
End
Begin VB.ListBox lstDerivates
BackColor = &H8000000F&
Height = 840
Left = 4380
TabIndex = 3
TabStop = 0 'False
Top = 390
Width = 2535
End
Begin VB.TextBox txtDerivateValue
Height = 300
Left = 3465
TabIndex = 1
Text = "0"
Top = 480
Width = 825
End
Begin VB.TextBox txtDerivateFunc
Height = 300
Left = 135
TabIndex = 40
Text = "2 * x^4 + x^3 + 2 * x^2 + 1"
Top = 480
Width = 3210
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Value"
Height = 195
Index = 2
Left = 3465
TabIndex = 37
Top = 255
Width = 405
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Function"
Height = 195
Index = 1
Left = 135
TabIndex = 36
Top = 255
Width = 615
End
End
Begin FLWGraphMath.FWMath objMath
Left = 30
Top = 0
_ExtentX = 820
_ExtentY = 820
End
End
Attribute VB_Name = "frmMath"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdDerivate_Click()
Dim dblValue As Double
Call lstDerivates.Clear
dblValue = objMath.Derivate(txtDerivateFunc, txtDerivateValue, 1)
Call lstDerivates.AddItem("1st derivate: " & dblValue)
If objMath.Error.Number <> 0 Then
Call MsgBox("Error calculating 1st derivate. Return Value not valid.")
End If
dblValue = objMath.Derivate(txtDerivateFunc, txtDerivateValue, 2)
Call lstDerivates.AddItem("2nd derivate: " & dblValue)
If objMath.Error.Number <> 0 Then
Call MsgBox("Error calculating 2nd derivate. Return Value not valid.")
End If
dblValue = objMath.Derivate(txtDerivateFunc, txtDerivateValue, 3)
Call lstDerivates.AddItem("3rd derivate: " & dblValue)
If objMath.Error.Number <> 0 Then
Call MsgBox("Error calculating 3rd derivate. Return Value not valid.")
End If
End Sub
Private Sub cmdIntegral_Click()
txtIntegral = objMath.Integral(txtIntegralFunc, txtFrom, txtTo)
If objMath.Error.Number <> 0 Then
Call MsgBox("Error calculating integral. Return Value not valid.")
End If
End Sub
Private Sub cmdSolutions_Click()
Dim objEquations As New FLWGraphMath.IFWMathEquations
Dim objEquation As FLWGraphMath.IFWMathEquation
Dim lngInd As Long
Call lstSolutions.Clear
Set objEquation = objEquations.Add
objEquation.Value("x") = txtX(1)
objEquation.Value("y") = txtY(1)
objEquation.Value("z") = txtZ(1)
objEquation.Value("w") = txtW(1)
objEquation.Result = txtR(1)
Set objEquation = objEquations.Add
objEquation.Value("x") = txtX(2)
objEquation.Value("y") = txtY(2)
objEquation.Value("z") = txtZ(2)
objEquation.Value("w") = txtW(2)
objEquation.Result = txtR(2)
Set objEquation = objEquations.Add
objEquation.Value("x") = txtX(3)
objEquation.Value("y") = txtY(3)
objEquation.Value("z") = txtZ(3)
objEquation.Value("w") = txtW(3)
objEquation.Result = txtR(3)
Set objEquation = objEquations.Add
objEquation.Value("x") = txtX(4)
objEquation.Value("y") = txtY(4)
objEquation.Value("z") = txtZ(4)
objEquation.Value("w") = txtW(4)
objEquation.Result = txtR(4)
If objMath.LinealSystems(objEquations, "x", "y", "z", "w") Then
For Each objEquation In objEquations
lngInd = lngInd + 1
Call lstSolutions.AddItem(lngInd & " Solution: " & _
objEquation.Solution)
Next
Else
Call MsgBox("Error calculating solutions...", vbExclamation)
End If
End Sub
Private Sub cmdRoots_Click()
Dim lngInd As Long
Dim lngRoots As Long
Dim aRoots() As Double
lngRoots = objMath.Roots(txtRootExp, txtRootFrom, txtRootTo, aRoots())
Call lstRoots.Clear
If lngRoots Then
For lngInd = 1 To lngRoots
Call lstRoots.AddItem("Root(" & lngInd & ") = " & VBA.Format$(aRoots(lngInd), "0.00000"))
Next
Else
Call MsgBox("No roots found in (" & txtRootFrom & "," & txtRootTo & ")")
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -