Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

RÉSOLUTEUR DE SYSTÈME DE 2 ÉQUATIONS À 2 INCONNUES


Information sur la source

Catégorie :Maths Niveau : Débutant Date de création : 18/06/2002 Date de mise à jour : 18/06/2002 16:45:30 Vu / téléchargé: 2 611 / 162

Note :
1,5 / 10 - par 2 personnes
1,50 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10

Commentaire sur cette source (6)
Ajouter un commentaire et/ou une note


Description

Bah, ça résoud un système d'équations à 2 inconnues avec la méthode apprise en classe de 3è !
Source en VB 3 mais compatible VB 6.
Le ZIP contient :
- la feuille (présentée ci-dessous)
- le module (idem)
- le fichier FRX (l'icone)
- l'icone
- l'EXE
- le projet .MAK
taille : 6,32 Ko (2 sec max)
 

Source

  • MODULE :
  • Option Explicit
  • Sub CenterForm (x As Form)
  • centerformtop x
  • centerformleft x
  • End Sub
  • Sub centerformleft (x As Form)
  • x.Left = screen.Width / 2 - x.Width / 2
  • End Sub
  • Sub centerformtop (x As Form)
  • x.Top = (screen.Height * .9) / 2 - x.Height / 2
  • End Sub
  • Fichier FRM :
  • VERSION 2.00
  • Begin Form Feuille1
  • BackColor = &H8000000F&
  • BorderStyle = 3 'Trait double fixe
  • Caption = "Résoluteur de système de deux équations à deux inconnues"
  • ClientHeight = 3555
  • ClientLeft = 2070
  • ClientTop = 1875
  • ClientWidth = 5970
  • Height = 3960
  • Icon = FE1_1.FRX:0000
  • Left = 2010
  • LinkTopic = "Feuille1"
  • ScaleHeight = 237
  • ScaleMode = 3 'Pixel
  • ScaleWidth = 398
  • Top = 1530
  • Width = 6090
  • Begin Frame CadreSol
  • BackColor = &H8000000F&
  • Caption = "Solutions"
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 1545
  • Left = 90
  • TabIndex = 0
  • Top = 1890
  • Width = 5775
  • Begin Label lblfraz
  • AutoSize = -1 'True
  • BackStyle = 0 'Transparent
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 195
  • Left = 180
  • TabIndex = 1
  • Top = 990
  • Width = 5415
  • WordWrap = -1 'True
  • End
  • Begin Label lbly
  • AutoSize = -1 'True
  • BackStyle = 0 'Transparent
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 195
  • Left = 180
  • TabIndex = 2
  • Top = 630
  • Width = 45
  • End
  • Begin Label lblx
  • AutoSize = -1 'True
  • BackStyle = 0 'Transparent
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 195
  • Left = 180
  • TabIndex = 3
  • Top = 360
  • Width = 45
  • End
  • End
  • Begin Frame CadreCmd
  • BackColor = &H8000000F&
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 1545
  • Left = 4140
  • TabIndex = 14
  • Top = 90
  • Width = 1725
  • Begin CommandButton CmdGraph
  • Caption = "&Tracer"
  • Enabled = 0 'False
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 375
  • Left = 270
  • TabIndex = 16
  • Top = 900
  • Width = 1185
  • End
  • Begin CommandButton CmdRes
  • Caption = "&Résoudre"
  • Default = -1 'True
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 375
  • Left = 270
  • TabIndex = 15
  • Top = 270
  • Width = 1185
  • End
  • End
  • Begin Frame CadreSys
  • BackColor = &H8000000F&
  • Caption = "Système"
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 1545
  • Left = 90
  • TabIndex = 4
  • Top = 90
  • Width = 3705
  • Begin TextBox txtc
  • Alignment = 1 'Justifié à droite
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 285
  • Index = 1
  • Left = 2610
  • TabIndex = 12
  • Top = 990
  • Width = 555
  • End
  • Begin TextBox txtb
  • Alignment = 1 'Justifié à droite
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 285
  • Index = 1
  • Left = 1710
  • TabIndex = 11
  • Top = 990
  • Width = 555
  • End
  • Begin TextBox txta
  • Alignment = 1 'Justifié à droite
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 285
  • Index = 1
  • Left = 720
  • TabIndex = 10
  • Top = 990
  • Width = 555
  • End
  • Begin TextBox txtc
  • Alignment = 1 'Justifié à droite
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 285
  • Index = 0
  • Left = 2610
  • TabIndex = 8
  • Top = 360
  • Width = 555
  • End
  • Begin TextBox txtb
  • Alignment = 1 'Justifié à droite
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 285
  • Index = 0
  • Left = 1710
  • TabIndex = 7
  • Top = 360
  • Width = 555
  • End
  • Begin TextBox txta
  • Alignment = 1 'Justifié à droite
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 8.25
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 285
  • Index = 0
  • Left = 720
  • TabIndex = 6
  • Top = 360
  • Width = 555
  • End
  • Begin Label lblfnd
  • AutoSize = -1 'True
  • BackStyle = 0 'Transparent
  • Caption = "x + y ="
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 9.75
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 240
  • Index = 1
  • Left = 1350
  • TabIndex = 13
  • Top = 1020
  • Width = 1215
  • End
  • Begin Label lblfnd
  • AutoSize = -1 'True
  • BackStyle = 0 'Transparent
  • Caption = "x + y ="
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "MS Sans Serif"
  • FontSize = 9.75
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 240
  • Index = 0
  • Left = 1350
  • TabIndex = 9
  • Top = 390
  • Width = 1215
  • End
  • Begin Label lbl
  • AutoSize = -1 'True
  • BackStyle = 0 'Transparent
  • Caption = "{"
  • FontBold = 0 'False
  • FontItalic = 0 'False
  • FontName = "Times New Roman"
  • FontSize = 48
  • FontStrikethru = 0 'False
  • FontUnderline = 0 'False
  • Height = 1095
  • Index = 0
  • Left = 180
  • TabIndex = 5
  • Top = 180
  • Width = 465
  • End
  • End
  • End
  • Option Explicit
  • Sub BonneValeur (TB As TextBox)
  • TB = IIf(TB = "", 1, Val(TB))
  • End Sub
  • Sub CmdRes_Click ()
  • On Error GoTo Err_CmdRes_Click
  • Dim i%
  • For i = 0 To 1
  • BonneValeur Txta(i)
  • BonneValeur Txtb(i)
  • BonneValeur Txtc(i)
  • Next
  • Dim valx#, valy#, tmp%, mul0#, mul1#
  • mul0 = Val(Txtb(1))
  • mul1 = Val(Txtb(0))
  • mul0 = IIf(mul0 < 0 Eqv mul1 < 0, -mul0, mul0)
  • valx = (Val(Txtc(0)) * mul0 + Val(Txtc(1)) * mul1) / (Val(Txta(0)) * mul0 + Val(Txta(1)) * mul1)
  • valy = (Val(Txtc(0)) - Val(Txta(0)) * valx) / Val(Txtb(0))
  • lblx = "x = " & valx
  • lbly = "y = " & valy
  • lblfraz = "Le couple (" & valx & ";" & valy & ") est solution du système."
  • Exit Sub
  • Err_CmdRes_Click:
  • lblx = ""
  • lbly = ""
  • lblfraz = "Erreur n° " & Err
  • Select Case Err
  • Case 6
  • lblfraz = lblfraz & " : dépassement de capacités"
  • Case 11
  • lblfraz = lblfraz & " : impossible de résoudre"
  • End Select
  • Exit Sub
  • End Sub
  • Sub Form_Load ()
  • CenterForm Me
  • End Sub
MODULE :

Option Explicit

Sub CenterForm (x As Form)
    centerformtop x
    centerformleft x
End Sub

Sub centerformleft (x As Form)
    x.Left = screen.Width / 2 - x.Width / 2
End Sub

Sub centerformtop (x As Form)
    x.Top = (screen.Height * .9) / 2 - x.Height / 2
End Sub


Fichier FRM :

VERSION 2.00
Begin Form Feuille1 
   BackColor       =   &H8000000F&
   BorderStyle     =   3  'Trait double fixe
   Caption         =   "Résoluteur de système de deux équations à deux inconnues"
   ClientHeight    =   3555
   ClientLeft      =   2070
   ClientTop       =   1875
   ClientWidth     =   5970
   Height          =   3960
   Icon            =   FE1_1.FRX:0000
   Left            =   2010
   LinkTopic       =   "Feuille1"
   ScaleHeight     =   237
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   398
   Top             =   1530
   Width           =   6090
   Begin Frame CadreSol 
      BackColor       =   &H8000000F&
      Caption         =   "Solutions"
      FontBold        =   0   'False
      FontItalic      =   0   'False
      FontName        =   "MS Sans Serif"
      FontSize        =   8.25
      FontStrikethru  =   0   'False
      FontUnderline   =   0   'False
      Height          =   1545
      Left            =   90
      TabIndex        =   0
      Top             =   1890
      Width           =   5775
      Begin Label lblfraz 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   8.25
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   195
         Left            =   180
         TabIndex        =   1
         Top             =   990
         Width           =   5415
         WordWrap        =   -1  'True
      End
      Begin Label lbly 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   8.25
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   195
         Left            =   180
         TabIndex        =   2
         Top             =   630
         Width           =   45
      End
      Begin Label lblx 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   8.25
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   195
         Left            =   180
         TabIndex        =   3
         Top             =   360
         Width           =   45
      End
   End
   Begin Frame CadreCmd 
      BackColor       =   &H8000000F&
      FontBold        =   0   'False
      FontItalic      =   0   'False
      FontName        =   "MS Sans Serif"
      FontSize        =   8.25
      FontStrikethru  =   0   'False
      FontUnderline   =   0   'False
      Height          =   1545
      Left            =   4140
      TabIndex        =   14
      Top             =   90
      Width           =   1725
      Begin CommandButton CmdGraph 
         Caption         =   "&Tracer"
         Enabled         =   0   'False
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   8.25
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   375
         Left            =   270
         TabIndex        =   16
         Top             =   900
         Width           =   1185
      End
      Begin CommandButton CmdRes 
         Caption         =   "&Résoudre"
         Default         =   -1  'True
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   8.25
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   375
         Left            =   270
         TabIndex        =   15
         Top             =   270
         Width           =   1185
      End
   End
   Begin Frame CadreSys 
      BackColor       =   &H8000000F&
      Caption         =   "Système"
      FontBold        =   0   'False
      FontItalic      =   0   'False
      FontName        =   "MS Sans Serif"
      FontSize        =   8.25
      FontStrikethru  =   0   'False
      FontUnderline   =   0   'False
      Height          =   1545
      Left            =   90
      TabIndex        =   4
      Top             =   90
      Width           =   3705
      Begin TextBox txtc 
         Alignment       =   1  'Justifié à droite
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   8.25
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   285
         Index           =   1
         Left            =   2610
         TabIndex        =   12
         Top             =   990
         Width           =   555
      End
      Begin TextBox txtb 
         Alignment       =   1  'Justifié à droite
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   8.25
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   285
         Index           =   1
         Left            =   1710
         TabIndex        =   11
         Top             =   990
         Width           =   555
      End
      Begin TextBox txta 
         Alignment       =   1  'Justifié à droite
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   8.25
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   285
         Index           =   1
         Left            =   720
         TabIndex        =   10
         Top             =   990
         Width           =   555
      End
      Begin TextBox txtc 
         Alignment       =   1  'Justifié à droite
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   8.25
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   285
         Index           =   0
         Left            =   2610
         TabIndex        =   8
         Top             =   360
         Width           =   555
      End
      Begin TextBox txtb 
         Alignment       =   1  'Justifié à droite
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   8.25
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   285
         Index           =   0
         Left            =   1710
         TabIndex        =   7
         Top             =   360
         Width           =   555
      End
      Begin TextBox txta 
         Alignment       =   1  'Justifié à droite
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   8.25
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   285
         Index           =   0
         Left            =   720
         TabIndex        =   6
         Top             =   360
         Width           =   555
      End
      Begin Label lblfnd 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "x  +               y ="
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   9.75
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   240
         Index           =   1
         Left            =   1350
         TabIndex        =   13
         Top             =   1020
         Width           =   1215
      End
      Begin Label lblfnd 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "x  +               y ="
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "MS Sans Serif"
         FontSize        =   9.75
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   240
         Index           =   0
         Left            =   1350
         TabIndex        =   9
         Top             =   390
         Width           =   1215
      End
      Begin Label lbl 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "{"
         FontBold        =   0   'False
         FontItalic      =   0   'False
         FontName        =   "Times New Roman"
         FontSize        =   48
         FontStrikethru  =   0   'False
         FontUnderline   =   0   'False
         Height          =   1095
         Index           =   0
         Left            =   180
         TabIndex        =   5
         Top             =   180
         Width           =   465
      End
   End
End
Option Explicit

Sub BonneValeur (TB As TextBox)
TB = IIf(TB = "", 1, Val(TB))
End Sub

Sub CmdRes_Click ()

On Error GoTo Err_CmdRes_Click

Dim i%
For i = 0 To 1
    BonneValeur Txta(i)
    BonneValeur Txtb(i)
    BonneValeur Txtc(i)
Next

Dim valx#, valy#, tmp%, mul0#, mul1#

mul0 = Val(Txtb(1))
mul1 = Val(Txtb(0))
mul0 = IIf(mul0 < 0 Eqv mul1 < 0, -mul0, mul0)

valx = (Val(Txtc(0)) * mul0 + Val(Txtc(1)) * mul1) / (Val(Txta(0)) * mul0 + Val(Txta(1)) * mul1)
valy = (Val(Txtc(0)) - Val(Txta(0)) * valx) / Val(Txtb(0))

lblx = "x = " & valx
lbly = "y = " & valy
lblfraz = "Le couple (" & valx & ";" & valy & ") est solution du système."

Exit Sub
Err_CmdRes_Click:
lblx = ""
lbly = ""
lblfraz = "Erreur n° " & Err
Select Case Err
  Case 6
    lblfraz = lblfraz & " : dépassement de capacités"
  Case 11
    lblfraz = lblfraz & " : impossible de résoudre"
End Select
Exit Sub
End Sub

Sub Form_Load ()
CenterForm Me
End Sub

Conclusion

Ben, il ne reste plus qu'à tracer la droite !
 

Fichier Zip

Pour les "Membres Club", vous pouvez télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip

Commentaires et avis

signaler à un administrateur
Commentaire de Lightness1024! le 19/06/2002 18:41:18

résoluteur....

signaler à un administrateur
Commentaire de mehdibou le 20/06/2002 17:43:01

c'est koi ces pts de suspension,
ça résoud pas ???
Faut m'le dire dans ce cas

signaler à un administrateur
Commentaire de squalyl le 21/06/2002 11:15:28

c un solveur je crois...
Et puis à la limite on fait ça de tête...

signaler à un administrateur
Commentaire de mehdibou le 22/06/2002 15:49:48

Ouais, je sais que c'est un solveur, mais je trouvais que "résoluteur", ça sonnait mieux !
Et puis, essaies de me résoudre de tête en moins de 10 secondes (c'est le temps qu'il faut pourrentrer les nombres) :
/ 45672x+3y=-181917
12876x+666y=119658
solution : (-4;257)
Alors, t'as réussi ?

signaler à un administrateur
Commentaire de Xaderlane le 06/07/2005 13:50:57

code pas tres commente.

essai avec le systeme :
3x + 2y = 6
4x - 3y = 7

ton resolutationateur (moi je trouve que ca sonne mieux comme ca...) me trouve le couple (4;-3), il y a encore des progres a faire ;)

signaler à un administrateur
Commentaire de mehdibou le 06/07/2005 16:30:46

Ca fait plus de trois ans que cette source aurait dû être supprimée..
Que de temps a passé depuis

Désolé mais je n'assure plus le support sur les produits de plus de 2 ans n'ayant pas été mis à jour ;)

Ajouter un commentaire



Nos sponsors

Sondage...

CalendriCode

Juillet 2009
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
2728293031  

Consulter la suite du CalendriCode

Comparez les prix Nouvelle version

Photothèque Nouveau !



Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés
Temps d'éxécution de la page : 0,312 sec

Google Coop CodeS-SourceS Google Coop CodeS-SourceS


Certaines images présentes sur le site (notament certains avatars) sont issues des collections IconShock, donc si vous souhaitez utiliser ces icons vous devez les acheter, ne les copiez pas et ne utilisez pas dans vos sites et applications sans les avoir commandé.