
Calculette : fait
Equation du second degré : fait
Equation simple : fait
Equation homographique: fait
Equation du troisième degré : A faire
La libraire sera régulièrement mis à jour.
Code:
*Equation du second degré
► Afficher le texte
Code : Tout sélectionner
#include <GUIConstants.au3>
#include <EditConstants.au3>
GUICreate("Equation du second degré", 240, 220, -1, -1)
$input1 = GUICtrlCreateInput("", 10, 10, 20, 16)
GUICtrlCreateLabel("x²", 30, 10)
$combo1 = GUICtrlCreateCombo("+", 45, 8, 30, 20)
GUICtrlSetData(-1, "-")
$input2 = GUICtrlCreateInput("", 80, 10, 20, 16,$ES_NUMBER)
GUICtrlCreateLabel("x", 100, 10)
$combo2= GUICtrlCreateCombo("+", 115, 8, 30, 20)
GUICtrlSetData(-1, "-")
$input3 = GUICtrlCreateInput("", 150, 10, 20, 16,$ES_NUMBER)
$button1 = GUICtrlCreateButton("Check", 185, 8)
GUICtrlCreateLabel("Exemple: 2x² + 5x + 7", 10, 40)
GUICtrlCreateLabel("Votre équation:", 10, 60)
$label1 = GUICtrlCreateLabel("", 85, 60, 100, 20)
$Edit = GUICtrlCreateedit("Solutions here", 10, 90, 220, 50)
$button2 = GUICtrlCreateButton("Find x", 95, 150, 55)
GUICtrlSetState($button2, $GUI_DISABLE)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
Exit
Case $nMsg = $button1
GUICtrlSetData($label1, GuiCtrlRead($input1)&"x² "&GuiCtrlRead($combo1)&" "&GuiCtrlRead($input2)&"x "&GuiCtrlRead($combo2)&" "&GuiCtrlRead($input3))
GUICtrlSetState($button2, $GUI_ENABLE)
Case $nMsg = $button2
$a=Number(GuiCtrlRead($input1))
$b=Number(GuiCtrlRead($combo1)&GuiCtrlRead($input2))
$c=Number(GuiCtrlRead($combo2)&GuiCtrlRead($input3))
If $a=0 Then
MsgBox(0,"Mauvais coeff","équation du 2eme degré éxigé")
ContinueLoop
EndIf
$delta = $b^2-4*$a*$c
If $delta > 0 Then
$final1 = (-$b+Sqrt($delta))/(2*$a)
$final2 = (-$b-Sqrt($delta))/(2*$a)
$Tmp = "x = "&$final1&@CRLF&"x= "&$final2
GUICtrlSetData($Edit, "")
GUICtrlSetData($Edit, $Tmp)
Elseif $delta = 0 Then
$final3 = -$b/(2*$a)
GUICtrlSetData($Edit, "")
GUICtrlSetData($Edit, "x = "&$final3)
Elseif $delta < 0 Then
GUICtrlSetData($Edit, "")
GUICtrlSetData($Edit, "Impossible to find 'x'")
Endif
EndSelect
WEnd
► Afficher le texte
Code : Tout sélectionner
#include <GUIConstants.au3>
#include <EditConstants.au3>
#include <String.au3>
GUICreate("Equation du premier degré", 240, 220, -1, -1)
$input1 = GUICtrlCreateInput("", 10, 10, 20, 16)
GUICtrlCreateLabel("x", 30, 10)
$combo1 = GUICtrlCreateCombo("+", 45, 8, 30, 20)
GUICtrlSetData(-1, "-")
$input2 = GUICtrlCreateInput("", 80, 10, 20, 16,$ES_NUMBER)
GUICtrlCreateLabel("=", 105, 10)
$input3 = GUICtrlCreateInput("", 120, 10, 20, 16)
$button1 = GUICtrlCreateButton("Check", 185, 8)
GUICtrlCreateLabel("Exemple: 2x + 4 = 6", 10, 40)
GUICtrlCreateLabel("Votre équation:", 10, 60)
$label1 = GUICtrlCreateLabel("", 85, 60, 100, 20)
$Edit = GUICtrlCreateedit("Solutions here", 10, 90, 220, 50)
$button2 = GUICtrlCreateButton("Find x", 95, 150, 55)
GUICtrlSetState($button2, $GUI_DISABLE)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
Exit
Case $nMsg = $button1
GUICtrlSetData($label1, GuiCtrlRead($input1)&"x "&GuiCtrlRead($combo1)&" "&GuiCtrlRead($input2)&" = "&GuiCtrlRead($input3))
GUICtrlSetState($button2, $GUI_ENABLE)
Case $nMsg = $button2
$a = GuiCtrlRead($input1)
If GuiCtrlRead($combo1) = "-" Then
$b = Execute(GuiCtrlRead($input3)+GuiCtrlRead($input2))
Else
$b = Execute(GuiCtrlRead($input3)-GuiCtrlRead($input2))
Endif
$x = Execute($b/$a)
$Tmp = "x = "&$x
GUICtrlSetData($Edit, "")
GUICtrlSetData($Edit, $Tmp)
EndSelect
WEnd
► Afficher le texte
Code : Tout sélectionner
#include <GUIConstants.au3>
#include <EditConstants.au3>
#include <String.au3>
GUICreate("Fonction homographique", 240, 420, -1, -1)
;*********************************************************************************
$input1 = GUICtrlCreateInput("", 10, 10, 20, 16)
GUICtrlCreateLabel("x", 33, 10)
$combo1 = GUICtrlCreateCombo("+", 45, 8, 30, 20)
GUICtrlSetData(-1, "-")
$input2 = GUICtrlCreateInput("", 80, 10, 20, 16,$ES_NUMBER)
;------------
GUICtrlCreatePic("images/barre.jpg", 10, 32, 90, 2)
;------------
$input3 = GUICtrlCreateInput("", 10, 40, 20, 16)
GUICtrlCreateLabel("x", 33, 40)
$combo2 = GUICtrlCreateCombo("+", 45, 38, 30, 20)
GUICtrlSetData(-1, "-")
$input4 = GUICtrlCreateInput("", 80, 40, 20, 16,$ES_NUMBER)
$button1 = GUICtrlCreateButton("Check", 185, 18)
;*********************************************************************************
GUICtrlCreateLabel("Exemple: 2x + 4", 10, 70)
;------------
GUICtrlCreatePic("images/barre.jpg", 55, 85, 30, 2)
;------------
GUICtrlCreateLabel("4x - 5", 56, 90)
;*********************************************************************************
GUICtrlCreateLabel("Votre équation:", 95, 70)
$label1 = GUICtrlCreateLabel("", 172, 70, 100, 20)
;------------
GUICtrlCreatePic("images/barre.jpg", 172, 85, 30, 2)
;------------
$label2 = GUICtrlCreateLabel("", 172, 90, 100, 20)
;*********************************************************************************
$Edit = GUICtrlCreateedit("Solutions here", 10, 120, 220, 200)
$button2 = GUICtrlCreateButton("Analyse", 95, 370, 55)
;*********************************************************************************
GUICtrlSetState($button2, $GUI_DISABLE)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
Exit
Case $nMsg = $button1
GUICtrlSetData($label1, GuiCtrlRead($input1)&"x "&GuiCtrlRead($combo1)&" "&GuiCtrlRead($input2))
GUICtrlSetData($label2, GuiCtrlRead($input3)&"x "&GuiCtrlRead($combo2)&" "&GuiCtrlRead($input4))
GUICtrlSetState($button2, $GUI_ENABLE)
Case $nMsg = $button2
;************************* CALCUL DE LA RECIPROQUE G *************************
$reciproque = "(-"&GuiCtrlRead($combo2)&GuiCtrlRead($input4)&"x + "&GuiCtrlRead($combo1)&GuiCtrlRead($input2)&")/("&GuiCtrlRead($input3)&"x - "&GuiCtrlRead($input1)&")"
;************************* DOM F *************************
If GuiCtrlRead($combo2) = "-" Then
$domf = Execute(GuiCtrlRead($input4)/GuiCtrlRead($input3))
Else
$domf = Execute(-GuiCtrlRead($input4)/GuiCtrlRead($input3))
Endif
;************************* DOM G *************************
If GuiCtrlRead($input1) > 0 Then
$domg = Execute(GuiCtrlRead($input1)/GuiCtrlRead($input3))
Else
$domg = Execute(-GuiCtrlRead($input1)/GuiCtrlRead($input3))
Endif
;************************* IM F *************************
$imf = $domg
;************************* IM F *************************
$img = $domf
;************************* Intersection Axe X pour f *************************
;(?;0) => ($axeX;0)
If GuiCtrlRead($combo1) = "-" Then
$var1= GuiCtrlRead($input2)&"/"&GuiCtrlRead($input1)
$axeXf = "("&$var1&";0)"
Else
$var2 = -GuiCtrlRead($input2)&"/"&GuiCtrlRead($input1)
$axeXf = "("&$var2&";0)"
Endif
;************************* Intersection Axe Y pour f*************************
;(0,?) => (0;$AxeY)
If GuiCtrlRead($combo1) = "+" Then
If GuiCtrlRead($combo2) = "+" Then
$var3 = GuiCtrlRead($input2)&"/"&GuiCtrlRead($input4)
Else
$var3 = GuiCtrlRead($input2)&"/"&GuiCtrlRead($combo2)&GuiCtrlRead($input4)
Endif
Else
If GuiCtrlRead($combo2) = "+" Then
$var3 = GuiCtrlRead($combo1)&GuiCtrlRead($input2)&"/"&GuiCtrlRead($input4)
Else
$var3 = GuiCtrlRead($combo1)&GuiCtrlRead($input2)&"/"&GuiCtrlRead($combo2)&GuiCtrlRead($input4)
Endif
Endif
$axeYf = "(0;"&$var3&")"
;************************* Intersection Axe X pour g *************************
$axeXg = $axeYf
;************************* Intersection Axe Y pour g *************************
$axeYg = $axeXf
;************************* Asymptote verticale de f*************************
$AVf = $domf
;************************* Asymptote Horizontale de f*************************
$AHf = $domg
;************************* Asymptote verticale de g*************************
$AVg = $domg
;************************* Asymptote Horizontale de g*************************
$AHg = $domf
;************************* Intersections *************************
$a = Number(GuiCtrlRead($input3))
$b = Number((GuiCtrlRead($combo2)&GuiCtrlRead($input4))-GuiCtrlRead($input1))
$c = Number(-GuiCtrlRead($input2))
$delta = $b^2-4*$a*$c
If $delta > 0 Then
$Point1 = (-$b+Sqrt($delta))/(2*$a)
$Point2 = (-$b-Sqrt($delta))/(2*$a)
$final = "Deux points:"&@CRLF&"- ("&$Point1&";"&$Point1&")"&@CRLF&"- ("&$Point2&";"&$Point2&")"
Elseif $delta = 0 Then
$Point3 = -$b/(2*$a)
$final = "Un point:"&@CRLF&"- ("&$Point3&";"&$Point3&")"
Elseif $delta < 0 Then
$final = "Il n'y a pas d'intersection"
Endif
$Tmp = "Réciproque: "&$reciproque&@CRLF&"dom f: "&$domf&@CRLF&"im f: "&$imf&@CRLF&"Gf^X: "&$axeXf&@CRLF&"Gf^Y: "&$axeYf&@CRLF&"AV de f: "&$AVf&@CRLF&"AH de f: "&$AHf&@CRLF&"-----------------------------------------------"&@CRLF&"dom g: "&$domg&@CRLF&"im g: "&$img&@CRLF&"Gg^X: "&$axeXg&@CRLF&"Gg^Y: "&$axeYg&@CRLF&"AV de g: "&$AVg&@CRLF&"AH de g: "&$AHg&@CRLF&"-----------------------------------------------"&@CRLF&"Intersections entre les deux fonctions:"&@CRLF&$final
GUICtrlSetData($Edit, "")
GUICtrlSetData($Edit, $Tmp)
EndSelect
WEnd