1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-04-20 06:02:05 +02:00
This commit is contained in:
Justin Lin 2021-06-24 15:32:08 +08:00
parent 95c5076a0a
commit fcbf5d1923
3 changed files with 41 additions and 1 deletions

View File

@ -355,7 +355,7 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
Signature | Description
--|--
**maxtrix/m_transpose**(m) | transpose a matrix.
[**maxtrix/m_transpose**(m)](https://openhome.cc/eGossip/OpenSCAD/lib3x-m_transpose.html) | transpose a matrix.
## Surface

30
docs/lib3x-m_transpose.md Normal file
View File

@ -0,0 +1,30 @@
# m_transpose
It transposes a matrix.
**Since:** 2.4
## Parameters
- `m` : A matrix.
## Examples
use <matrix/m_transpose.scad>;
original_m = [
[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12]
];
traget = [
[1, 5, 9],
[2, 6, 10],
[3, 7, 11],
[4, 8, 12]
];
transposed = m_transpose(original_m);
assert(transposed == traget);

View File

@ -1,3 +1,13 @@
/**
* m_transpose.scad
*
* @copyright Justin Lin, 2021
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-m_transpose.html
*
**/
function m_transpose(m) =
let(
column = len(m[0]),