Identity matrix: Difference between revisions
Content added Content deleted
(Added Wren) |
|||
Line 3,532: | Line 3,532: | ||
[0 0 1 0] |
[0 0 1 0] |
||
[0 0 0 1]]</pre> |
[0 0 0 1]]</pre> |
||
=={{header|Wren}}== |
|||
{{libheader|Wren-matrix}} |
|||
{{libheader|Wren-fmt}} |
|||
<lang ecmascript>import "/matrix" for Matrix |
|||
import "/fmt" for Fmt |
|||
var numRows = 10 // say |
|||
Fmt.mprint(Matrix.identity(numRows), 2, 0)</lang> |
|||
{{out}} |
|||
<pre> |
|||
| 1 0 0 0 0 0 0 0 0 0| |
|||
| 0 1 0 0 0 0 0 0 0 0| |
|||
| 0 0 1 0 0 0 0 0 0 0| |
|||
| 0 0 0 1 0 0 0 0 0 0| |
|||
| 0 0 0 0 1 0 0 0 0 0| |
|||
| 0 0 0 0 0 1 0 0 0 0| |
|||
| 0 0 0 0 0 0 1 0 0 0| |
|||
| 0 0 0 0 0 0 0 1 0 0| |
|||
| 0 0 0 0 0 0 0 0 1 0| |
|||
| 0 0 0 0 0 0 0 0 0 1| |
|||
</pre> |
|||
=={{header|XPL0}}== |
=={{header|XPL0}}== |