[37] | 1 | /* |
---|
| 2 | |
---|
| 3 | Brian Curless |
---|
| 4 | |
---|
| 5 | Computer Graphics Laboratory |
---|
| 6 | Stanford University |
---|
| 7 | |
---|
| 8 | --------------------------------------------------------------------- |
---|
| 9 | |
---|
| 10 | Copyright (1997) The Board of Trustees of the Leland Stanford Junior |
---|
| 11 | University. Except for commercial resale, lease, license or other |
---|
| 12 | commercial transactions, permission is hereby given to use, copy, |
---|
| 13 | modify this software for academic purposes only. No part of this |
---|
| 14 | software or any derivatives thereof may be used in the production of |
---|
| 15 | computer models for resale or for use in a commercial |
---|
| 16 | product. STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND |
---|
| 17 | CONCERNING THIS SOFTWARE. No support is implied or provided. |
---|
| 18 | |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | #ifndef _MATRIX2F_ |
---|
| 23 | #define _MATRIX2F_ |
---|
| 24 | |
---|
| 25 | #include "defines.h" |
---|
| 26 | |
---|
| 27 | class Matrix2f { |
---|
| 28 | |
---|
| 29 | public: |
---|
| 30 | float m[2][2]; |
---|
| 31 | |
---|
| 32 | Matrix2f() {} |
---|
| 33 | void clear() {setValue(0,0,0,0);} |
---|
| 34 | void setValue(const Matrix2f &a); |
---|
| 35 | void setValue(float a[][2]); |
---|
| 36 | void setValue(float *a0, float *a1); |
---|
| 37 | void setValue(float a00, float a01, float a10, |
---|
| 38 | float a11); |
---|
| 39 | float elem(int i, int j) {return m[i][j];} |
---|
| 40 | void setElem(int i, int j, float val) {m[i][j] = val;} |
---|
| 41 | Matrix2f inverse() const; |
---|
| 42 | void multArray(float *in, float *out); |
---|
| 43 | void makeIdentity(); |
---|
| 44 | //void toNR(Matrix2f &in, float **nrmat) const; |
---|
| 45 | void setScale(float s); |
---|
| 46 | void setScale(float sx, float sy); |
---|
| 47 | }; |
---|
| 48 | |
---|
| 49 | #endif |
---|