Changes in src/ellipsoid.cpp [5108e1:112b09]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ellipsoid.cpp
r5108e1 r112b09 21 21 #include "tesselation.hpp" 22 22 #include "vector.hpp" 23 #include "Matrix.hpp"24 23 #include "verbose.hpp" 25 24 … … 35 34 Vector helper, RefPoint; 36 35 double distance = -1.; 37 Matrix Matrix;36 double Matrix[NDIM*NDIM]; 38 37 double InverseLength[3]; 39 38 double psi,theta,phi; // euler angles in ZX'Z'' convention … … 52 51 theta = EllipsoidAngle[1]; 53 52 phi = EllipsoidAngle[2]; 54 Matrix .set(0,0, cos(psi)*cos(phi) - sin(psi)*cos(theta)*sin(phi));55 Matrix .set(1,0, -cos(psi)*sin(phi) - sin(psi)*cos(theta)*cos(phi));56 Matrix .set(2,0, sin(psi)*sin(theta));57 Matrix .set(0,1, sin(psi)*cos(phi) + cos(psi)*cos(theta)*sin(phi));58 Matrix .set(1,1, cos(psi)*cos(theta)*cos(phi) - sin(psi)*sin(phi));59 Matrix .set(2,1, -cos(psi)*sin(theta));60 Matrix .set(0,2, sin(theta)*sin(phi));61 Matrix .set(1,2, sin(theta)*cos(phi));62 Matrix .set(2,2, cos(theta));63 helper *= Matrix;53 Matrix[0] = cos(psi)*cos(phi) - sin(psi)*cos(theta)*sin(phi); 54 Matrix[1] = -cos(psi)*sin(phi) - sin(psi)*cos(theta)*cos(phi); 55 Matrix[2] = sin(psi)*sin(theta); 56 Matrix[3] = sin(psi)*cos(phi) + cos(psi)*cos(theta)*sin(phi); 57 Matrix[4] = cos(psi)*cos(theta)*cos(phi) - sin(psi)*sin(phi); 58 Matrix[5] = -cos(psi)*sin(theta); 59 Matrix[6] = sin(theta)*sin(phi); 60 Matrix[7] = sin(theta)*cos(phi); 61 Matrix[8] = cos(theta); 62 helper.MatrixMultiplication(Matrix); 64 63 helper.ScaleAll(InverseLength); 65 64 //Log() << Verbose(4) << "Transformed RefPoint is at " << helper << "." << endl; … … 74 73 phi = -EllipsoidAngle[2]; 75 74 helper.ScaleAll(EllipsoidLength); 76 Matrix .set(0,0, cos(psi)*cos(phi) - sin(psi)*cos(theta)*sin(phi));77 Matrix .set(1,0, -cos(psi)*sin(phi) - sin(psi)*cos(theta)*cos(phi));78 Matrix .set(2,0, sin(psi)*sin(theta));79 Matrix .set(0,1, sin(psi)*cos(phi) + cos(psi)*cos(theta)*sin(phi));80 Matrix .set(1,1, cos(psi)*cos(theta)*cos(phi) - sin(psi)*sin(phi));81 Matrix .set(2,1, -cos(psi)*sin(theta));82 Matrix .set(0,2, sin(theta)*sin(phi));83 Matrix .set(1,2, sin(theta)*cos(phi));84 Matrix .set(2,2, cos(theta));85 helper *= Matrix;75 Matrix[0] = cos(psi)*cos(phi) - sin(psi)*cos(theta)*sin(phi); 76 Matrix[1] = -cos(psi)*sin(phi) - sin(psi)*cos(theta)*cos(phi); 77 Matrix[2] = sin(psi)*sin(theta); 78 Matrix[3] = sin(psi)*cos(phi) + cos(psi)*cos(theta)*sin(phi); 79 Matrix[4] = cos(psi)*cos(theta)*cos(phi) - sin(psi)*sin(phi); 80 Matrix[5] = -cos(psi)*sin(theta); 81 Matrix[6] = sin(theta)*sin(phi); 82 Matrix[7] = sin(theta)*cos(phi); 83 Matrix[8] = cos(theta); 84 helper.MatrixMultiplication(Matrix); 86 85 //Log() << Verbose(4) << "Intersection is at " << helper << "." << endl; 87 86
Note:
See TracChangeset
for help on using the changeset viewer.