cmath v0.0.1
cmath
This is a library of fast and robust math operations.
testQuad and solveQuad
Arguments to both are the polynomial coefficients a, b, c for the polynomial
ax² + bx + c.
testQuad returns true if the polynomial has roots between x=0 and x=1, inclusive.
Otherwise it returns false. This is useful for example in piecewise curve intersections.
solveQuad returns an array with all the roots without any range limit.
testCubic and solveCubic
Arguments to both are the polynomial coefficients a, b, c, d for the polynomial
ax³ + bx² + cx + d.
testCubic returns a positive number if the polynomial has roots between x=0 and x=1, inclusive.
Otherwise it returns a negative number. This is useful for example in piecewise curve intersections.
solveCubic returns an array with all the roots without any range limit.
License
Copyright (c) 2017-2018 BusFaster Ltd
8 years ago