mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
doc addition
This commit is contained in:
parent
19c521913d
commit
16ec2ecbd6
1 changed files with 8 additions and 1 deletions
|
@ -1844,6 +1844,13 @@ function _poly_roots(p, pderiv, s, z, tol, i=0) =
|
|||
// eps = used to determine whether imaginary parts of roots are zero
|
||||
// tol = tolerance for the complex polynomial root finder
|
||||
|
||||
// The algorithm is based on Brent's method and is a combination of
|
||||
// bisection and inverse quadratic approximation, where bisection occurs
|
||||
// at every step, with refinement using inverse quadratic approximation
|
||||
// only when that approximation gives a good result. The detail
|
||||
// of how to decide when to use the quadratic came from an article
|
||||
// by Crenshaw on "The World's Best Root Finder".
|
||||
// https://www.embedded.com/worlds-best-root-finder/
|
||||
function real_roots(p,eps=undef,tol=1e-14) =
|
||||
assert( is_vector(p), "Invalid polynomial." )
|
||||
let( p = _poly_trim(p,eps=0) )
|
||||
|
|
Loading…
Reference in a new issue