Classes | Typedefs

math/CS123Matrix.h File Reference

Provides basic functionality for a templated, arbitrarily-sized matrix. More...

#include <CS123Vector.h>
#include <CS123Algebra.h>
#include <ostream>
#include "CS123Matrix.inl"
Include dependency graph for CS123Matrix.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  CS123Matrix< M, N, T >
 A CS123Matrix is templated to store M rows and N columns of data of type T. If left off, T will default to a "REAL" data type. Also, if N is not specified, the template will default to a square MxM matrix. More...

Typedefs

typedef CS123Matrix< 4, 4 > Matrix4x4
 Standard 4x4 matrix of REALs.
typedef CS123Matrix< 3, 3 > Matrix3x3
 Standard 3x3 matrix of REALs.
typedef CS123Matrix< 2, 2 > Matrix2x2
 Standard 2x2 matrix of REALs.

Functions

Extra operators where Matrix is on right-hand side

template<unsigned M, unsigned N, typename T >
CS123Vector< N, T > operator* (const CS123Vector< M, T > &lhs, const CS123Matrix< M, N, T > &rhs)
 1xM row vector * MxN matrix yields a 1xN vector
template<unsigned M, unsigned N, typename T >
CS123Matrix< M, N, T > operator* (const T &scale, const CS123Matrix< M, N, T > &rhs)
template<unsigned M, unsigned N, typename T >
std::ostream & operator<< (std::ostream &os, const CS123Matrix< M, N, T > &m)
 Prints a Matrix to an output stream.
Routines which generate specific-purpose transformation matrices

Matrix4x4 getScaleMat (const Vector4 &v)
Matrix4x4 getTransMat (const Vector4 &v)
Matrix4x4 getRotXMat (const REAL radians)
Matrix4x4 getRotYMat (const REAL radians)
Matrix4x4 getRotZMat (const REAL radians)
Matrix4x4 getRotMat (const Vector4 &p, const Vector4 &v, const REAL a)
Routines which generate specific-purpose inverse transformation matrices

Matrix4x4 getInvScaleMat (const Vector4 &v)
Matrix4x4 getInvTransMat (const Vector4 &v)
Matrix4x4 getInvRotXMat (const REAL radians)
Matrix4x4 getInvRotYMat (const REAL radians)
Matrix4x4 getInvRotZMat (const REAL radians)
Matrix4x4 getInvRotMat (const Vector4 &p, const Vector4 &v, const REAL a)

Detailed Description

Provides basic functionality for a templated, arbitrarily-sized matrix.

Author:
Travis Fischer (fisch0920@gmail.com)
Date:
Fall 2008

Function Documentation

Matrix4x4 getInvRotMat ( const Vector4 p,
const Vector4 v,
const REAL  a 
)
Returns:
the inverse rotation matrix around the vector and point by the specified angle
Matrix4x4 getInvRotXMat ( const REAL  radians  ) 
Returns:
the inverse rotation matrix about the x axis by the specified angle
Matrix4x4 getInvRotYMat ( const REAL  radians  ) 
Returns:
the inverse rotation matrix about the y axis by the specified angle
Matrix4x4 getInvRotZMat ( const REAL  radians  ) 
Returns:
the inverse rotation matrix about the z axis by the specified angle
Matrix4x4 getInvScaleMat ( const Vector4 v  ) 
Returns:
the inverse scale matrix described by the vector
Matrix4x4 getInvTransMat ( const Vector4 v  ) 
Returns:
the inverse translation matrix described by the vector
Matrix4x4 getRotMat ( const Vector4 p,
const Vector4 v,
const REAL  a 
)
Returns:
the rotation matrix around the vector and point by the specified angle
Matrix4x4 getRotXMat ( const REAL  radians  ) 
Returns:
the rotation matrix about the x axis by the specified angle
Matrix4x4 getRotYMat ( const REAL  radians  ) 
Returns:
the rotation matrix about the y axis by the specified angle
Matrix4x4 getRotZMat ( const REAL  radians  ) 
Returns:
the rotation matrix about the z axis by the specified angle
Matrix4x4 getScaleMat ( const Vector4 v  ) 
Returns:
the scale matrix described by the vector
Matrix4x4 getTransMat ( const Vector4 v  ) 
Returns:
the translation matrix described by the vector
template<unsigned M, unsigned N, typename T >
CS123Matrix<M, N, T> operator* ( const T &  scale,
const CS123Matrix< M, N, T > &  rhs 
) [inline]
Returns:
the MxN matrix resulting from multiplying a scalar by an MxN matrix