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