You are on page 1of 3

METODO DE NEWTON

F ( X ) =aX +bX +cX + d


F ( X ) =3 aX 2+ 2bX + c

Xo=Xo

aX 3 +bX 2+ cX + D
3 aX 2 +2 bX +c

Codificacin del visual


Private Sub Command1_Click()
Dim a As Single, b As Single, c As Single, d As Single, x As Single
a = Text1.Text
b = Text2.Text
c = Text3.Text
d = Text4.Text
Text5.Text = 3 * a
Text6.Text = 2 * b
Text7.Text = c
Label6.Caption = "X^2"
Label8.Caption = "X"
Label5.Caption = "F(X)"
x = Text8.Text
End Sub

Private Sub Command2_Click()

Dim a As Single, b As Single, c As Single, d As Single, x As Single


a = Text1.Text
b = Text2.Text
c = Text3.Text
d = Text4.Text
x = Text8.Text
Text9.Text = ((a * x ^ 3) + (b * x ^ 2) + (c * x) + d) / ((3 * a * x ^ 2) + (2 * b
* x) + c)
If Text9.Text > 0.0001 Then
Text10.Text = ((a * (Text9.Text) ^ 3) + (b * (Text9.Text) ^ 2) + (c *
(Text9.Text)) + d) / ((3 * a * (Text9.Text) ^ 2) + (2 * b * (Text9.Text)) + c)

Label11.Caption = "interaccion 2"


Label15.Caption = "X2 = "
End If
If Text10.Text > 0.0001 Then
Text11.Text = ((a * (Text10.Text) ^ 3) + (b * (Text10.Text) ^ 2) + (c *
(Text10.Text)) + d) / ((3 * a * (Text10.Text) ^ 2) + (2 * b * (Text10.Text)) + c)
Label12.Caption = "interaccion 3"
Label16.Caption = "X3 = "
End If

If Text11.Text > 0.0001 Then

Text12.Text = ((a * (Text11.Text) ^ 3) + (b * (Text11.Text) ^ 2) + (c *


(Text11.Text)) + d) / ((3 * a * (Text11.Text) ^ 2) + (2 * b * (Text11.Text)) + c)
Label13.Caption = "interaccion 4"
Label17.Caption = "X4 = "
End If
Label10.Caption = "interaccion 1"
Label14.Caption = "X1 = "
End Sub

You might also like