v1.1.0
·
34 commits
to master
since this release
Add the Matrix3x3 class.
Change Log
- Add the
Matrix3x3class - Perform refactoring:
- Support multiplication by the
Matrix3x3in theVector2Dclass
- Support multiplication by the
Features
- Classes:
Vector2D:- Constants:
ZERO— (0, 0)BASIS_X— (1, 0)BASIS_Y— (0, 1)
- Operations:
equals(other)— check exact equalityalmost_equals(other, [epsilon])— check approximate equality within a given epsilonlength_squared()— compute the squared lengthlength()— compute the lengthnormalized()— return the normalized vectoradd(other)— add another vectorsub(other)— subtract another vectormul(value)— multiply by a scalar, matrix, or perform component-wise multiplication with another vectorneg()— unary minusdot(other)— compute the dot productdiv(value)— divide by a scalar or perform component-wise division by another vector
- Operators (via metamethods):
==— check exact equality (__eq())#vector— compute the length (__len()); supported only since Lua 5.2+— add two vectors (__add())-— subtract two vectors (__sub())*— multiply by a scalar (vector * scalarorscalar * vector), matrix (vector * matrixormatrix * vector), or perform component-wise multiplication (vector * vector) (__mul())-vector— unary minus (__unm())/— divide by a scalar (vector / scalar) or perform component-wise division (vector / vector) (__div())
- Constants:
Matrix3x3:- Constants:
ZERO— zero matrixIDENTITY— identity matrix
- Operations:
equals(other)— check exact equalityalmost_equals(other, [epsilon])— check approximate equality within a given epsilonadd(other)— add another matrixsub(other)— subtract another matrixmul(value)— multiply by a scalar, vector, or another matrixdiv(value)— divide by a scalar
- Operators (via metamethods):
==— check exact equality (__eq())+— add two matrices (__add())-— subtract two matrices (__sub())*— multiply by a scalar (matrix * scalarorscalar * matrix), vector (matrix * vectororvector * matrix), or another matrix (matrix * matrix) (__mul())/— divide by a scalar (matrix / scalar) (__div())
- Transformation matrix factories:
translate(delta_x, delta_y)— translationrotate(angle)— rotationscale(scale_x, scale_y)— scalingshear(shear_x, shear_y)— shear
- Constants: