Changes in src/ellipsoid.cpp [112b09:5108e1]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ellipsoid.cpp
r112b09 r5108e1 21 21 #include "tesselation.hpp" 22 22 #include "vector.hpp" 23 #include "Matrix.hpp" 23 24 #include "verbose.hpp" 24 25 … … 34 35 Vector helper, RefPoint; 35 36 double distance = -1.; 36 double Matrix[NDIM*NDIM];37 Matrix Matrix; 37 38 double InverseLength[3]; 38 39 double psi,theta,phi; // euler angles in ZX'Z'' convention … … 51 52 theta = EllipsoidAngle[1]; 52 53 phi = EllipsoidAngle[2]; 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);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; 63 64 helper.ScaleAll(InverseLength); 64 65 //Log() << Verbose(4) << "Transformed RefPoint is at " << helper << "." << endl; … … 73 74 phi = -EllipsoidAngle[2]; 74 75 helper.ScaleAll(EllipsoidLength); 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);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; 85 86 //Log() << Verbose(4) << "Intersection is at " << helper << "." << endl; 86 87
Note:
See TracChangeset
for help on using the changeset viewer.