From 19c521913d06e6dce929ac25f9699fe559f6e788 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Fri, 21 May 2021 19:03:07 -0400 Subject: [PATCH] Added general root finder --- math.scad | 74 ++++++++++++++++++++++++++++++++++++++++++-- tests/test_math.scad | 32 +++++++++++++++++++ 2 files changed, 104 insertions(+), 2 deletions(-) diff --git a/math.scad b/math.scad index 73659ca..15fc927 100644 --- a/math.scad +++ b/math.scad @@ -1631,8 +1631,6 @@ function c_ident(n) = [for (i = [0:1:n-1]) [for (j = [0:1:n-1]) (i==j)?[1,0]:[0, // Compute the norm of a complex number or vector. function c_norm(z) = norm_fro(z); - - // Section: Polynomials // Function: quadratic_roots() @@ -1859,4 +1857,76 @@ function real_roots(p,eps=undef,tol=1e-14) = ? [for(z=roots) if (abs(z.y)/(1+norm(z))