```python
'''import numpy as np
import math
import sympy
import sympy as sp
from sympy import Eq, IndexedBase, symbols, Idx, Indexed, Sum, S, N
from sympy.functions.special.tensor_functions import KroneckerDelta
from sympy.vector import Vector, CoordSys3D, AxisOrienter, BodyOrienter, Del, curl, divergence, gradient, is_conservative, is_solenoidal, scalar_potential, Point, scalar_potential_difference, Del, express, matrix_to_vector
import matplotlib.pyplot as plt
from sympy.physics.vector import ReferenceFrame
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
from IPython.display import display
from IPython.display import display_latex
from sympy import latex
from sympy import Array, Matrix, transpose, zeros, diff, Function, Derivative, cos, sin, sqrt, solve, linsolve, acos, atan, asin
from sympy import symbols
from sympy.plotting import plot'''
from numpy import log, log2
from scipy.linalg import logm, expm

from spatialmath import SO2, SE2
from spatialmath.base import rotx, rot2, det, simplify, skew, vex, trot2, transl2, trplot2
from spatialmath.base import transl, trplot
import spatialmath.base.symbolic as sym
```


```python
np.set_printoptions(formatter={'float': lambda x: "{0: 0.4f}".format(x)})
```

Given  
$^A\xi_B$,  
A is the reference frame  
B is the target frame  

$^AP = ^A\xi_B \cdot ^BP$

We use the operator ⊕ to indicate
composition of relative poses

$^AP = (^A\xi_B \oplus ^B\xi_C) \bullet ^CP$


```python
R = rot2(0.2)
d = det(R)
d
```




$\displaystyle 1.0$




```python
theta = sym.symbol('theta')
R = rot2(theta)
R
```




    array([[cos(theta), -sin(theta)],
           [sin(theta), cos(theta)]], dtype=object)




```python
simplify(R * R)
```




$\displaystyle \left[\begin{matrix}\cos^{2}{\left(\theta \right)} & \sin^{2}{\left(\theta \right)}\\\sin^{2}{\left(\theta \right)} & \cos^{2}{\left(\theta \right)}\end{matrix}\right]$




```python
simplify(det(R))
```




$\displaystyle 1$



Matrix Exponential


```python
R = rot2(0.3)
R
```




    array([[ 0.9553, -0.2955],
           [ 0.2955,  0.9553]])




```python
R = rot2(0.3)
S = logm(R)
```


```python
k = skew(2)
```


```python
vex(S)
```




    array([ 0.3000])




```python
expm(S)
```




    array([[ 0.9553, -0.2955],
           [ 0.2955,  0.9553]])



$R = e^{[\theta]_x} \exists SO(2)$


```python
R = rot2(0.3)
R = expm(skew(0.3))
R
```




    array([[ 0.9553, -0.2955],
           [ 0.2955,  0.9553]])



Pose in 2-Dimensions

Homogeneous Transformation Matrix

$^AP = (^AR_B)$


```python
T1 = transl2(1, 2) * trot2(30, 'deg')
T1
```




    array([[ 0.8660, -0.0000,  0.0000],
           [ 0.0000,  0.8660,  0.0000],
           [ 0.0000,  0.0000,  1.0000]])




```python
trplot( transl(1,2,3), frame='A', rviz=True, width=1, dims=[0, 10, 0, 10, 0, 10])
```


```python
trplot2( transl2(1,2) * trot2(30, 'deg'), frame='A', rviz=True, width=1, dims=[0, 5, 0, 5])
```


```python
transl2(1,2) * trot2(30, 'deg')
```




    array([[ 0.8660, -0.0000,  0.0000],
           [ 0.0000,  0.8660,  0.0000],
           [ 0.0000,  0.0000,  1.0000]])




```python

```

f1364f9bfba7c6242df4854ee74b9b3b8f8ade39
ipynb
Jupyter Notebook
.ipynb_checkpoints/Robotics-checkpoint.ipynb
Valentine-Efagene/Jupyter-Notebooks
91a1d98354a270d214316eba21e4a435b3e17f5d
MIT
.ipynb_checkpoints/Robotics-checkpoint.ipynb
Valentine-Efagene/Jupyter-Notebooks
91a1d98354a270d214316eba21e4a435b3e17f5d
MIT
.ipynb_checkpoints/Robotics-checkpoint.ipynb
Valentine-Efagene/Jupyter-Notebooks
91a1d98354a270d214316eba21e4a435b3e17f5d
MIT
Qwen/Qwen-72B
1. YES
2. YES