mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-27 23:49:55 +02:00
big function re-org to eliminate debug.scad and hide affine.scad from docs
This commit is contained in:
25
arrays.scad
25
arrays.scad
@@ -1985,4 +1985,29 @@ function is_matrix_symmetric(A,eps=1e-12) =
|
||||
approx(A,transpose(A), eps);
|
||||
|
||||
|
||||
|
||||
// Function&Module: echo_matrix()
|
||||
// Usage:
|
||||
// echo_matrix(M, [description=], [sig=], [eps=]);
|
||||
// dummy = echo_matrix(M, [description=], [sig=], [eps=]),
|
||||
// Description:
|
||||
// Display a numerical matrix in a readable columnar format with `sig` significant
|
||||
// digits. Values smaller than eps display as zero. If you give a description
|
||||
// it is displayed at the top.
|
||||
function echo_matrix(M,description,sig=4,eps=1e-9) =
|
||||
let(
|
||||
horiz_line = chr(8213),
|
||||
matstr = matrix_strings(M,sig=sig,eps=eps),
|
||||
separator = str_join(repeat(horiz_line,10)),
|
||||
dummy=echo(str(separator," ",is_def(description) ? description : ""))
|
||||
[for(row=matstr) echo(row)]
|
||||
)
|
||||
echo(separator);
|
||||
|
||||
module echo_matrix(M,description,sig=4,eps=1e-9)
|
||||
{
|
||||
dummy = echo_matrix(M,description,sig,eps);
|
||||
}
|
||||
|
||||
|
||||
// vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|
||||
|
Reference in New Issue
Block a user