lammps-master/src/USER-CGDNA/fix_nve_dot.h
inline void vec4_to_vec3(const double * q, const double * v4, double * v3)
  {
    v3[0] = -q[1]*v4[0] + q[0]*v4[1] - q[3]*v4[2] + q[2]*v4[3];
    v3[1] = -q[2]*v4[0] + q[3]*v4[1] + q[0]*v4[2] - q[1]*v4[3];
    v3[2] = -q[3]*v4[0] - q[2]*v4[1] + q[1]*v4[2] + q[0]*v4[3];
  }
// conversion from 4-vector in body frame to 3-vector in space frame
conversion from 4-vector in body frame to 3-vector in space frame
conversion from 4 - vector in body frame to 3 - vector in space frame
inline void vec4_to_vec3(const double * q, const double * v4, double * v3)
  {
    v3[0] = -q[1]*v4[0] + q[0]*v4[1] - q[3]*v4[2] + q[2]*v4[3];
    v3[1] = -q[2]*v4[0] + q[3]*v4[1] + q[0]*v4[2] - q[1]*v4[3];
    v3[2] = -q[3]*v4[0] - q[2]*v4[1] + q[1]*v4[2] + q[0]*v4[3];
  }
inline void vec4_to_vec3 ( const double * q , const double * v4 , double * v3 ) { v3 [ 0 ] = - q [ 1 ] * v4 [ 0 ] + q [ 0 ] * v4 [ 1 ] - q [ 3 ] * v4 [ 2 ] + q [ 2 ] * v4 [ 3 ] ; v3 [ 1 ] = - q [ 2 ] * v4 [ 0 ] + q [ 3 ] * v4 [ 1 ] + q [ 0 ] * v4 [ 2 ] - q [ 1 ] * v4 [ 3 ] ; v3 [ 2 ] = - q [ 3 ] * v4 [ 0 ] - q [ 2 ] * v4 [ 1 ] + q [ 1 ] * v4 [ 2 ] + q [ 0 ] * v4 [ 3 ] ; }
conversion from 4-vector in body frame to 3-vector in space frame
conversion from 4 - vector in body frame to 3 - vector in space frame