Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 5b547772 by Kenneth Vanhoey

### localFrame.hpp : handling cross product of orthogonal vectors

parent 181d0923
 ... ... @@ -41,22 +41,22 @@ template Geom::Vector<3,REAL> rotate (Geom::Vector<3,REAL> axis, REAL angle, Geom::Vector<3,REAL> p) ; /** * Util for conversion from spherical to carthesian coordinates. * Util for conversion from spherical to cartesian coordinates. * The spherical coordinates are in radius-longitude-latitude * @param sph the spherical coordinates * @return the carthesian coordinates * @return the cartesian coordinates */ template Geom::Vector<3,REAL> sphericalToCarth (const Geom::Vector<3,REAL>& sph) ; Geom::Vector<3,REAL> sphericalTocart (const Geom::Vector<3,REAL>& sph) ; /** * Util for conversion from carthesian to spherical coordinates. * Util for conversion from cartesian to spherical coordinates. * The spherical coordinates are in radius-longitude-latitude * @param carth the carthesian coordinates * @param cart the cartesian coordinates * @return the spherical coordinates */ template Geom::Vector<3,REAL> carthToSpherical (const Geom::Vector<3,REAL>& carth) ; Geom::Vector<3,REAL> cartToSpherical (const Geom::Vector<3,REAL>& cart) ; /** * Class for representing a direct right-handed local frame composed of 3 orthonormal vectors T (tangent), B (bitangent) and N (normal). ... ... @@ -180,7 +180,8 @@ public: // methods private : // private constants // (T,B,N) can be any orthonormal direct frame // zeros are not recommended since they can // generate zero vectors after a dot product // easily generate zero vectors after a dot product // UPDATE : this problem should be handled in compression // static const REAL Tx = 0.267261 ; // static const REAL Ty = 0.534522 ; // static const REAL Tz = 0.801784 ; ... ...
 ... ... @@ -43,8 +43,8 @@ LocalFrame::LocalFrame(const VEC3& EulerAngles) // get known data const REAL& alpha = EulerAngles[0] ; const REAL& gamma = EulerAngles[1] ; const REAL& beta = EulerAngles[2] ; const REAL& beta = EulerAngles[1] ; const REAL& gamma = EulerAngles[2] ; const VEC3 lineOfNodes = rotate(N,alpha,T) ; // rotation around reference normal of vector T m_N = rotate(lineOfNodes,gamma,N) ; // rotation around line of nodes of vector N ... ... @@ -62,17 +62,26 @@ typename Geom::Vector<3,typename PFP::REAL> LocalFrame::getCompressed() con const VEC3 N(Nx,Ny,Nz) ; REAL& alpha = EulerAngles[0] ; REAL& gamma = EulerAngles[1] ; REAL& beta = EulerAngles[2] ; REAL& beta = EulerAngles[1] ; REAL& gamma = EulerAngles[2] ; VEC3 lineOfNodes = N ^ m_N ; lineOfNodes.normalize() ; // angle between reference T and line of nodes alpha = (B*lineOfNodes > 0 ? 1 : -1) * std::acos(std::max(std::min(REAL(1.0), T*lineOfNodes ),REAL(-1.0))) ; if (lineOfNodes.norm2() < 1e-5) // if N ~= m_N { lineOfNodes = T ; // = reference T alpha = 0 ; gamma = 0 ; } else { lineOfNodes.normalize() ; // angle between reference T and line of nodes alpha = (B*lineOfNodes > 0 ? 1 : -1) * std::acos(std::max(std::min(REAL(1.0), T*lineOfNodes ),REAL(-1.0))) ; // angle between reference normal and normal gamma = std::acos(std::max(std::min(REAL(1.0), N*m_N ),REAL(-1.0))) ; // gamma is always positive because the direction of vector lineOfNodes=(reference normal)^(normal) (around which a rotation of angle beta is done later on) changes depending on the side on which they lay w.r.t eachother. } // angle between line of nodes and T gamma = std::acos(std::max(std::min(REAL(1.0), N*m_N ),REAL(-1.0))) ; // beta is always positive because the direction of vector lineOfNodes=(reference normal)^(normal) (around which a rotation of angle beta is done later on) changes depending on the side on which they lay w.r.t eachother. // angle between reference normal and normal beta = (m_B*lineOfNodes > 0 ? -1 : 1) * std::acos(std::max(std::min(REAL(1.0), m_T*lineOfNodes ),REAL(-1.0))) ; return EulerAngles ; ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!