Accueil > > > RÉSOLUTEUR DE SYSTÈME DE 2 ÉQUATIONS À 2 INCONNUES
RÉSOLUTEUR DE SYSTÈME DE 2 ÉQUATIONS À 2 INCONNUES
Information sur la source
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
Conclusion
Ben, il ne reste plus qu'à tracer la droite !
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2010 : PLAN DE MIGRATION VERS SHAREPOINT 2010TECHDAYS PARIS 2010 : PLAN DE MIGRATION VERS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Arnault Nouvel et Antoine Dongois Le processus à prendre : Apprendre (découvrir la plateforme) Préparer (documenter l'historique et choisir la méthode de MAJ) Test (Test de MAJ) Implémenter (Effectuer la MAJ) Valid...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2010 : LA PLEINIèRE DU SECOND JOURTECHDAYS PARIS 2010 : LA PLEINIèRE DU SECOND JOUR par ROMELARD Fabrice
Après un retour sur l'histoire des TechDays de Paris et le fait que ce soit le plus gros event MS au monde (du fait de sa gratuité), le président de MS France (Eric Boustoullier) a fait une présentation de la vision Microsoft pour les années à venir...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Forum
RE : TEMPS REEL RE : TEMPS REEL par ucfoutu
Cliquez pour lire la suite par ucfoutu
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|