from math import * import matplotlib.pyplot as plt # Application à la parabole def abscisse_minmax(a, b, c) : return -b/(2 * a) def image(a, b, c, x) : return a* x**2 + b*x + c def tracer_courbe(a, b, c, pas) : # Calcul des coordonneées du min/max # pour définir un intervalle l'incluant x_minmax = abscisse_minmax(a, b, c) y_minmax = image(a, b, c, x_minmax) debut = x_minmax - 5 fin = x_minmax + 5 X_liste = [] Y_liste = [] curseur = debut while curseur < fin : X_liste.append(curseur) Y_liste.append(image(a, b, c, curseur)) curseur = curseur + pas plt.plot(X_liste , Y_liste , "r-") # Un point bleu pour le sommet plt.plot(x_minmax , y_minmax , "b.") plt.grid() # Affichage de la grille plt.show()