diff --git a/src/matrix/m_transpose.scad b/src/matrix/m_transpose.scad new file mode 100644 index 00000000..fc8e798f --- /dev/null +++ b/src/matrix/m_transpose.scad @@ -0,0 +1,12 @@ +function m_transpose(m) = + let( + column = len(m[0]), + row = len(m) + ) + [ + for(y = 0; y < column; y = y + 1) + [ + for(x = 0; x < row; x = x + 1) + m[x][y] + ] + ]; \ No newline at end of file