mat-calc.hpp File Reference

Go to the source code of this file.

Functions

double det (const mat &m)
mat inv (const mat &m)


Function Documentation

double det const mat m  )  [inline]
 

return its determinant

Definition at line 3 of file mat-calc.hpp.

Referenced by inv().

00004 {
00005   return
00006     m.xx*m.yy*m.zz + m.xy*m.yz*m.zx + m.xz*m.yx*m.zy
00007     -m.xx*m.yz*m.zy -m.xy*m.yx*m.zz -m.xz*m.yy*m.zx;
00008 }

mat inv const mat m  )  [inline]
 

return its inverse matrix

Definition at line 12 of file mat-calc.hpp.

References det().

Referenced by operator/().

00013 {
00014   double d( det(m) );
00015   return mat
00016     (
00017      (m.yy*m.zz-m.yz*m.zy)/d, (m.xz*m.zy-m.xy*m.zz)/d, (m.xy*m.yz-m.xz*m.yy)/d,
00018      (m.yz*m.zx-m.yx*m.zz)/d, (m.xx*m.zz-m.xz*m.zx)/d, (m.xz*m.yx-m.xx*m.yz)/d,
00019      (m.yx*m.zy-m.yy*m.zx)/d, (m.xy*m.zx-m.xx*m.zy)/d, (m.xx*m.yy-m.xy*m.yx)/d
00020      );
00021 }


Generated on Tue Mar 15 16:02:38 2005 for QVM by  doxygen 1.4.1