mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-05 14:27:45 +02:00
add doc
This commit is contained in:
@@ -355,7 +355,7 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
|
|||||||
|
|
||||||
Signature | Description
|
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
|
## Surface
|
||||||
|
|
||||||
|
30
docs/lib3x-m_transpose.md
Normal file
30
docs/lib3x-m_transpose.md
Normal 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);
|
@@ -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) =
|
function m_transpose(m) =
|
||||||
let(
|
let(
|
||||||
column = len(m[0]),
|
column = len(m[0]),
|
||||||
|
Reference in New Issue
Block a user