fonction d'une droite (et parabole?)

y = mx + b (y = a2x + bx + c)

by toubia95

HTML

<input id="testeur" type="text" style="width: 100%">

CSS

/* http://www.webmath.com/equline1.html */
/* http://stackoverflow.com/questions/717762/how-to-calculate-the-vertex-of-a-parabola-given-three-points => calcul automatique du sommet */

JavaScript

/* fonction d'une droite passant par deux points (xa,ya) et (xb,yb) */
function lineq(xa,ya,xb,yb,x) {
    return ((yb-ya)/(xb-xa))*x+(ya-(((yb-ya)/(xb-xa))*xa));
}

/* fonction d'une parabole passant par trois points (xa,ya),(xb,yb) et (xc,yc) */
function paraboleq(xa,ya,xb,yb,xc,yc,x) {
    
}

$("#testeur").val(lineq(0,1,12,3,8));