/// @Desc :  Class represents Triangle . 
/// @Package: Core

    /** Class encapsulating a standard 3x3 homogenous matrix.
	<This Description is Adapted from Ogre Documents with some modifications>
        @desc
            Andalus uses row vectors when applying matrix multiplications,
            This means a vector is represented as a single row, 3-row
            matrix. This has the effect that the tranformations implemented
            by the matrices happens left-to-right e.g. if vector V is to be
            transformed by M1 then M2 then M3, the calculation would be
            V * M1 * M2 * M3 . The order that matrices are concatenated is
            vital since matrix multiplication is not cummatative, i.e. you
            can get a different result if you concatenate in the wrong order.

            The use of column vectors and right-to-left ordering is the
            standard in most mathematical texts, and id the same as used in
            OpenGL. It is, however, the opposite of Direct3D, which has
            inexplicably chosen to differ from the accepted standard and uses
            row vectors and left-to-right matrix multiplication.

            Andalus deals with the differences between D3D and OpenGL etc.
            internally when operating through different render systems. Andalus
            users only need to deal with right-to-left matrix multiplication, (Andalus transposes matrices it
            passes to OpenGL to compensate).

            The generic form M * V which shows the layout of the matrix 
            entries is shown below:
						
				         [ m[0]  m[1]  m[2]]   
            [ x y 1 ]  * [ m[3]  m[4]  m[5]]   
                         [ m[6]  m[7]  m[8]]               
    */
class Matrix3x3 <T>
{
public:
	T m[9]
   	///----------------------------------------------------
	/// Constructors 
	///----------------------------------------------------
	
	Matrix3x3();
	Matrix3x3([IN] Matrix3x3 other);
	Matrix3x3(T _11, T _12, T _13,
		     T _21, T _22, T _23,
		     T _31, T _32, T _33);
	Matrix3x3([IN] T[] elements);
	Matrix3x3([IN] T[][] elements);
 
 	///----------------------------------------------------
	/// Triangle Methods 
	///----------------------------------------------------
	
    ///there methods will become operators in C++ 
	Matrix3x3<T> add      (Matrix3x3<T> m); // +
	Matrix3x3<T> subtract (Matrix3x3<T> m); // -
	Matrix3x3<T> muliply  (Matrix3x3<T> m); // *
	Matrix3x3<T> muliply  (T value); // *

	/// @Purpose: transform point - multiply [3*1]Matrix by current matrix and return the result .
	Vector2D<T> muliply (Vector2D<T> m);


	void identity();
	T determined();
	void transpose();
	static Matrix3x3<T> transpose([IN] Matrix3x3 other)
	
	/// make this matrix "translation matrix"
	/// like this :
	/**
		[ 0    0    0]   
		[ 0    0    0]   
        [ x    y    1] 
	   
	*/
    void setTranslate(T xPos, T yPos);
	
	/// create new translation matrix .
	/// multiply new matrix by current matrix
	/// store the result into this matrix
	/// like this :
	/**
		                               [ 0    0    0]     
		ThisMatrix = ThisMatrix *      [ 0    0    0]   
                                       [ x    y    1] 
	   
	*/
	void translate(T xPos, T yPos);
 
	/// make this matrix "rotation matrix"
	/// like this :
	/**
		[ cos(angle)	-sin(angle)	0]   
		[ sin(angle)    cos(angle)	0]   
        [ 0                  0      1] 
	   
	*/
    void setRotate (float angle);
	void rotate (float angle);
 
 	/// make this matrix "rotation matrix"
	/// like this :
	/**
		[ xS	0	0]
		[ 0		yS	0]
        [ 0		0	1] 	   
	*/
    void scale(T xScale,T yScale);
    void setScale(T xScale,T yScale);
 
 
};