The matrix type
A matrix in steve refers to a 3x3 matrix which describes a transformation in 3D space. Using transformation matrices is somewhat advanced and they are not generally used in most simulations. Still, they may be useful when dealing with physical simulations.
Matrices may be written in steve as three comma-separated vectors, enclosed in braces ('[' and ']'), as in this example:
# the matrix m will be initialized to: # # [ 1 2 3 ] # [ 4 5 6 ] # [ 7 8 9 ] m = [ (1, 2, 3), (4, 5, 6), (7, 8, 9) ].
Matrix components can be extracted using the list index syntax. Each row of the matrix is a vector:
myVector = myMatrix{ 0 }.
myMatrix{ 1 } = ( 1, 2, 3 ).
Individual numbers may be extracted from matrices just as they are from two-dimensional lists:
myNumber = myMatrix{ 0 }{ 0 }.
myMatrix{ 1 }{ 1 } = 100.
