Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ellipsoid.cpp

    r5108e1 r112b09  
    2121#include "tesselation.hpp"
    2222#include "vector.hpp"
    23 #include "Matrix.hpp"
    2423#include "verbose.hpp"
    2524
     
    3534  Vector helper, RefPoint;
    3635  double distance = -1.;
    37   Matrix Matrix;
     36  double Matrix[NDIM*NDIM];
    3837  double InverseLength[3];
    3938  double psi,theta,phi; // euler angles in ZX'Z'' convention
     
    5251  theta = EllipsoidAngle[1];
    5352  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);
    6463  helper.ScaleAll(InverseLength);
    6564  //Log() << Verbose(4) << "Transformed RefPoint is at " << helper << "." << endl;
     
    7473  phi = -EllipsoidAngle[2];
    7574  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);
    8685  //Log() << Verbose(4) << "Intersection is at " << helper << "." << endl;
    8786
Note: See TracChangeset for help on using the changeset viewer.