Post · 1 min read· p. 89

DCM.log

DCM.log : Logarithm of DCM.

code
The logarithmic map is defined as the inverse of the exponential map
[[CSL09](/u/fab8b0a9fec670cf#id6)]. It corresponds to the logarithm given by the Rodrigues
rotation formula:

log⁡(R)=θ(RT−R)2sin⁡θ\log(\mathbf{R}) = \frac{\theta(\mathbf{R}^T-\mathbf{R})}{2\sin\theta}
with θ=arccos⁡(tr(R−1)2)\theta=\arccos\Big(\frac{\mathrm{tr}(\mathbf{R}-1)}{2}\Big). The angle of rotation −π<θ<π-\pi < \theta < \pi, satisfies 1+2cos⁡θ=tr(R)1+2\cos\theta = \mathrm{tr}(\mathbf{R}). When θ=0\theta=0, we have the trivial case R=I\mathbf{R}=\mathbf{I}:
log⁡([100010001])=[000000000]\begin{split}\log\Bigg(\begin{bmatrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{bmatrix}\Bigg) = \begin{bmatrix}0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0\end{bmatrix}\end{split}
Returns: : **log** – Logarithm of DCM Return type: : numpy.ndarray Examples ```default

R = DCM(rpy=[10.0, -20.0, 30.0] * ahrs.DEG2RAD) R.view() DCM([[ 0.92541658, -0.31879578, -0.20487413], [ 0.16317591, 0.82317294, -0.54383814], [ 0.34202014, 0.46984631, 0.81379768]])

R.log array([[ 0. , 0.26026043, 0.29531805], [-0.26026043, 0. , 0.5473806 ], [-0.29531805, -0.5473806 , 0. ]]) ```