Skip to content
Snippets Groups Projects
Commit 751c111a authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'my-athena-test' into 'athena-integration-test'

Cherry-picked two commits from GeoModel master

See merge request !93
parents 3bc8efed 6c304982
No related tags found
1 merge request!93Cherry-picked two commits from GeoModel master
...@@ -231,23 +231,25 @@ __attribute__ ((flatten)) ...@@ -231,23 +231,25 @@ __attribute__ ((flatten))
// //
// Get the translation part and the rotation part: // Get the translation part and the rotation part:
// //
GeoTrf::RotationMatrix3D rotate = m_xf.rotation (); Eigen::Matrix3d linear = m_xf.linear ();
Eigen::EigenSolver<GeoTrf::RotationMatrix3D> solver(linear);
Eigen::MatrixXcd D = solver.eigenvalues().asDiagonal();
Eigen::MatrixXcd V = solver.eigenvectors();
GeoTrf::Vector3D translate = m_xf.translation (); GeoTrf::Vector3D translate = m_xf.translation ();
Eigen::AngleAxis<double> aa(rotate);
//
// Evaluate the function
//
double nTimes = (*m_function) (x); double nTimes = (*m_function) (x);
// //
// Modify: // Modify:
// //
translate *= nTimes; translate *= nTimes;
double& delta = aa.angle(); Eigen::Matrix3cd DPowN=Eigen::Matrix3cd::Zero();
delta *= nTimes; for (unsigned int i=0;i<3;i++) DPowN(i,i)=pow(D(i,i),nTimes);
// //
// Now compose these and return a result: // Now compose these and return a result:
// //
return GeoTrf::Translation3D (translate) * GeoTrf::Transform3D(aa); GeoTrf::Transform3D tRPowN = GeoTrf::Transform3D::Identity();
tRPowN.linear()=(V*DPowN*V.inverse()).real();
return GeoTrf::Translation3D (translate) * tRPowN;
} }
GeoTrf::Transform3D Pow::operator () (const GeoGenfun::Argument & argument) const GeoTrf::Transform3D Pow::operator () (const GeoGenfun::Argument & argument) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment