I am trying to do rocket trajectory simulations and I am using the cross product steering system. It will later be implemented in an experimental sounding rocket using a hybrid engine. The main problem is calculating the q-matrix. Does anyone have any ideas on how this algorithm can be used in C++?