Matrix.opBinary

Returns the result of multiplying vec by Matrix. If matrix is not square, the resulting array dimension will be different from input.

  1. T[columnSize] opBinary(T[rowSize] vec)
    struct Matrix(T, uint numColumns, uint numRows = numColumns)
    const
    opBinary
    (
    string op : "*"
    )
    (
    const auto ref T[rowSize] vec
    )
    if (
    numColumns > 0 &&
    numRows > 0
    )
  2. Matrix!(T, OtherColumns, columnSize) opBinary(Matrix!(T, OtherColumns, rowSize) other)

Examples

auto m1 = Mat23.fromRows(1, 2,
                         3, 4,
                         5, 6);
auto v1 = Vec2(1, 2);
assert(m1 * v1 == Vec3(1*1 + 2*2,
                       1*3 + 2*4,
                       1*5 + 2*6));

Meta