<scale-matrix3> ( factors -- matrix )
Extra matrix operations

Prev:<rotation-matrix4> ( axis theta -- matrix )
Next:<scale-matrix4> ( factors -- matrix )


Vocabulary
math.matrices.extras

Inputs
factorsa sequence


Outputs
matrixa matrix


Word description
Make a 3 x 3 scaling matrix, used to scale an object in 3 dimensions. See scaling matrix on Wikipedia.

Notes
Only the first three values in factors are used.
This word is the 3-matrix variant of <scale-matrix4>.


Examples
USING: math.matrices.extras prettyprint ; { 22 33 -44 } <scale-matrix4> .
{ { 22 0.0 0.0 0.0 } { 0.0 33 0.0 0.0 } { 0.0 0.0 -44 0.0 } { 0.0 0.0 0.0 1.0 } }


Definition


:: <scale-matrix3> ( factors -- matrix )
factors >scale-factors :> ( x y z )
{ { x 0.0 0.0 } { 0.0 y 0.0 } { 0.0 0.0 z } } ;