Repository navigation
Library: Math: Matrix
Matrices are structured arrays of numbers or variables arranged in rows and columns, serving as a powerful tool in various fields of mathematics and applied sciences. They facilitate the representation and manipulation of multiple coordinates, streamlining complex calculations and problem-solving processes. Their versatility extends beyond mathematics, playing a crucial role in computer graphics where they are employed to model the positioning and rotation of elements within a digital environment.
By leveraging the efficiency of matrices, professionals can enhance computational workflows, enabling more effective modeling, simulations, and transformations in both theoretical and practical applications.
It's already imported by default whenever you import assetify. You need to declare the below globally only once:
loadstring(exports.assetify_library:import())()-
local cMatrix1, cMatrix2 = math.matrix({1, 1, 1, 1}, {1, 1, 1, 1}), math.matrix({2, 2, 2, 2}, {2, 2, 2, 2}) local resultant = cMatrix1 + cMatrix2
-
local cMatrix1, cMatrix2 = math.matrix({1, 1, 1, 1}, {1, 1, 1, 1}), math.matrix({2, 2, 2, 2}, {2, 2, 2, 2}) local resultant = cMatrix1 - cMatrix2
-
local cMatrix1, cMatrix2 = math.matrix({1, 1, 1, 1}, {1, 1, 1, 1}), math.matrix({2, 2, 2, 2}, {2, 2, 2, 2}) local resultant = cMatrix1 * cMatrix2
-
local cMatrix1, cMatrix2 = math.matrix({1, 1, 1, 1}, {1, 1, 1, 1}), math.matrix({2, 2, 2, 2}, {2, 2, 2, 2}) local resultant = cMatrix1 / cMatrix2
-
✨ Retrieve's instance's type.
local string: type = self:getType()
-
✨ Creates a matrix instance.
local matrix: cMatrix = math.matrix( ~: ...{~float: ...values} )
-
✨ Destroys an existing matrix.
local bool: result = self:destroy()
-
✨ Scales matrix w/ specified scale.
local matrix: self = self:scale( float: scale )
-
✨ Transforms a valid location matrix.
--Note: All coordinates must be offsets, i.e, they must be relative local matrix: cMatrix = self:transform( matrix: rotationMatrix, float: x, float: y, float: z )