/// <summary> /// Transforms a point that has 3 dimensions by multiplying it by the specified 3 x 3 matrix in the upper left, /// but treats the bottom row as supplying the translation coordinates. /// </summary> /// <param name="transformMatrix">Transformation matrix for transformation.</param> /// <returns>The resulting vector.</returns> public Vector TransformCoordinate(IMatrix4 transformMatrix) { IMatrixD m = ToMatrix(); IMatrixD res = m.Multiply(transformMatrix); // the output vector will have the coordinates arranged in columns rather than rows. double[,] results = res.Values; return(new Vector(results[0, 0], results[0, 1], results[0, 2])); }
/// <summary> /// Transforms a point that has 3 dimensions by multiplying it by the /// specified 3 x 3 matrix in the upper left, but treats the /// bottom row as supplying the translation coordinates. /// </summary> /// <param name="transformMatrix"></param> /// <returns></returns> public Vector TransformCoordinate(IMatrix4 transformMatrix) { IMatrixD m = ToMatrix(); IMatrixD res = m.Multiply(transformMatrix); // the output vector will have the coordinates arranged in // columns rather than rows. double[,] results = res.Values; return new Vector(results[0, 0], results[0, 1], results[0, 2]); }