[OpenSCAD] Matrix inversion

Parkinbot rudolf at parkinbot.com
Sat Jun 11 20:14:50 EDT 2016


Ups I pressed the wrong button ... 

I'd say this works better:


> function m4inv_solve(i,mx) = 
> 	         !m4inv_zero(mx[i][i  ]) ? m4inv_solve2(i,                     mx
> ) :
> 	i+1<4 && !m4inv_zero(mx[i+1][i]) ? m4inv_solve2(i,
> m4inv_rowswap(i,i+1,mx)) :
> 	i+2<4 && !m4inv_zero(mx[i+2][i]) ? m4inv_solve2(i,
> m4inv_rowswap(i,i+2,mx)) :
> 	i+3<4 && !m4inv_zero(mx[i+3][i]) ? m4inv_solve2(i,
> m4inv_rowswap(i,i+3,mx)) :
> 	m4identity(); // Singular matrix, reset to identity





--
View this message in context: http://forum.openscad.org/Matrix-inversion-tp17647p17649.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list