Math module

reflect_cols

procedureSource

Multiplies the matrix pointed to by the reflection I - u u^T from the right, in place: every row vector v[i] becomes v[i] - u * dot(v[i], u). u should come from make_reflector (length square root of 2).

Example↗
m := Matrix3_Identity;
reflect_cols(*m, make_reflector(xyz(0, 3, 4)));
assert(abs((m * xyz(0, 3, 4)).z + 5) < 0.0001);
reflect_cols :: (M: *Matrix3, u: Vector3)

Reflects each of the matrix's row vectors M.v[i] in place.

Parameters

M: *Matrix3
the matrix to change.
u: Vector3
the reflector, from make_reflector.

See also