#include $Nbr_Point = InputBox("Approche polynomiale","Combien de points avez-vous?") Local $values[$Nbr_Point+1][2] $values[0][0] = $Nbr_Point $values[0][1] = $Nbr_Point For $i = 1 To $Nbr_Point $x_y =InputBox("Approche polynomiale","Entrez les coordonnées des points sous la forme (x;y)") $coor = StringSplit($x_y,";") $values[$i][0] = StringRight($coor[1],StringLen($coor[1])-1) $values[$i][1] = StringLeft($coor[2],StringLen($coor[2])-1) Next ;~ _ArrayDisplay($values) $sum = " 0 " For $j = 1 To $Nbr_Point $sum = $values[$j][1] & _PolynomeNumero($j) & " + " & $sum Next MsgBox(0,"Résultat","Le polynome recherché est le suivant ... ") MsgBox(0,"",StringRegExpReplace($sum,"--","+")) Func _PolynomeNumero($x) Assign("P"&$x,"") $P = Eval("P"&$x) $delta = 1 For $i = 1 to $Nbr_Point If $i <> $x Then $delta = $delta * ( $values[$x][0] - $values[$i][0] ) $P = $P & "(x-"&$values[$i][0]&")" ;~ MsgBox(0,$x,$P) ;~ MsgBox(0,"",$delta) EndIf Next Return("/("&$delta&") *" & $P) EndFunc