def coeff(x1, y1, x2, y2): a = (y1 - y2) / (x1 - x2) return a def ord_origine(x1, y1, a) : b = y1 - a*x1 return b def equation(x1, y1, x2, y2) : a = coeff(x1, y1, x2, y2) b = ord_origine(x1, y1, a) if b > 0 : msg = "L'équation de votre droite est : y=" + str(a) + "x+" + str(b) elif b < 0 : msg = "L'équation de votre droite est : y=" + str(a) + "x" + str(b) else : msg = "L'équation de votre droite est : y=" + str(a) + "x" return(msg)