diff --git a/math.scad b/math.scad index 6f736e1..3cd7702 100644 --- a/math.scad +++ b/math.scad @@ -106,9 +106,9 @@ function factorial(n,d=1) = product([for (i=[n:-1:d]) i]); // // Points colored in ROYGBIV order. // rainbow(pts) translate($item) circle(d=3,$fn=8); function lerp(a,b,u) = - assert(same_shape(a,b), "Bad or inconsistent inputs to lerp") + assert(same_shape(a,b), "Bad or inconsistent inputs to lerp") is_num(u)? (1-u)*a + u*b : - assert(!is_undef(u)&&!is_bool(u)&&!is_string(u), "Input u to lerp must be a number, vector, or range.") + assert(!is_undef(u)&&!is_bool(u)&&!is_string(u), "Input u to lerp must be a number, vector, or range.") [for (v = u) lerp(a,b,v)]; @@ -562,12 +562,12 @@ function median(v) = // want to solve Ax=b1 and Ax=b2 that you need to form the matrix transpose([b1,b2]) for the right hand side and then // transpose the returned value. function linear_solve(A,b) = - assert(is_matrix(A)) - let( - m = len(A), - n = len(A[0]) - ) - assert(is_vector(b,m) || is_matrix(b,m),"Incompatible matrix and right hand side") + assert(is_matrix(A)) + let( + m = len(A), + n = len(A[0]) + ) + assert(is_vector(b,m) || is_matrix(b,m),"Incompatible matrix and right hand side") let ( qr = m0 && - (is_undef(m) || len(A)==m) && - is_vector(A[0]) && - (is_undef(n) || len(A[0])==n) && - (!square || n==m) && - is_consistent(A); + is_list(A) && len(A)>0 && + (is_undef(m) || len(A)==m) && + is_vector(A[0]) && + (is_undef(n) || len(A[0])==n) && + (!square || n==m) && + is_consistent(A); diff --git a/version.scad b/version.scad index b6f3f93..651bb2f 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,200]; +BOSL_VERSION = [2,0,201]; // Section: BOSL Library Version Functions