CrystalEdge::Matrix(T, H, W)
Inherits Indexable < Enumerable < Iterable < Enumerable < Reference < Object
Column major matrix
Constructors
Class methods
Makes a new rotation matrix
Can be called with one Vector2 or Vector3, like #make_rotation!
Makes a new scaling matrix
Can be called with one Vector2 or Vector3, like #make_scaling!
Makes a new translation matrix
Can be called with one Vector2 or Vector3, like #make_translation!
Instance methods
Make rotation matrix from a zero-filled one.
This method changes current object.
Can be called with one of four values:
# 2D rotation
matrix.make_rotation! theta
# 3D rotation by angle theta around axis represented by unit vector {l, m, n}
matrix.make_rotation! theta, l, m, n
Raises if called with other number of arguments
Make scaling matrix from a zero-filled one.
This method changes current object
Make translation matrix from a zero-filled one.
This method changes current object
Returns submatrix of type m (size MxN) with offset x, y
Transposes a matrix.
This method changes the object
Raises if current matrix is not square
Returns the element at the given index, without doing any bounds check.
Indexable makes sure to invoke this method with index in 0...size,
so converting negative indices to positive ones is not needed here.
Clients never invoke this method directly. Instead, they access
elements with #[](index) and #[]?(index).
This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.