Skip to content
Snippets Groups Projects
Commit d5b4a0bc authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

temporary variables for optim code

parent 5929a656
No related branches found
No related tags found
No related merge requests found
...@@ -417,14 +417,18 @@ inline void QandPmat(const MatrixBase<D1>& th, MatrixBase<D2>& Q, MatrixBase<D3> ...@@ -417,14 +417,18 @@ inline void QandPmat(const MatrixBase<D1>& th, MatrixBase<D2>& Q, MatrixBase<D3>
Id.setIdentity(); Id.setIdentity();
Matrix<T, 3, 1> u = th / thn; Matrix<T, 3, 1> u = th / thn;
Matrix<T, 3, 3> ux = skew(u); Matrix<T, 3, 3> ux = skew(u);
Matrix<T, 3, 3> ux2 = ux*ux;
T thn2 = thn*thn;
T sin_thn = sin(thn);
T cos_thn = cos(thn);
Q = Id Q = Id
+ ((1 - cos(thn))/thn)*ux + ((1 - cos_thn)/thn)*ux
+ ((thn - sin(thn))/(thn*thn))*(ux*ux); + ((thn - sin_thn)/thn2)*(ux2);
P = 0.5*Id P = 0.5*Id
+ ((thn - sin(thn))/(thn*thn))*ux + ((thn - sin_thn)/thn2)*ux
+ ((cos(thn) + 0.5*thn*thn - 1)/(thn*thn))*(ux*ux); + ((cos_thn + 0.5*thn2 - 1)/thn2)*ux2;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment