Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

matrix3x3.h

Go to the documentation of this file.
00001 /*
00002   svas_server -- virtual World Server of Svas
00003   Copyright (c) 2001, 2002 David Moreno Montero
00004  
00005  
00006   This program is free software; you can redistribute it and/or modify
00007   it under the terms of the GNU General Public License as published by
00008   the Free Software Foundation; either version 2 of the License, or
00009   (at your option) any later version.
00010  
00011   This program is distributed in the hope that it will be useful, but
00012   WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014   General Public License for more details.
00015  
00016   You should have received a copy of the GNU General Public License
00017   along with this program; if not, write to the Free Software
00018   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00019   02111-1307, USA.  
00020 
00021 */
00022 
00023 
00024 /// Adapted from 
00025 ///
00026 /// Physics for Game Developers
00027 /// David M. Bourg
00028 /// O'Reilly
00029 /// ISBN 0-596-00006-5
00030 
00031 
00032 #ifndef __MATRIX_3x3_H__
00033 #define __MATRIX_3x3_H__
00034 
00035 #include <string>
00036 #include <stdio.h>
00037 #include "vector3d.h"
00038 
00039 /**
00040  * A 3x3 matrix and operations
00041  */
00042 class Matrix3x3{
00043  protected:
00044   double e11,e12,e13,e21,e22,e23,e31,e32,e33;
00045  public:
00046   Matrix3x3(void);
00047   Matrix3x3(double aa, double ab, double ac,
00048         double ba, double bb, double bc,
00049         double ca, double cb, double cc);
00050 
00051   string toString();
00052 
00053   double Determinant();
00054   Matrix3x3 Transpose();
00055   Matrix3x3 Inverse();
00056 
00057   Matrix3x3 &operator+=(const Matrix3x3 &);
00058   Matrix3x3 &operator-=(const Matrix3x3 &);
00059   Matrix3x3 &operator*=(double);
00060   Matrix3x3 &operator/=(double);
00061 
00062   friend inline Matrix3x3 operator*(const Matrix3x3 &A, const Matrix3x3 &B);
00063   friend inline Vector3d operator*(const Matrix3x3 &A, const Vector3d &v);
00064   friend inline Vector3d operator*(const Vector3d &v,const Matrix3x3 &A);
00065 
00066 };
00067 
00068 #include "matrix3x3.cc"
00069 
00070 #endif

Generated on Mon Jun 17 19:53:44 2002 for Svas Server by doxygen1.2.16