I am trying to use JavaScript to solve the linear equation with variables.
So my try is this:
var CE = parseFloat(document.getElementById("CE").value)
var CF = parseFloat(document.getElementById("CF").value)
var EF = parseFloat(document.getElementById("EF").value)
var x1=algebra.parse("CE^2+2*EF*x-EF^2");
var x2=algebra.parse("CF^2");
var eq= new Equation(x1,x2);
var h=eq.solveFor("x");
I know I should not put the valuable in "" mark, but I do not know where I should put them.
Please help me. Thank you!