<diagonal-matrix> ( diagonal-seq -- matrix )
Matrix operations

Prev:<zero-square-matrix> ( n -- matrix )
Next:<anti-diagonal-matrix> ( diagonal-seq -- matrix )


Vocabulary
math.matrices

Inputs
diagonal-seqa sequence


Outputs
matrixa matrix


Word description
Creates a matrix with the specified main diagonal. This word has the opposite effect of main-diagonal.

Notes
To use a diagonal starting in the lower right, reverse the input sequence before calling this word.

Examples
USING: math.matrices prettyprint ; { 1 2 3 } <diagonal-matrix> .
{ { 1 0 0 } { 0 2 0 } { 0 0 3 } }


Definition