1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
Public Class frmBissection
Private fa, fb As Double
Private xa, xb As Double
Private Niter As Integer
Public Sub New()
' Cet appel est requis par le concepteur.
InitializeComponent()
' Ajoutez une initialisation quelconque après l'appel InitializeComponent().
Me.Size = New Size(600, 500)
Button1.Location = New Point(25, 50)
lblFa.Location = New Point(150, 50)
lblFb.Location = New Point(250, 50)
lblResult.Location = New Point(350, 50)
TextBoxIterations.Location = New Point(25, 100)
TextBoxIterations.Size = New Size(500, 300)
TextBoxIterations.Multiline = True
TextBoxIterations.ScrollBars = ScrollBars.Both
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
xa = -0 : xb = 1.0 : Niter = 100
fa = Dichotomie.FN(xa)
fb = Dichotomie.FN(xb)
lblFa.Text = fa.ToString
lblFb.Text = fb.ToString
If fa * fb > 0 Then ' C'EST ICI QUE L'ALGO DICHOTOMIE PEUT DIVERGER
MsgBox("possibilite de divergence ...diminuer l'intervalle x1,x2 ...!!!")
Else
MsgBox("Converge assuree dans l'intervalle x1,x2 ...!!!")
Dichotomie.Bissection(xa, xb, Niter)
lblResult.Text = Dichotomie.r.ToString
TextBoxIterations.Text = Dichotomie.sb.ToString
End If
End Sub
End Class |
Partager