, Visual C#


         

ByVal LevelCurves As Single, ByVal


' i = 0,1,2,3,...,N_x; j = 0,1,2,3,...,N_y:
Dim myArrayVB_2(20000, 1) As Single '- .
' myArrayVB_2:
Dim N_1_myArrayVB_2 As Integer
' :
Dim ii As Integer = -1
' f(x, y) = LevelCurves:
Private Sub PlotLevelCurve(ByVal g As Graphics, _
ByVal LevelCurves As Single, ByVal x_min As Single, _
ByVal x_max As Single, ByVal y_min As Single, _
ByVal y_max As Single, _
Optional ByVal step_size As Single = 0.1, _
Optional ByVal start_x As Single = 1.0, _
Optional ByVal start_y As Single = 1.0, _
Optional ByVal tolerance As Single = 0.02)
' :
Dim i, j As Integer
' 1- .
' 1- myArrayVB(i, j):
Dim N_x As Integer = 2000
Dim N_y As Integer = 1
' 1- myArrayVB(i, j) Single,
' i = 0,1,2,3,...,N_x; j = 0,1,2,3,...,N_y:
Dim myArrayVB(N_x, N_y) As Single '- .
' myArrayVB:
Dim N_1_myArrayVB As Integer
' :
Dim num_points As Integer
Dim x0 As Single : Dim y0 As Single
Dim x1 As Single : Dim y1 As Single
Dim x2 As Single : Dim y2 As Single
Dim dx As Single : Dim dy As Single
' (x0, y0) LevelCurves:
FindPointOnCurve(x0, y0, LevelCurves, _
start_x, start_y, tolerance)
' :
num_points = 1
' LevelCurves:
x2 = x0
y2 = y0
i = -1 ' .
' Do - Loop:
Do
x1 = x2
y1 = y2
' :
Gradient(x2, y2, dx, dy)