Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
Solve a Cubic Equation
node v0.12.18
version:
1.0.1
endpoint
share
tweet
var algebra = require("algebra.js"); var Expression = algebra.Expression; var Equation = algebra.Equation;
var exp = new Expression("x"); exp = exp.add(2); exp.toString();
exp = exp.pow(3); exp.toString();
var eq = new Equation(exp, 4); eq.toString();
var x = eq.solveFor("x"); "x = " + x.toString();
:)
Loading…
2 comments
posted
6 years ago
by
balalaxd
sweet
posted
6 years ago
by
balalaxd
But my result is "x = -0.4125989480318004"
sign in
to comment