cgma
CubitTransformMatrix.cpp File Reference

Go to the source code of this file.

Functions

CUBIT_UTIL_EXPORT CubitVector operator* (const CubitVector &point, const CubitTransformMatrix &matrix)

Function Documentation

CUBIT_UTIL_EXPORT CubitVector operator* ( const CubitVector point,
const CubitTransformMatrix matrix 
)

Definition at line 286 of file CubitTransformMatrix.cpp.

{
    // Make a 1x4 matrix, multiply matrix by it.
  CubitMatrix m1(1,4);
  m1.set(0, 0, point.x());
  m1.set(0, 1, point.y());
  m1.set(0, 2, point.z());
  m1.set(0, 3, 1);
  
    // Perform the multiplication
  m1 = m1 * matrix;
    // The result is a 1x4
  
    // Put the results into a vector (dividing by w), and return
  double w = m1.get(0,3);
  return CubitVector(m1.get(0,0)/w, m1.get(0,1)/w, m1.get(0,2)/w);
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines