<setshowinfo(0)> <HEAD> <TITLE>matrix.h.html</TITLE> </HEAD> <BODY BGCOLOR=#e7e7e7> <PRE> <FONT COLOR=#0000ff>//***************************************************************************</FONT> <FONT COLOR=#a620f7>#ifndef MATRIX_H</FONT> <FONT COLOR=#a620f7>#define MATRIX_H</FONT> <FONT COLOR=#0000ff>//***************************************************************************</FONT> <B><FONT COLOR=#288a51>class Matrix</FONT></B> {     <B><FONT COLOR=#a62828>private</FONT></B>: 	<B><FONT COLOR=#288a51>int</FONT></B>	nx; 	<B><FONT COLOR=#288a51>int</FONT></B>	ny; 	<B><FONT COLOR=#288a51>int</FONT></B>	allocateFlag; 	<B><FONT COLOR=#288a51>void</FONT></B> allocateMem (<B><FONT COLOR=#288a51>int</FONT></B> m, <B><FONT COLOR=#288a51>int</FONT></B> n); 	<B><FONT COLOR=#288a51>void</FONT></B> deAllocateMem( );      <B><FONT COLOR=#a62828>public</FONT></B>: 	<B><FONT COLOR=#288a51>double</FONT></B>   **p; 	Matrix ( );		<FONT COLOR=#0000ff>// Constructor</FONT> 	Matrix (<B><FONT COLOR=#288a51>int</FONT></B> m, <B><FONT COLOR=#288a51>int</FONT></B> n);		<FONT COLOR=#0000ff>// Constructor</FONT> 	~Matrix ( );		<FONT COLOR=#0000ff>// Destructor</FONT> 	<B><FONT COLOR=#288a51>void</FONT></B> Identity (); 	Matrix &amp;Transpose (); 	Matrix &amp;<B><FONT COLOR=#a62828>operator</FONT></B>+ (Matrix &amp;M1); 	Matrix &amp;<B><FONT COLOR=#a62828>operator</FONT></B>- (Matrix &amp;M1); 	Matrix &amp;<B><FONT COLOR=#a62828>operator</FONT></B>* (Matrix &amp;M1); 	Matrix &amp;<B><FONT COLOR=#a62828>operator</FONT></B>* (<B><FONT COLOR=#288a51>double</FONT></B> k); 	Matrix &amp;<B><FONT COLOR=#a62828>operator</FONT></B>/ (<B><FONT COLOR=#288a51>double</FONT></B> k); 	Matrix &amp;<B><FONT COLOR=#a62828>operator</FONT></B>= (<B><FONT COLOR=#288a51>const</FONT></B> Matrix &amp;M); 	<B><FONT COLOR=#288a51>double</FONT></B> <B><FONT COLOR=#a62828>operator</FONT></B>() (<B><FONT COLOR=#288a51>int</FONT></B> i, <B><FONT COLOR=#288a51>int</FONT></B> j); 	<B><FONT COLOR=#a62828>friend</FONT></B> ostream &amp;<B><FONT COLOR=#a62828>operator</FONT></B>&lt;&lt; (ostream &amp;Out, Matrix &amp;M);  }; <FONT COLOR=#0000ff>//***************************************************************************</FONT> <FONT COLOR=#a620f7>#define DEG2RAD (</FONT><FONT COLOR=#ff00ff>0.01745329251994329576</FONT><FONT COLOR=#a620f7>)</FONT> <FONT COLOR=#a620f7>#define RAD2DEG (</FONT><FONT COLOR=#ff00ff>57.29577951308232087721</FONT><FONT COLOR=#a620f7>)</FONT> Matrix &amp;Transpose (Matrix &amp;M); Matrix &amp;xRotate (<B><FONT COLOR=#288a51>double</FONT></B> angle); Matrix &amp;yRotate (<B><FONT COLOR=#288a51>double</FONT></B> angle); Matrix &amp;zRotate (<B><FONT COLOR=#288a51>double</FONT></B> angle); Matrix &amp;Translate (<B><FONT COLOR=#288a51>double</FONT></B> x, <B><FONT COLOR=#288a51>double</FONT></B> y, <B><FONT COLOR=#288a51>double</FONT></B> z); Matrix &amp;Scale (<B><FONT COLOR=#288a51>double</FONT></B> x, <B><FONT COLOR=#288a51>double</FONT></B> y, <B><FONT COLOR=#288a51>double</FONT></B> z); Matrix &amp;Perspective (<B><FONT COLOR=#288a51>double</FONT></B> lambda); Matrix &amp;Identity (<B><FONT COLOR=#288a51>int</FONT></B> n); Matrix &amp;TransformToImagePlane (<B><FONT COLOR=#288a51>double</FONT></B> x0, <B><FONT COLOR=#288a51>double</FONT></B> y0, <B><FONT COLOR=#288a51>double</FONT></B> z0, <B><FONT COLOR=#288a51>double</FONT></B> xC, 	<B><FONT COLOR=#288a51>double</FONT></B> yC, <B><FONT COLOR=#288a51>double</FONT></B> zC, <B><FONT COLOR=#288a51>double</FONT></B> r1, <B><FONT COLOR=#288a51>double</FONT></B> r2, <B><FONT COLOR=#288a51>double</FONT></B> r3, <B><FONT COLOR=#288a51>double</FONT></B> lambda); <B><FONT COLOR=#288a51>void</FONT></B> PerspectiveTransform (Matrix T, <B><FONT COLOR=#288a51>double</FONT></B> x, <B><FONT COLOR=#288a51>double</FONT></B> y, <B><FONT COLOR=#288a51>double</FONT></B> z, 		        <B><FONT COLOR=#288a51>double</FONT></B> *xp, <B><FONT COLOR=#288a51>double</FONT></B> *yp); <FONT COLOR=#0000ff>//***************************************************************************</FONT> <FONT COLOR=#a620f7>#endif </FONT><FONT COLOR=#0000ff>// MATRIX_H</FONT> <FONT COLOR=#0000ff>//***************************************************************************</FONT> </PRE> </BODY> </HTML> 
