Being C=C(quat) the rotational matrix depending on the quaternion q and defined as C=quat2rotation(q), the function returns the derivative, w.r.t. the quanternion components, of the vector dot(C,v), where v is a constant vector.
The elements of the resulting derivative matrix D are ordered such that:
where \(d(.)\) is a delta operator.