Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Moreiotas Wiki › Guides › Perform Matrix Operations for Complex Calculations

Perform Matrix Operations for Complex Calculations

Creating Matrices

Matrices can be constructed in several ways depending on your needs. Build identity matrices (ones on the diagonal, zeros elsewhere), zero matrices (all zeros), or rotation matrices for geometric transformations. You can also assemble arbitrary matrices by providing rows as lists of numbers, vectors, or nested lists.

Basic Matrix Math

Once created, matrices support standard operations: addition combines two matrices element-wise, multiplication performs true matrix multiplication (not element-wise), and transpose flips rows and columns. The inverse action computes the matrix inverse, useful for solving systems of equations or reversing transformations.

Concatenation for Data Organization

Horizontal concatenation joins matrices side-by-side (adding columns), while vertical concatenation stacks them (adding rows). This is valuable for building larger data structures or combining multiple datasets.

Practical Example

Create a rotation matrix to transform 3D coordinates, multiply it by a vector iota to rotate a position, then use the result to adjust entity locations or construct new geometric patterns in your hex casting system.