eq

3rd degree equation solver

 
 
View on GitHub
Download as .tar.gz
Download as .zip

local eq = require'eq'

eq.solve2(a, b, c[, epsilon]) -> [s1[, s2]]

Solve the 2nd degree equation ax2 + bx + c and return all the real solutions.

Epsilon controls the precision at which the solver converges on close enough solutions.

eq.solve3(a, b, c, d[, epsilon]) -> [s1[, s2[, s3]]]

Solve the 3rd degree equation ax3 + bx2 + cx + d and return all the real solutions.

Epsilon controls the precision at which the solver converges on close enough solutions.