- Timestamp:
- Nov 21, 2005, 10:02:56 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/math/matrix.cc
r5675 r5677 88 88 int eigenValuesCount = this->getEigenValues(eigenValues); 89 89 90 /* eigenvec creation */ 91 eigVc1.x = -1/this->m13*(this->m33 - eigenValues.x) + 92 (this->m32*(-this->m31*this->m32 + this->m12*this->m33 - this->m12*eigenValues.x)) / 93 this->m13*(-this->m13*this->m22 - this->m12*this->m23 + this->m13*eigenValues.x); 90 if (eigenValuesCount == 2 || eigenValuesCount == 3) 91 { 92 /* eigenvec creation */ 93 eigVc1.x = -1/this->m13*(this->m33 - eigenValues.x) + 94 (this->m32*(-this->m31*this->m32 + this->m12*this->m33 - this->m12*eigenValues.x)) / 95 this->m13*(-this->m13*this->m22 - this->m12*this->m23 + this->m13*eigenValues.x); 94 96 95 eigVc1.y = -( -this->m13*this->m23 + this->m12*this->m33 - this->m12*eigenValues.x) /96 (-this->m31*this->m22 + this->m12*this->m23 + this->m13*eigenValues.x);97 eigVc1.y = -( -this->m13*this->m23 + this->m12*this->m33 - this->m12*eigenValues.x) / 98 (-this->m31*this->m22 + this->m12*this->m23 + this->m13*eigenValues.x); 97 99 98 eigVc1.z = 1.0f;100 eigVc1.z = 1.0f; 99 101 100 eigVc2.x = -1/this->m13*(this->m33 - eigenValues.y) +101 (this->m32*(-this->m31*this->m32 + this->m12*this->m33 - this->m12*eigenValues.y)) /102 this->m13*(-this->m13*this->m22 - this->m12*this->m23 + this->m13*eigenValues.y);102 eigVc2.x = -1/this->m13*(this->m33 - eigenValues.y) + 103 (this->m32*(-this->m31*this->m32 + this->m12*this->m33 - this->m12*eigenValues.y)) / 104 this->m13*(-this->m13*this->m22 - this->m12*this->m23 + this->m13*eigenValues.y); 103 105 104 eigVc2.y = -( -this->m13*this->m23 + this->m12*this->m33 - this->m12*eigenValues.y) /105 (-this->m31*this->m22 + this->m12*this->m23 + this->m13*eigenValues.y);106 eigVc2.y = -( -this->m13*this->m23 + this->m12*this->m33 - this->m12*eigenValues.y) / 107 (-this->m31*this->m22 + this->m12*this->m23 + this->m13*eigenValues.y); 106 108 107 eigVc2.z = 1.0f;109 eigVc2.z = 1.0f; 108 110 109 eigVc3 = eigVc1.cross(eigVc2); 110 111 eigVc3 = eigVc1.cross(eigVc2); 112 } 113 else if (eigenValuesCount == 1) 114 { 115 eigVc1 = Vector(1,0,0); 116 eigVc2 = Vector(0,1,0); 117 eigVc3 = Vector(0,0,1); 118 } 111 119 eigVc1.normalize(); 112 120 eigVc2.normalize();
Note: See TracChangeset
for help on using the changeset viewer.