Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

Test

David Aubert

XLDnaute Barbatruc
Administrateur
Modérateur
VB:
Private Sub Solve_Click()
Dim a, b, c, d, m, n As Integer
Dim x, y As Double

a = Val(Txt_a.Text)
b = Val(Txt_b.Text)
m = Val(Txt_m.Text)
c = Val(Txt_c.Text)
d = Val(Txt_d.Text)
n = Val(Txt_n.Text)
x = (b * n - d * m) / (b * c - a * d)
y = (a * n - c * m) / (a * d - b * c)
Lbl_x.Caption = Round(x, 2)
Lbl_y.Caption = Round(y, 2)

End Sub

' To get new equations

Private Sub New_Click()
Txt_a.Text = ""
Txt_b.Text = ""
Txt_m.Text = ""
Txt_c.Text = ""
Txt_d.Text = ""
Txt_n.Text = ""
Lbl_x.Caption = ""
Lbl_y.Caption = ""

End Sub
 

David Aubert

XLDnaute Barbatruc
Administrateur
Modérateur
Code:
Dim a, b, c, d As Integer
Dim x As Double

Private Function f(x As Variant)
' Need to make some transformation as the left coordinates in VB start from left
' our graph starts from center
f = a * (5 - x) ^ 3 + b * (5 - x) ^ 2 + c * (5 - x) + d

End Function

Private Sub cmd_Clear_Click()
pic_graph.Cls
txt_a.Text = ""
txt_b.Text = ""
txt_c.Text = ""
txt_d.Text = ""
End Sub

Private Sub cmd_draw_Click()
Dim y As Double
Dim w As Double

a = Val(txt_a.Text)
b = Val(txt_b.Text)
c = Val(txt_c.Text)
d = Val(txt_d.Text)
'Using a scale of 0.5 cm to represent i unit to draw the graph
' Need to make some transformation as the coordinates in VB start from top left
For w = 0 To 10 Step 0.0001
y = f(w)
pic_graph.PSet (w, 5 - y)

Next w

End Sub
 

David Aubert

XLDnaute Barbatruc
Administrateur
Modérateur
Code:
Dim a, b, c, d As Integer
Dim x As Double

Private Function f(x As Variant)
' Need to make some transformation as the left coordinates in VB start from left
' our graph starts from center
f = a * (5 - x) ^ 3 + b * (5 - x) ^ 2 + c * (5 - x) + d

End Function

Private Sub cmd_Clear_Click()
pic_graph.Cls
txt_a.Text = ""
txt_b.Text = ""
txt_c.Text = ""
txt_d.Text = ""
End Sub

Private Sub cmd_draw_Click()
Dim y As Double
Dim w As Double

a = Val(txt_a.Text)
b = Val(txt_b.Text)
c = Val(txt_c.Text)
d = Val(txt_d.Text)
'Using a scale of 0.5 cm to represent i unit to draw the graph
' Need to make some transformation as the coordinates in VB start from top left
For w = 0 To 10 Step 0.0001
y = f(w)
pic_graph.PSet (w, 5 - y)

Next w

End Sub
 

David Aubert

XLDnaute Barbatruc
Administrateur
Modérateur
[vb]Dim a, b, c, d As Integer
Dim x As Double

Private Function f(x As Variant)
' Need to make some transformation as the left coordinates in VB start from left
' our graph starts from center
f = a * (5 - x) ^ 3 + b * (5 - x) ^ 2 + c * (5 - x) + d

End Function

Private Sub cmd_Clear_Click()
pic_graph.Cls
txt_a.Text = ""
txt_b.Text = ""
txt_c.Text = ""
txt_d.Text = ""
End Sub

Private Sub cmd_draw_Click()
Dim y As Double
Dim w As Double

a = Val(txt_a.Text)
b = Val(txt_b.Text)
c = Val(txt_c.Text)
d = Val(txt_d.Text)
'Using a scale of 0.5 cm to represent i unit to draw the graph
' Need to make some transformation as the coordinates in VB start from top left
For w = 0 To 10 Step 0.0001
y = f(w)
pic_graph.PSet (w, 5 - y)

Next w

End Sub[/vb]
 

David Aubert

XLDnaute Barbatruc
Administrateur
Modérateur
VB:
Dim a, b, c, d As Integer
Dim x As Double

Private Function f(x As Variant)
' Need to make some transformation as the left coordinates in VB start from left
' our graph starts from center
f = a * (5 - x) ^ 3 + b * (5 - x) ^ 2 + c * (5 - x) + d

End Function

Private Sub cmd_Clear_Click()
pic_graph.Cls
txt_a.Text = ""
txt_b.Text = ""
txt_c.Text = ""
txt_d.Text = ""
End Sub

Private Sub cmd_draw_Click()
Dim y As Double
Dim w As Double

a = Val(txt_a.Text)
b = Val(txt_b.Text)
c = Val(txt_c.Text)
d = Val(txt_d.Text)
'Using a scale of 0.5 cm to represent i unit to draw the graph
' Need to make some transformation as the coordinates in VB start from top left
For w = 0 To 10 Step 0.0001
y = f(w)
pic_graph.PSet (w, 5 - y)

Next w

End Sub
 
Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…