Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revisionBoth sides next revision
documentation:language_reference:objects:matrix:start [2018/08/06 11:23] – created Simon Heinzedocumentation:language_reference:objects:matrix:start [2018/09/25 11:32] – Added mentioning of MatrixMeta Simon Heinze
Line 3: Line 3:
  
 ### ###
-The object Matrix defines matrices, i.e. Tables of Tables.+The object Matrix defines matrices, i.e. tables of tables, and defines the standard lua math operations (+,-,*,/,^) among other functionalities on themWhen creating a table-table object in Lua one has to tell the language that this is supposed to be a matrix. This is done by setting the metatable MatrixMeta. 
 + 
 + 
 +<code Quanty Example.Quanty> 
 +--This creates a table of tables 
 +M = {{1,  14 }, 
 +     {33, 4.7}} 
 +--This defines functionalities like addition or multiplication on M 
 +setmetatable(M, MatrixMeta) 
 + 
 +</code>
 ### ###
  
Print/export