diff --git a/doc/pprz_algebra/headfile.pdf b/doc/pprz_algebra/headfile.pdf index 2806500348..26e5acf269 100644 Binary files a/doc/pprz_algebra/headfile.pdf and b/doc/pprz_algebra/headfile.pdf differ diff --git a/doc/pprz_algebra/matrix.tex b/doc/pprz_algebra/matrix.tex index f87dbed340..70b9d854ab 100644 --- a/doc/pprz_algebra/matrix.tex +++ b/doc/pprz_algebra/matrix.tex @@ -71,6 +71,8 @@ d_{00} & 0 & 0 \\ \mat C = \mat A - \mat B \end{equation} \inHfile{RMAT\_DIFF(c, a, b)}{pprz\_algebra} +For bigger matrices you have to spezify the number of rows (\texttt{i}) and the number of columns (\texttt{j}). +\inHfile{MAT\_SUB(i, j, C, A, B)}{pprz\_simple\_matrix} @@ -89,6 +91,16 @@ and with the inverse matrix \end{equation} \inHfile{INT32\_RMAT\_COMP\_INV(m\_a2b, m\_a2c, m\_b2c)}{pprz\_algebra\_int} \inHfile{FLOAT\_RMAT\_COMP\_INV(m\_a2b, m\_a2c, m\_b2c)}{pprz\_algebra\_float} +Multiplication is also possible with bigger matrices +\begin{equation} +\mat C_{i \cross j} = \mat A_{i \cross k} \multiplication \transp{\mat B_{j \cross k}} +\end{equation} +\inHfile{MAT\_MUL\_T(i, k, j, C, A, B)}{pprz\_simple\_matrix} +or +\begin{equation} +\mat C_{i \cross j} = \mat A_{i \cross k} \multiplication \mat B_{k \cross j} +\end{equation} +\inHfile{MAT\_MUL(i, k, j, C, A, B)}{pprz\_simple\_matrix} \subsection{Transformation from a Matrix} @@ -125,3 +137,14 @@ Calculates the Frobenius Norm of a matrix \norm{\norm{\mat M}}_F = \sqrt{\sum_{i=1}^3 \sum_{i=1}^3 m_{ij}^2 } \end{equation} \inHfile{FLOAT\_RMAT\_NORM(m)}{pprz\_algebra\_float} + +\subsection*{$\inv{\mat A} $ Inversion} +The inversion of a 3-by-3 matrix is made using the adjugate matrix and the determinant: +\begin{equation} +\inv{\mat A} = \frac{adj(\mat A)}{det(\mat A} = \frac{1}{det{\mat A}} \begin{pmatrix} +a_{22}a_{33}-a_{23}a_{32}&a_{13}a_{32}-a_{12}a_{33}&a_{12}a_{23}-a_{13}a_{22}\\ +a_{23}a_{31}-a_{21}a_{33}&a_{11}a_{33}-a_{13}a_{31}&a_{13}a_{21}-a_{11}a_{23}\\ +a_{21}a_{31}-a_{22}a_{31}&a_{12}a_{31}-a_{11}a_{32}&a_{11}a_{22}-a_{12}a_{21} +\end{pmatrix} +\end{equation} +\inHfile{MAT\_INV33(invS, S)}{pprz\_simple\_matrix} \ No newline at end of file