```python
import sympy
from IPython.display import display
import sympy as sp
from sympy import *
sympy.init_printing(use_latex=True)
xl, yl, d, x, y, theta, T, v_k, om_k, w_k, Q = symbols('xl yl d x y theta_k-1 T v_k om_k w_k Q')
X_k = sp.Matrix([[x],[y],[theta]]) + (T * sp.Matrix([[cos(theta),0], [sin(theta), 0], [0, 1]])@(sp.Matrix([[v_k], [om_k]])))
state = sp.Matrix([x, y, theta])
display(state)
F=X_k.jacobian(state)
display(F)
```


$$\left[\begin{matrix}x\\y\\\theta_{k-1}\end{matrix}\right]$$



$$\left[\begin{matrix}1 & 0 & - T v_{k} \sin{\left (\theta_{k-1} \right )}\\0 & 1 & T v_{k} \cos{\left (\theta_{k-1} \right )}\\0 & 0 & 1\end{matrix}\right]$$



```python
#xl, xk, theta, yl, yk, d = symbols('x_l x_k theta_k y_l y_k d')
z = sp.Matrix([[sqrt(((xl-x-d*cos(theta))**2) + ((yl-y-d*sin(theta))**2))], [atan2((yl-y-d*sin(theta)), (xl-x-d*cos(theta))) - theta]])
display(z)
H = z.jacobian(sp.Matrix([x, y, theta]))
display(H)
```


$$\left[\begin{matrix}\sqrt{\left(- d \sin{\left (\theta_{k-1} \right )} - y + yl\right)^{2} + \left(- d \cos{\left (\theta_{k-1} \right )} - x + xl\right)^{2}}\\- \theta_{k-1} + \operatorname{atan_{2}}{\left (- d \sin{\left (\theta_{k-1} \right )} - y + yl,- d \cos{\left (\theta_{k-1} \right )} - x + xl \right )}\end{matrix}\right]$$



$$\left[\begin{matrix}\frac{d \cos{\left (\theta_{k-1} \right )} + x - xl}{\sqrt{\left(- d \sin{\left (\theta_{k-1} \right )} - y + yl\right)^{2} + \left(- d \cos{\left (\theta_{k-1} \right )} - x + xl\right)^{2}}} & \frac{d \sin{\left (\theta_{k-1} \right )} + y - yl}{\sqrt{\left(- d \sin{\left (\theta_{k-1} \right )} - y + yl\right)^{2} + \left(- d \cos{\left (\theta_{k-1} \right )} - x + xl\right)^{2}}} & \frac{- d \left(- d \sin{\left (\theta_{k-1} \right )} - y + yl\right) \cos{\left (\theta_{k-1} \right )} + d \left(- d \cos{\left (\theta_{k-1} \right )} - x + xl\right) \sin{\left (\theta_{k-1} \right )}}{\sqrt{\left(- d \sin{\left (\theta_{k-1} \right )} - y + yl\right)^{2} + \left(- d \cos{\left (\theta_{k-1} \right )} - x + xl\right)^{2}}}\\- \frac{d \sin{\left (\theta_{k-1} \right )} + y - yl}{\left(- d \sin{\left (\theta_{k-1} \right )} - y + yl\right)^{2} + \left(- d \cos{\left (\theta_{k-1} \right )} - x + xl\right)^{2}} & - \frac{- d \cos{\left (\theta_{k-1} \right )} - x + xl}{\left(- d \sin{\left (\theta_{k-1} \right )} - y + yl\right)^{2} + \left(- d \cos{\left (\theta_{k-1} \right )} - x + xl\right)^{2}} & \frac{d \left(d \sin{\left (\theta_{k-1} \right )} + y - yl\right) \sin{\left (\theta_{k-1} \right )}}{\left(- d \sin{\left (\theta_{k-1} \right )} - y + yl\right)^{2} + \left(- d \cos{\left (\theta_{k-1} \right )} - x + xl\right)^{2}} - \frac{d \left(- d \cos{\left (\theta_{k-1} \right )} - x + xl\right) \cos{\left (\theta_{k-1} \right )}}{\left(- d \sin{\left (\theta_{k-1} \right )} - y + yl\right)^{2} + \left(- d \cos{\left (\theta_{k-1} \right )} - x + xl\right)^{2}} - 1\end{matrix}\right]$$



```python

```

6d9033f8bd551401375ccf39ca2de162adf98212
ipynb
Jupyter Notebook
Sate_Estimation_and_Localization_for_Self_Driving_Cars/module2/Jacobian.ipynb
arpan-99/self_driving_cars_specialization
bbca885557898c4428bf84c3af47c327984e729d
MIT
2020-07-02T13:46:12.000Z
2020-07-02T13:46:12.000Z
Sate_Estimation_and_Localization_for_Self_Driving_Cars/module2/Jacobian.ipynb
arpan-99/self_driving_cars_specialization
bbca885557898c4428bf84c3af47c327984e729d
MIT
Sate_Estimation_and_Localization_for_Self_Driving_Cars/module2/Jacobian.ipynb
arpan-99/self_driving_cars_specialization
bbca885557898c4428bf84c3af47c327984e729d
MIT
Qwen/Qwen-72B
1. YES
2. YES